1个回答
展开全部
采用Runge-Kutta法:
syms x(t)
[V,Y] = odeToVectorField(4*diff(x,2)==(3*x-2*x^2)*diff(x)-4*x);
M = matlabFunction(V,'vars', {'t','Y'});
sol = ode45(M,[0 100],[2,0]);
x1 = linspace(0,100,1000);
y = deval(sol,x1,1:2);
plot(x1,y);
grid on
legend('x','x''')
syms x(t)
[V,Y] = odeToVectorField(4*diff(x,2)==(3*x-2*x^2)*diff(x)-4*x);
M = matlabFunction(V,'vars', {'t','Y'});
sol = ode45(M,[0 100],[2,0]);
x1 = linspace(0,100,1000);
y = deval(sol,x1,1:2);
plot(x1,y);
grid on
legend('x','x''')
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询