dCfdzf(z, theta) =
Hi Luca,
I have updated the code to properly define the equations and solved them, please see below.
syms zf zr L Cf(zf, zr);
% Define theta explicitly as a function of zf, zr, and L
theta = @(zf, zr, L) (zf - zr) / L;
% Calculate partial derivatives of Cf with respect to zf and zr
Cf_zf = diff(Cf, zf);
Cf_zr = diff(Cf, zr);
% Define the equations with the correct variables
eqn1 = Cf_zf == diff(Cf, zf);
eqn2 = Cf_zr == diff(Cf, zr);
% Solve the equations
S = solve([eqn1, eqn2]);
The above code defines symbolic variables zf, zr, L, and a function Cf(zf, zr). It then explicitly defines theta as a function of zf, zr, and L. Next, it calculates the partial derivatives of the function Cf with respect to zf and zr using the diff() function. Two equations (eqn1 and eqn2) are defined based on these derivatives. Finally, the code aims to solve these equations using the solve() function to find the values that satisfy both equations simultaneously.
This corrected approach should resolve the issues and allow you to compute the desired derivatives and solve the equations effectively. Adjust the `Cf` function and additional calculations as per your specific problem requirements. Please let me know if you have further questions.