how can I solve this problem..

조회 수: 1 (최근 30일)
youn chan choi
youn chan choi 2021년 4월 20일
편집: youn chan choi 2021년 4월 21일
syms theta0
th = -y+cos(theta0)*x^2-g*x^2/(2*v0^2*sin(theta0)^2) == 0;
theta0 = [0 pi];
stheta0 = fzero(th,theta0);
I want to get two roots for theta0 but when I erased 'theta0 = [0 pi]' , it was too complicated.

답변 (1개)

John D'Errico
John D'Errico 2021년 4월 20일
편집: John D'Errico 2021년 4월 20일
Um, what do you expect?
syms theta0
x=90; g=9.81; v0=30; y0=1.8; y=1;
th = -y+tan(theta0)*x-g*x^2/(2*v0^2*cos(theta0)^2)+y0;
pretty(th)
8829 4 90 tan(theta0) - ---------------- + - 2 5 200 cos(theta0)
Do you expect an analytical solution, something nice and simple and very pretty?
thsol = solve(th)
thsol = 
You should be able to effectively reduce this to effectively a 4th degree polynomial in terms of sin(theta0), so 4 roots.
vpa(thsol)
ans = 
There are probably infinitely many solutions since trig functions are periodic. I don't see how much better than that you can rationally expect? Honestly, I'd say you are pretty lucky, in that solutions are easily generated\. Just pick the one that makes sense to you.

카테고리

Help CenterFile Exchange에서 Number Theory에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by