MATLAB Answers

Solving symbolic trig equation

5 ビュー (過去 30 日間)
Tony Yu
Tony Yu 2020 年 7 月 7 日
編集済み: John D'Errico 2020 年 7 月 7 日
Trying to see how I can solve this equations:
clc
clear all
syms x y z
eq1= -sin(x+y)+cos(x+y-1.6)== 0
eq2= cos(x+y)+cos(x+y-3.2)== 0
solve(eq1,eq2,x,y)

  0 件のコメント

Sign in to comment.

採用された回答

John D'Errico
John D'Errico 2020 年 7 月 7 日
編集済み: John D'Errico 2020 年 7 月 7 日
You can NEVER solve for those variables, at least as the equations are written.
First of all, z never even appears. But since you never try to solve for it, who cares?
But look at x + y. They always appear tegether, in EXACTLY the same way. In fact, we can transform the problem in a very simple way, by replacing (x+y) with z.
Now your problem reduces to:
syms z
eq1 = -sin(z)+cos(z-1.6)== 0
eq2 = cos(z)+cos(z-3.2)== 0
There is no more and no less information content in the problem. Surely you can agree, since x+y ALWAYS appear in exactly the same place, and always together.
solve(eq1,z)
ans =
pi/4 + 4/5
solve(eq2,z)
ans =
-log(-exp(8i/5)*1i)*1i
-log(exp(8i/5)*1i)*1i
vpa(ans)
ans =
0.029203673205103380768678308360249
-3.1123889803846898576939650749193
Solving eq1 for z, we find a simple solution. Solving eq2 for z, however, we get a completely different value for z. It is not really imaginary when we resolve it into a simpler numeric form. But see that it is not the first value we got for z.
So nothing in the universe will ever allow a solution to both equations for z, and therefore solving for x and y is just as impossible. It is very easy to write equations that have no solution. Surprise! You just did it.

  0 件のコメント

Sign in to comment.

その他の回答 (0 件)

タグ


Translated by