필터 지우기
필터 지우기

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 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