Symbolic function- differential equation sloving

How can I find the maximum or minimum values of the answer of a differential equation after solving it? It returns Symbolic Function as the solution of the equation.

1 件のコメント

Soheil Habibian
Soheil Habibian 2017 年 10 月 27 日
I did it. Thank you everyone

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

回答 (2 件)

KSSV
KSSV 2017 年 10 月 27 日

0 投票

You substitute the required values in the solution using subs and then call max / min.

4 件のコメント

Soheil Habibian
Soheil Habibian 2017 年 10 月 27 日
編集済み: Soheil Habibian 2017 年 10 月 27 日
My code:
syms y(x)
Dy = diff(y);
ode = diff(y,x,2)+(c/I)*diff(y,x)+(kt/I)*y == 0;
cond1 = y(0) == 75;
cond2 = Dy(0) == 0;
conds = [cond1 cond2];
ySol(x) = dsolve(ode,conds);
g = simplify(ySol);
How can I use the subs for symfun? Thank you
Walter Roberson
Walter Roberson 2017 年 10 月 27 日
symfun and regular sym are the same except for the indexing operation name(value).
Soheil Habibian
Soheil Habibian 2017 年 10 月 27 日
The problem is I don't know what syntax to use. Can you type it for me? thank you
Walter Roberson
Walter Roberson 2017 年 10 月 27 日
points_of_interest = solve( diff(g, x), x );
which_sign = sign( subs( diff(g, x, x), points_of_interest ) );
After that you need to know how to determine from the sign whether you are dealing with a min or a max or an inflection point.

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

Walter Roberson
Walter Roberson 2017 年 10 月 27 日

0 投票

You take the derivative of the equation and you solve for zeros. Then you take the second derivative and check the sign at each of the zeros in order to determine whether you have a min, max, or saddle.

カテゴリ

質問済み:

2017 年 10 月 27 日

コメント済み:

2017 年 10 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by