Hi your question is quite difficult to solve out.
Since the common method combined with [dsolve()] + [diff] doesn't work at all.
e.g if you type the following command to generate the general solution of this ODE, the IDE should warn you that "Explicit solution could not be found."
syms y(x)Therefore, my current solution is just alternatively get the graphic answer of your equation. But I will dig further in the field and give a better solution if I would find in future.
Generally, I manually set a x domain at [-8 8], and inital y value at 2, and then I use ode45 command to help me generate the equation graph. Hope you could like it.
Anyhow, here is my code.
clc; clear all; clfThe graph should look like
用matlab求dy\/dx=y+x\/y-x的通解
Anyhow, here is my code.clc; clear all; clf% dy x% --- == y + --- - x% dx yode1 = @(x,y)(y+x\/y-x);% assume -8 < x < 8 and initial y0 = 2[x,y] = ode45(ode1, [-8:.01:8], 2.0);plot(x, y, 'r', 'linewidth', 4)xlabel('x'), ...
如何利用matlab求微分方程通解?
第一种方法:利用dsolve函数求微分方程的符号解(通解):对于一些不是很难,要求出通解的微分方程,用dsolve函数求解。1、 打开Matlab软件-->点击新建脚本菜单,新建一个脚本文件用于编写微分方程求解程序。2、 输入微分方程求解程序-->点击保存-->点击运行。3、在matlab的命令窗口即可看到求解结果,是...
matlab中求微分方程组通解
[x y]=dsolve('Dy=4*x-2*y', 'Dx=2*x-y','t')x = 1\/4*C1+1\/2*C1*t+1\/2*C2 y = C1*t+C2
求助各路大神:用Matlab求解一阶导数和二阶导数问题,并作图。
回答:用matlab的符号工具箱MuPAD算了下。 你这种方程组不怎么怎么称呼,大学高数忘得差不多了。所以我也不明白,为什么给了初值,解出的答案还是个类似通解的东西。
如何用Matlab求线性方程组的通解
function [x,y]=line_solution(A,b)[m,n]=size(A);y=[];if norm(b)>0 if rank(A)==rank([A,b])if rank(A)==n disp('方程有唯一解x');x=A\\b;else disp('方程有无穷多解,特解为x,其齐次方程组的基础解系为y');x=A\\b;y=null(A,'r');%null是用来求齐次线性方程组...
matlab微分方程的解?
Dy=diff(y,1);Dz=diff(z,1);3、使用dsolve求y(x),z(x)解析表达式,即 [y,z]=dsolve(Dy-z==sin(x),Dz+y==1+x,y(0)==2,z(0)==7)4、将x【0,10】间划分若干等份,如n=50 5、分别计算与x对应的y(x),z(x)值 6、使用plot函数,绘制x—y(x),x—z(x)曲线图 三、...
matlab 如何求一组微分方程组的通解?
y6=dsolve(diff(y6)==-b\/m*(Vx^2+Vy^2+Vz^2)*Vz)y1 = C2 + Vx*t y2 = C4 - (t*(b*Vx^3 + b*Vx*Vy^2 + b*Vx*Vz^2))\/m y3 = C6 + Vy*t y4 = C8 - (t*(b*Vx^2*Vy + b*Vy^3 + b*Vy*Vz^2))\/m y5 = C10 + Vz*t y6 = C12 - (t*(b*Vx...
利用matlab的符号运算,求解(1)y^m=xe^x的通解
y=dsolve('Dy=x','x')y=dsolve('D2y=Dy+1','x')y=dsolve('D2y=Dy+1','Dy(0)=0','y(0)=1','x')
matlab求解微分方程的通解问题
对标准答案进行验算:syms x y y=sqrt(2*pi\/x)*sin(x);y1=diff(y,'x');y2=diff(y,'x',2);h=x^2*y2+x*y1+(x^2-1\/2)*y;h=simplify(h)结果:h = -1\/4\/x*2^(1\/2)*sin(x)*pi^(1\/2)\/(1\/x)^(1\/2)可见不等于0,=y,说明原答案有问题 ...
如何使用matlab求导?
C1,C2,..的通解自变量缺省值为t 也可求解微分方程组 例 1、dsolve('Dy=1+y^2')结果ans =tan(t+C1)2、y=dsolve('Dy=1+y^2','y(0)=1','x')结果y =tan(x+1\/4*pi)3、x=dsolve('D2x+2*D1x+2*x=exp(t)','x(0)=1','Dx(0)=0')结果x =1\/5*exp(t)+3\/5*exp(-t...