I have a symbolic function dependent of r called u(r). I obtain this function from a differential equation in u.
Otherwise i have another symbolic function called sigma_r which is function of u and also of u derivatives.
When i display sigma it appears as function of u(r) and D(u)(r).
u(r) is function of r and 2 integration constant C1 and C2.
I would like to express sigma_r as function of r, C1 and C2.
I try sigma_r = subs(sigma_r,u(r)) but it appears like Matlab can't replace it and it can't calculate u derivative.
Here are the script
u(r) = dsolve(diff(sigma_r) + (sigma_r - sigma_theta)/r + rho*w^2*r ==0,'IgnoreAnalyticConstraints', true) % In this differential equation sigma_r, sigma_theta are function of u, and Matlab replace their expression as function of u and solve for u. it works well.
sigma_r(r) = subs(sigma_r,u(r))
Here are what Matlab displays at the command window :
u(r) =
C1/r^2.2107342132367193698883056640625 + 0.97655737574677914381027221679688*r^3 + C2*r^6.50236464850604534149169921875
sigma_r(r) =
(9671406556917033397649408*((33290247625219093223312621495090757213591748336283774753774513840*u(**0.97655737574677914381027221679688*(C7/r^2.2107342132367193698883056640625 + 0.97655737574677914381027221679688*r^3 + C8*r^6.50236464850604534149169921875)^3 +
As you can see, the expression of sigma_r still contains u.
Thank you for your help,
Nidal Kochrad