syms x(t)
ode45 = diff(x,t,2) + ((4.2/(t + 3))/2)*x == 0;
Dx = diff(x);
DDx = diff(Dx);
cond1 = x(0) == 0;
cond2 = Dx(0) == 5;
conds = [cond1 cond2];
xSol = dsolve(ode45,conds);
fimplicit (@(t) xSol(t),[-20 20 -20 20])
xlim([-10 10]);
ylim([-10 10]);
grid on;
I am trying to plot this equation, the plot opens up but its all empty.
Warnings: Unable to find explicit solution.
> In dsolve (line 201)
In test (line 12)

 採用された回答

Stephan
Stephan 2019 年 10 月 10 日
編集済み: Stephan 2019 年 10 月 10 日

1 投票

The warning means, that Matlab did not find an analytical solution - solve numeric:
syms x(t) Dxt(t)
ode = diff(x,t,2) + ((4.2/(t + 3))/2)*x == 0;
[ode, vars] = reduceDifferentialOrder(ode, x);
[V, S] = odeToVectorField(ode);
fun = matlabFunction(V,'Vars',{'t','Y'});
[t, xSol] = ode45(fun,[0 200],[0 5]);
plot(t,xSol)
grid on;

2 件のコメント

Rasandemusen
Rasandemusen 2019 年 10 月 10 日
One more thing, does the orange curve show the derivate of the blu function?
Thank you for the help!
Stephan
Stephan 2019 年 10 月 10 日
Yes, the order of the variables is saved in vector S. in this order Y[1] and Y[2] are saved in the functionHandle.

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

その他の回答 (0 件)

カテゴリ

質問済み:

2019 年 10 月 10 日

コメント済み:

2019 年 10 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by