How to plot the phase portrait of a second-order differential equation? I cannot use quiver

6 ビュー (過去 30 日間)
𝑥̈+ 𝑥̇ − 𝑥 − 𝑥 2 = 0
b. 𝑥̈+ 4𝑥̇ + 4𝑥 = 0
c. 𝑥̈− 2𝑥̇ + 2𝑥 = −8
d. 𝑥̈− 2𝑥 − 𝑥̇ − 2 = 0
I need to plot the phase portrait of these systems. What is wrong?
syms t
syms x(t)
dx=diff(x);
d2x=diff(x,2);
eq=d2x+dx-x-x.^2==0;
t=linspace(-1,1,100);
for n=1:5
s1=dsolve(eq,x(0)==n,dx(0)==n);
s2=diff(s1);
s1=subs(s1);
s2=subs(s2);
plot(s1,s2);
hold on
n=n+1;
end

採用された回答

SaiDileep Kola
SaiDileep Kola 2021 年 2 月 26 日
Check the answer on similar question answered here

その他の回答 (1 件)

Shadaab Siddiqie
Shadaab Siddiqie 2021 年 2 月 26 日
From my understanding you want to plot symbolic equation. Please refer ezplot which might help you.

カテゴリ

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