How do I solve the following second order differential equation?

1 回表示 (過去 30 日間)
John O'Brian
John O'Brian 2017 年 10 月 22 日
コメント済み: John O'Brian 2017 年 10 月 26 日
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
Ramanuja Jagannathan 2017 年 10 月 25 日
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?
John O'Brian
John O'Brian 2017 年 10 月 26 日
actually can you help me with this attached file? thanks!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by