How to solve simultaneous equation with trigonometric function
6 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
KSSV
2022-7-26
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 个评论
Walter Roberson
2022-7-30
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
2022-7-30
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))
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Particle & Nuclear Physics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!