How to solve simultaneous equation with trigonometric function
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
christina widyaningtyas
le 26 Juil 2022
Commenté : Torsten
le 30 Juil 2022
Hello, any one can help me
syms alpha gamma R d
R = 0.08;
d = 1.4;
R^2 == 4*(alpha)^2 / [(2*(alpha)^2 + 1) * acos*(2*gamma) + (2*(alpha)^2 - 1) * cos*(2*gamma) + 2*alpha*(asin*(2*gamma)) - sin*(2*gamma)]
d == atan*[(atan(2*alpha*tan*gamma + 1) + tan*gamma) / (tan*gamma - atan*gamma + 2*alpha)]
sol = solve ([R^2, d] , [alpha, gamma])
alphaSol = sol.alpha
gammaSol = sol.gamma
I need to obtain alpha and gamma
There is : Error using acos
Not enough input arguments.
- if I delete acos, another error is appear (cos, ect)
0 commentaires
Réponse acceptée
KSSV
le 26 Juil 2022
You cannot write acos*(2*gamma) and tan*gamma. Note that they are function and they need someinput. It migh be: acos(2*gamma) and tan(gamma)
syms alpha gamma R d
R = 0.08;
d = 1.4;
R^2 == 4*(alpha)^2 / ((2*(alpha)^2 + 1) * acos(2*gamma) + (2*(alpha)^2 - 1) * cos(2*gamma) + 2*alpha*(asin(2*gamma)) - sin(2*gamma))
d == atan((atan(2*alpha*tan(gamma) + 1) + tan(gamma)) / (tan(gamma) - atan(gamma) + 2*alpha))
sol = solve ([R^2, d] , [alpha, gamma])
alphaSol = sol.alpha
gammaSol = sol.gamma
Though the above is not giving any solution, you need to check your expression properly.
17 commentaires
Walter Roberson
le 30 Juil 2022
Take the tand out of both sides of the second equation, so
tand(d) == tand(atand(Expression))
and simplify to
tand(d) == Expression
it makes it easier for vpasolve to find solutions
Torsten
le 30 Juil 2022
Seems there are several solutions to your equations:
R = 0.07;
d = -135;
fun = @(alpha,gamma)[4*alpha^2/((2*alpha^2+1)*cosh(2*gamma)+(2*alpha^2-1)*cos(2*gamma)+2*alpha*(sinh(2*gamma)-sin(2*gamma)))-R^2;...
(tanh(2*alpha*tan(gamma)+1)+tan(gamma))/(tan(gamma)-tanh(gamma)+2*alpha)-tand(d)];
options = optimset('TolFun',1e-8,'TolX',1e-8);
alpha0 = 0.15;
gamma0 = 1.7;
x0 = [alpha0,gamma0];
sol = fsolve(@(x)fun(x(1),x(2)),x0,options);
alpha = sol(1)
gamma = sol(2)
fun(alpha,gamma)
alpha0 = -0.4;
gamma0 = -2.3;
x0 = [alpha0,gamma0];
sol = fsolve(@(x)fun(x(1),x(2)),x0,options);
alpha = sol(1)
gamma = sol(2)
fun(alpha,gamma)
syms alpha gamma %R d
R = 0.07;
d = -135;
expr1 = R^2 == 4*alpha^2/((2*alpha^2+1)*cosh(2*gamma)+(2*alpha^2-1)*cos(2*gamma)+2*alpha*(sinh(2*gamma)-sin(2*gamma)));
expr2 = tand(d) == (tanh(2*alpha*tan(gamma)+1)+tan(gamma))/(tan(gamma)-tanh(gamma)+2*alpha);
[sol_alpha, sol_gamma] = solve([expr1,expr2], [alpha,gamma])
fun(double(sol_alpha),double(sol_gamma))
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Calculus dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!