How to solve simultaneous equation with trigonometric function
19 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
KSSV
on 26 Jul 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 Comments
Torsten
on 30 Jul 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))
More Answers (0)
See Also
Categories
Find more on Special Values in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!