Your question is very difficult indeed. So far I cannot find any helpful information available either online or textbook to help me generate a correct solution indeed.
But here is my code to just get petty net result as you expect to apply in your question above. If you like it, don't forget to give me a thumb up! Cheers ~
- - - - - - - - - - - - - - - - - - - - c o d e - - - - - - - - - - - - - - - - - - - -
clear all
syms x y z
% define a function 'f' in terms of 'x', 'y' and 'z'
f = exp(z)-x*y*z;
zOFxy = sym('z(x,y)');
fprintf('\n')
% replace z with z(x,y)
f_zOFxy = subs(f, z, zOFxy);
disp('F(x,y,z) = ')
pretty(f_zOFxy) % 1st print F(x,y,z)
fprintf('\n')
% 1st derivative with respect to x
dfx = diff(f_zOFxy, x);
% 2nd derivative with respect to y
dfxy = diff(dfx, y);
disp('F(x,y,z)'' = ')
pretty(dfxy) % 2nd print F''(x,y,z)
dzOFxy = diff(diff(zOFxy, x), y);
syms Zxy Zx Zy Z
% replace the symbolic derivative like:
% ∂
% -- z(x,y) -> Zx
% ∂x
%
% ∂
% -- z(x,y) -> Zy
% ∂y
% ∂
% --- z(x,y) -> Zxy
% ∂xy
df1 = subs(dfxy, diff(zOFxy, x), Zx);
df2 = subs(df1, diff(zOFxy, y), Zy);
df3 = subs(df2, dzOFxy, Zxy);
df4 = subs(df3, zOFxy, Z);
% move Zxy to the left side of equation
dzOVERdxy = solve(df4, Zxy);
pretty(dzOVERdxy) % 3rd print Zxy = ....
- - - - - - - - - - - - - - - - - - - - c o d e - - - - - - - - - - - - - - - - - - - -
I don't know why I fail to find the code input selection on the tool box in this reply. Plain txt fomat might be quite indiscernible to read though. So my personal suggestion is to copy the code to your Matlab and the code should display like:
After running my code, you should also generate the exactly same result as shown below.
广告 您可能关注的内容 |