I used bvp4c to solve second order differential equation: A*y'' = f(y), now I want to get some special values from the solutions. How to get the values of y'' and y' from each point?

 採用された回答

Torsten
Torsten 2015 年 5 月 4 日

1 投票

If you solved your equation by solving the System
y1'=y2
y2'=f(y)/A,
you can get y' and y'' by
yp=deval(sol.yp,sol.x);
plot(sol.x,yp(1,:),sol.x,yp(2,:));
Here, yp(1,:)=y' and yp(2,:)=y''.
Best wishes
Torsten.

2 件のコメント

Jane
Jane 2015 年 5 月 4 日
編集済み: Jane 2015 年 5 月 4 日
Torsten, thank you very much for your kind help! Sorry to trouble you again, when I use:
yp=deval(sol.yp,sol.x);
it shows:
Error using deval
must be a structure returned by a differential equation solver.
Error in bvp3
yp = deval(sol.yp,sol.x);
What would be wrong with it?
Torsten
Torsten 2015 年 5 月 5 日
You must call deval with the solution obtained by bvp4c.
Thus
sol=bvp4c(...);
yp=deval(sol.yp,sol.x);
Best wishes
Torsten.

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

その他の回答 (0 件)

カテゴリ

質問済み:

2015 年 5 月 4 日

コメント済み:

2015 年 5 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by