how to write partial derivatives in MATLAB

6 ビュー (過去 30 日間)
Ken
Ken 2022 年 5 月 26 日
コメント済み: Walter Roberson 2022 年 6 月 25 日
I am trying to form a 2X2 matrix using partial derivatives i.e. [delf1/delx1, delf1/delx2; delf2/delx1, delf2/delx2]. Not sure how to write it.
  2 件のコメント
John D'Errico
John D'Errico 2022 年 5 月 26 日
編集済み: John D'Errico 2022 年 5 月 26 日
This is strange. @Torsten gave you a simple solution. Your response was that the excercise is so simple, that it should be doable using direct computations. In fact, it is quite simple. So do it.
In fact, you know how to form a matrix, since you wrote that part in your question. So just compute the derivatives. Where is the problem? Do you not know how to use diff? Are you not allowed to use diff? If you can use diff, then do so. If not, then you must understand what the definition of a derivative is, as a limit, and surely you have learned how to approximate a derivative? So what are you not saying? Don't just say it is easy, as you would not be asking the question if it was really that easy for you.
IF the entire thing is too complex for you to do, then take one piece at a time. You have a function (actually, two of them), of two variables. Differentiate each piece with respect to each variable, using whatever means you wish. Then do that 4 times, and put it together.
Ken
Ken 2022 年 5 月 26 日
Maybe I didn't explain clearly:
delf1delx1=????;
Not sure what to put on the RHS of the eqn

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

採用された回答

Torsten
Torsten 2022 年 5 月 26 日
  27 件のコメント
Ken
Ken 2022 年 6 月 24 日
Thanks. just wonder about the foll. hint I rec'd and if it can be used to solve this problem:
"First, we're dealing with a discrete system here, so there's no dependency on time t anymore. Further i want to note that the execise gives you x=x[k-1] and u=u[k]. Given the state transition x[k] = x[k-1] + u[k] the solution is as simple as f = @(x, u) x + u. Differentiating this equation by x and u will then give you two very simple, constant matrices as the solution."
Walter Roberson
Walter Roberson 2022 年 6 月 25 日
syms x [2 1]
syms u [2 1]
f = x + u
f = 
jacobian(f, x)
ans = 
jacobian(f, u)
ans = 

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDynamic System Models についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by