Trigonometri Problems at atand and acosd

Hi.. can you help me pls.. I have a problem :
54.8=acosd(20/(100-z))-atand(40/(500-z))
how to evaluate z at matlab? thanks..

 채택된 답변

Matt Fig
Matt Fig 2012년 10월 18일
편집: Matt Fig 2012년 10월 18일

0 개 추천

This is perfect for the FZERO function....
fzero(@(z) 54.8-acosd(20./(100-z))+atand(40./(500-z)),30)

댓글 수: 4

fzero(@(z) 54.8-acosd(20./(100-z))+atand(40./(500-z)),30)
can you tell me where i can get value of 30? thanks
30 is not a solution to your equation. I used 30 as an initial guess for FZERO. Have a look at the help for this function:
doc fzero
Walter Roberson
Walter Roberson 2012년 10월 18일
Caution: the above will only find a single solution at most, but there are two solutions (I say "at most" because there are two singularities and you need to watch out for the possibility that your guess is on the far side of a singularity from a solution.)
Yes, Walter is correct. To see good initial guesses (and also a bad initial guess) for the solutions, look where the black line crosses the blue line:
x = 0:.01:500;
f = @(z) 54.8-acosd(20./(100-z))+atand(40./(500-z));
plot(x,f(x))
line([0 500],[0 0],'color','k')

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

추가 답변 (1개)

Walter Roberson
Walter Roberson 2012년 10월 18일

0 개 추천

You can use the symbolic toolbox if you have it.
Otherwise, rewrite the expression by subtracting the left-hand side from both sides, and then using a zero finder.
Note: there is more than one solution.

카테고리

도움말 센터File Exchange에서 Optimization에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by