calculation of a derivative writing a function
4 ビュー (過去 30 日間)
古いコメントを表示

I want to maximize the function U with respect to
in order to find
.
That's I want to take derivative the function U with respect to
and then it is equal to zero in order to find
.
But I cannot write the code properly. Please help me to do this. Thank you!
0 件のコメント
回答 (2 件)
William Rose
2022 年 5 月 29 日
Why will maximizing U with respect to
help you find
?
You said you cannot write the code for
properly. Do you have a formula for
? Even if you do have the formula for
, it will be complicated and nonlinear. When yo set it equal to zero, it will not tell you what
is.
If you want a numerical solution for the maximum of U, you don't need to find the point where the derivative equals zero. You can simply use fminsearch() or fminbnd() to minimize
. You will need to provide values for the other constants, such as
etc.
0 件のコメント
Torsten
2022 年 5 月 29 日
Your function does not have local maxima or minima in terms of theta0.
If theta0 is restricted to an interval [theta0min,theta0max], the maximum will be in one of the boundary points.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Numerical Integration and Differential Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!