Differentiate symbolic composite function

4 views (last 30 days)
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.

Accepted Answer

Deepak Ramaswamy
Deepak Ramaswamy on 4 Jun 2014
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 Comment
Carmelo
Carmelo on 6 Jun 2014
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.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!