Differentiate symbolic composite function

Hello,
I am currently using MATLAB R2013a and I am trying to differentiate an expression in order to obtain a symbolic non linear differential equation. The expression has the following form:
syms t a(t) b(t) c(t)
f=f(a(t),b(t),c(t))
where neither a(t), b(t) nor c(t) are known in their functional form, but the relation f(a(t),b(t),c(t)) is known in it's functional form. I wish to obtain:
df/da=g(a(t),b(t),c(t))
df/db=h(a(t),b(t),c(t))
df/dc=k(a(t),b(t),c(t))
I define the composite function f(a(t),b(t),c(t)), MATLAB recongnizes only a function of t f=f(t). I perform the following symbolic operations:
diff(f,a(t))
diff(f,b(t))
diff(f,c(t))
MATLAB does not recognize f as a composite function of a(t), b(t), c(t) and cannot perform the above differentiations. I cannot remove the time dependence a(t), b(t), c(t) since it will then be necessary to derive with respect to time.
Is some solution known for a problem of this type?
Thank you in advance.
Carmelo.

 채택된 답변

Deepak Ramaswamy
Deepak Ramaswamy 2014년 6월 4일

0 개 추천

Does this work?
syms t at bt ct
f = at*bt*ct*t;
syms a(t) b(t) c(t)
dfda = subs(diff(f,at),[at,bt,ct],[a(t),b(t),c(t)])
dfa =
t*b(t)*c(t)
I probably missed why time dependence can't be removed

댓글 수: 1

Carmelo
Carmelo 2014년 6월 6일
Thank you, I guess the subs function is the key. Time dependence couldn't be removed since I need to later solve the differential equation.
Best regards.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

질문:

2014년 6월 3일

댓글:

2014년 6월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by