Solving symbolic trig equation in terms of theta, using "sol."

조회 수: 6 (최근 30일)
Tony Yu
Tony Yu 2020년 8월 8일
답변: madhan ravi 2020년 8월 8일
What does "sol.th1" means ? why there are two sets of th1?
syms th1 th2 px py
eq1 = px == cos(th1+th2)+cos(th1)
eq2 = py == sin(th1+th2)+sin(th1)
sol = solve(eq1,eq2,th1,th2)
th1 = simplify(sol.th1)
th2 = simplify(sol.th2)
th1 =
2*atan((2*py + (- px^4 - 2*px^2*py^2 + 4*px^2 - py^4 + 4*py^2)^(1/2))/(px^2 + 2*px + py^2))
2*atan((2*py - (- px^4 - 2*px^2*py^2 + 4*px^2 - py^4 + 4*py^2)^(1/2))/(px^2 + 2*px + py^2))
th2 =
-2*atan((-(px^2 + py^2)*(px^2 + py^2 - 4))^(1/2)/(px^2 + py^2))
2*atan((-(px^2 + py^2)*(px^2 + py^2 - 4))^(1/2)/(px^2 + py^2))

채택된 답변

madhan ravi
madhan ravi 2020년 8월 8일
The solution is returned in a struct so to access it you need to use the dot. It has occurred that there are two solutions?

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by