How do I solve the following second order differential equation?

1 次查看(过去 30 天)
Can you give me the code on how to solve the following equation?
1.4x'' + 4x' + 1700x = - [-8x' + 20(x')^3 + 100x - 2.5x^3]
Thanks!

回答(1 个)

Ramanuja Jagannathan
Please find below the documentation link showing how to represent differential equations in MATLAB and solve them. https://www.mathworks.com/help/symbolic/solve-a-single-differential-equation.html
Hope this helps
  2 个评论
John O'Brian
John O'Brian 2017-10-25
编辑:Torsten 2017-10-26
Hi I have the following code:
syms y(t)
[V] = odeToVectorField(1.4*diff(y, 2) == 8*diff(y)-20*(diff(y)).^3-100*y+2.5*y.^3-4*diff(y)-1700*y);
M = matlabFunction(V,'vars', {'t','Y'});
sol = ode45(M,[0 20],[0.01 0]);
opts = odeset('OutputFcn',@odephas2); % Options Structure
tspan = linspace(0, 1, 100); % Times For Evaluation
ic = [0 1]; % Initial Conditions
[t, xt] = ode45(EqnFcn, tspan, ic);
figure(1)
[t, xt] = ode45(EqnFcn, tspan, ic, opts);
title('Phase Plane Plot')
axis equal
figure(2)
plot(t, xt)
grid on
title('Time Domain Plot')
EqnSubc = regexp(sprintf('%s\n',Eqn_subs), '\n','split');
legend(EqnSubc{1:end-1})
I am trying to plot a phase plane plot for a variety of initial conditions. I think it might require a for loop. Can you adjust the code and show me how to do it please?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Number Theory 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by