Substituting the partial differentiation
Mostrar comentarios más antiguos
I am trying to substitute the partial differential equation but I can't find appropriate function.
Here is the sample code I have to modify.
syms u v x(u,v) y(u,v) z(x,y)
z = exp(x*y) ;
x = 2*u+v ;
y = u/v ;
dx = diff(x,u)
dy = diff(y,u)
dz_du = diff(z,u)
dz_du = subs(dz_du, {diff(x,u),diff(y,u)}, {dx, dy})
The result is
dx =
2
dy =
1/v
dz_du(u, v) =
exp(x(u, v)*y(u, v))*(y(u, v)*diff(x(u, v), u) + x(u, v)*diff(y(u, v), u))
dz_du(u, v) =
exp(x(u, v)*y(u, v))*(y(u, v)*diff(x(u, v), u) + x(u, v)*diff(y(u, v), u))
The point is, those diff(x(u, v), u) & diff(y(u, v), u) haven't substituted.
(what I want is the result below)
exp(x(u, v)*y(u, v))*(y(u, v)*2 + x(u, v)*1/v)
*At first, I changed the last line
subs(dz_du, {diff(x(u,v),u),diff(y(u,v),u)}, {dx, dy})
but it only returns error.
** I found some answers asking the version of my MATLAB and it is R2021a
Is there any way to guide matlab to substitute those partial differentiations?
3 comentarios
Star Strider
el 25 de Jul. de 2023
I am not certain what you want to do or what result you want.
VBBV
el 25 de Jul. de 2023
It seems you have defined z = exp(x*y) first. You should define it after x and y. Then do the diff(z,u) which will give the same result but in u and v. There's no need for subs in the equation
Tae Woo Lee
el 25 de Jul. de 2023
Respuestas (0)
Categorías
Más información sobre Linear Algebra en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!