Plot time trace of differential equation

1 回表示 (過去 30 日間)
John O'Brian
John O'Brian 2017 年 10 月 29 日
Hi, I have the following code:
syms a(b) [V] = odeToVectorField(1.4*diff(a, 2) == 8*diff(a)-20*(diff(a)).^3-100*a+2.5*a.^3-4*diff(a)-1700*a); M = matlabFunction(V,'vars', {'b','Y'}); sol = ode15s(M,[0 20],[0.01 0]); fplot(@(x)deval(sol,x,1), [0, 2]);
But it plots a graph from 0 to 2 on the x-axis. I want to have it from 0 to 2000. I can change the 20 in sol = ode15s(M,[0 20],[0.01 0]); to 2000 then the 2 in fplot to 2000 also, but the graph gets too many oscillations. How can I change the scale of the x-axis to 0 to 2000 and still maintain a graph with few oscillations? Thanks!!

回答 (0 件)

カテゴリ

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