Solve parametric equation with parameters

Hi, I have the following problem, in which a and b are constants (geometric parameters), phi is the variable (angle). Moreover, h and lbda are geometrical indicators depending on phi. U is the total elastic energy of the system, in which lbdan is the natural length (lbda>lbdan).
eqn1 represents the sationarity condition for U. It leads to lbda=lbdan or lbda'=0 (its derivative). By considering the last case, we have that tan(phi)=-(sqrt(3))/3.
clc; clear all; close all
syms lb a b phi k lbda_n
h = (lb^2 - a^2 - b^2 + 2*a*b*cos(phi))^1/2;
lbda = (lb^2 + a*b*(3*cos(phi) - sqrt(3)*sin(phi)))^(1/2);
dlbda_dphi = diff(lbda, phi);
% disp(dlbda_dphi)
d2_dlbda_dphi = diff(lbda, phi,2);
% disp(d2_dlbda_dphi)
assume (lbda > lbda_n)
U = (3*k*(lbda - lbda_n)^2)/2;
dU_dphi = diff(U, phi);
d2_dU_dphi = diff(U, phi,2);
% disp(dU_dphi)
eqn1=solve(dlbda_dphi==0,phi,'ReturnConditions',true);
I know analitically the solution of eqn1, how can I obtain the same result in matlab?
Is my script correct?
Thanks

댓글 수: 2

Ritam
Ritam 2026년 4월 16일 6:12
Could you please let me know what result you are expecting? It would also be helpful if you could briefly explain what each variable represents, and whether it is intended to be a constant or a variable. This additional context will help me verify whether the script is behaving as intended.
Gaetano Pavone
Gaetano Pavone 2026년 4월 20일 10:49
@Ritam I've edited my post with all info.

댓글을 달려면 로그인하십시오.

답변 (0개)

제품

릴리스

R2022a

태그

질문:

2026년 4월 13일 15:35

댓글:

2026년 4월 20일 10:49

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!