How to find the differential equation ? ode solver

2 ビュー (過去 30 日間)
STP
STP 2019 年 2 月 5 日
コメント済み: STP 2019 年 2 月 11 日
So I am very new to matlab ; now wish to use ode solver. I am a little stuck with a thing ; If I have an ouput plot as my objective to plot ; and I have the solutions of the differential equations - is there a way to know he differential equation which can be put in the ode solver in order to reach the objective plot ?

採用された回答

Torsten
Torsten 2019 年 2 月 5 日
If the output plot function is f(t) and f(t0)=f0, then the corresponding ODE reads
dy/dt = f'(t) with y(t0) = f0.
This ODE should reproduce y = f.
Best wishes
Torsten.
  16 件のコメント
STP
STP 2019 年 2 月 7 日
Thanks a ton! :)
STP
STP 2019 年 2 月 11 日
Hi, sorry to bother again, I found out the initial conditions; and wanted to check whether they after ode solver and the above back drafting method you showed me leads to the same output; but somehow it doesnt; Can you make out whatsa wrong?
Tc = 2.0, alfa = beta=5; alfa = 2.beta/(beta+1); tau1= 2; tau2= 2.4; gamma=alfa.(2-exp(-tau1));*
Tc.*dEe/dt + Ee = -alfa.*Ek ... 1
initial condions be : for time span1= [0 t1] or eg [0 4.2] Ek = -1
for time span2 = [t1 t2] or [4.2 5] Ek = 1 How does solving eq.1 lead to below
EeA = @(t) -alfa .*exp(-t) + alfa; EeB = @(t) gamma.*exp(-(t-tau1)) - alfa;
My output comes nowhere like it should; its a straight line than the exponential curve it should be Eeplot.PNG
beta = 5;
Ek = -1;
Tc = 2.0;
tau1 = 2;
tau2 = 2.4;
gamma=alfa.*(2-exp(-tau1));
alfa = 2.*beta/(beta+1);
dEedt = @(t,y) ((-alfa.*Ek) - Ee)./Tc
t1 = [0 4.2]
y0 = 0;
[t1, EeA] = ode15s(dEedt,t1, y0);
plot(t1,EeA)

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by