Addition of derivative goes wrong

1 回表示 (過去 30 日間)
MINATI PATRA
MINATI PATRA 2021 年 5 月 27 日
コメント済み: MINATI PATRA 2021 年 5 月 27 日
syms M k Ec Pr y
T(M, k, Ec, Pr, y) = (A*Ec*Pr/(Ec*Pr-4*A))*( exp(-2*y*sqrt(A)) - exp(-y*sqrt(Ec*Pr)) ) + (y*sqrt(Ec*Pr)/2 + 1)*exp(-y*sqrt(Ec*Pr));
DT = gradient(T(M, k, Ec, Pr, y),Vp); Vp = [M k Ec Pr y]; Vs = [5 1 0.1 5 0.1];
DTV = subs(DT,Vp,Vs);
% ANSWER is coming as this for the above approach: 0.14785682021063908572684904500442
% But when I ran the derivative separately and adding them answer is coming as : 0.2014966764864323281894134426085 ( correct ANSWER according to my work as % I have drawn fig which is matching with previous work)
% How to modify or ...
  2 件のコメント
Torsten
Torsten 2021 年 5 月 27 日
I don't see where you add the derivatives.
Further, Vp must be defined before you compute the gradient.
MINATI PATRA
MINATI PATRA 2021 年 5 月 27 日
It is ok now,
Thank you
Dear Torsten

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

回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by