how to define a variable as a function of another variable in symbolic toolbox

4 ビュー (過去 30 日間)
Amit Kumar
Amit Kumar 2014 年 10 月 5 日
コメント済み: Amit Kumar 2014 年 10 月 6 日
Hi I am just wondering whether is it possible to do following: define a variable as a function of x
u=f(x)
Then,
d/dx (u*x) = u'x + xu'
u' is first derivative of u w.r.t. x.
Is this possible to do using matlab symbolic toolbox?
  2 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2014 年 10 月 5 日
It's not u'x + xu' but
u'x + x'u
Star Strider
Star Strider 2014 年 10 月 6 日
You need to set it up correctly:
syms f(x) u(x)
ddx = diff(u*f,x)
>
ddx(x) =
D(f)(x)*u(x) + f(x)*D(u)(x)

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

回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 10 月 5 日
syms x u
u=cos(x)
y=u*x
out=diff(y,x)
  3 件のコメント
Star Strider
Star Strider 2014 年 10 月 6 日
You need to set it up correctly:
syms f(x) u(x)
ddx = diff(u*f,x)
>
ddx(x) =
D(f)(x)*u(x) + f(x)*D(u)(x)
Amit Kumar
Amit Kumar 2014 年 10 月 6 日
Thanks!

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by