How to solve single variable nonlinear trigonometric function?

조회 수: 2 (최근 30일)
I am trying to solve a non linear equation as given below.
I am expecting β2 to be between 35 and 50 degrees. All angles are in degrees.
I tried using and using functions. But the reults were not in that range . How to solve this issure.
Thanks in advance.

채택된 답변

Abolfazl Chaman Motlagh
Abolfazl Chaman Motlagh 2021년 9월 6일
maybe you forgot to use "d" in trigonometric functions.
quick answer without optimizing the code:
m = 0.7:0.01:1 ;
b1 = 34.65 ;
theta = 16;
syms b;
f =@(b,m) m - (1-(tand(b-b1).*sind(theta))./(sind(b1).*sind(b-theta))).^2;
for i=1:numel(m)
B(i) = vpasolve(f(b,m(i)) == 0, b);
end
min(B)
ans = 
34.65
max(B)
ans = 
43.489918649470219406073636845804
plot(B)
  댓글 수: 2
Abolfazl Chaman Motlagh
Abolfazl Chaman Motlagh 2021년 9월 6일
or use fsolve with initial guess:
m = 0.7:0.01:1 ;
b1 = 34.65;
theta = 16;
f =@(b) m - (1-(tand(b-b1).*sind(theta))./(sind(b1).*sind(b-theta))).^2;
B = fsolve(f , 40*ones(1,31));
Equation solved. fsolve completed because the vector of function values is near zero as measured by the value of the function tolerance, and the problem appears regular as measured by the gradient.
min(B)
ans = 34.6500
max(B)
ans = 43.4899
plot(B)
Jintu K James
Jintu K James 2021년 9월 7일
Thank you very much for the help. It worked.
I used 'd' in trignometric functions, but i forgot to put 'm' in the f =@(b,m) command while using vpasolve.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Systems of Nonlinear Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by