How do I solve the following second order differential equation?

1 visualización (últimos 30 días)
John O'Brian
John O'Brian el 22 de Oct. de 2017
Comentada: John O'Brian el 26 de Oct. de 2017
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!

Respuestas (1)

Ramanuja Jagannathan
Ramanuja Jagannathan el 25 de Oct. de 2017
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 comentarios
John O'Brian
John O'Brian el 25 de Oct. de 2017
Editada: Torsten el 26 de Oct. de 2017
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 el 26 de Oct. de 2017
actually can you help me with this attached file? thanks!

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by