How to differentiate several symbolic functions?

2 views (last 30 days)
I have 3 symbolic functions; L10(a) , L1(u,a) and finally epsilon1(u). I wish to differentiate the last symbolic function (epsilon1) with respect to u, but it only gives me 0 because it does not take into account how I defined L1 and L10 previously which contains u. How can I solve this?
syms L10(a)
L10(a) = 2*a;
syms L1(u,a)
L1(u,a) = sqrt((2*a)^2+u^2);
syms epsilon1(L1,L10)
epsilon1(u) = (L1-L10)/L10;
df = diff(epsilon1(u),u)

Accepted Answer

madhan ravi
madhan ravi on 5 Sep 2019
Edited: madhan ravi on 5 Sep 2019
syms L10(a) L1(a,u) epsilon1(a,u)
L10(a) = 2*a;
L1(a,u) = sqrt((2*a)^2+u^2);
epsilon1(a,u) = (L1(a,u)-L10(a))/L10(a);
df = diff(epsilon1(a,u),u)
  2 Comments
Ruslan Khoguev
Ruslan Khoguev on 6 Sep 2019
Does this code look correct to you? I get a long answer and I am unable to confirm if its right or not.
syms L10(a) L1(a,u) epsilon1(a,u) L20(a) N1(a,u,EA) N2(a,u,EA) P(a,u,EA)
L10(a) = 2*a;
L20(a) = sqrt(5)*a;
L1(a,u) = sqrt((2*a)^2+u^2);
L2(a,u) = sqrt((2*a)^2+(a-u)^2);
epsilon1(a,u) = (L1(a,u)-L10(a))/L10(a);
epsilon2(a,u) = (L2(a,u)-L20(a))/L20(a);
N1(a,u) = EA*epsilon1;
N2(a,u) = EA*epsilon2;
P(a,u,EA) = (u/L1)*N1-((a*u)/L2)*N2
df = diff(P(a,u,EA),u)

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!