2016-12-28 91 views
1

解方程,我可以解方程波紋管通常與最大值

sin(b1*(x-c1)) = sin(b2*(x-c2)) 
b1*(x-c1)  = b2*(x-c2) 
c2    = x-(b1*(x-c1))/b2 

for c1 = 0, b1 = 1, b2 = 1.5, x = pi/2 

c2 = (x-(b1*(x-c1))/b2) = 0.523598775598299 

但是當我嘗試這樣做是千里馬看到下面的答案是完全不同的我在做什麼錯誤?

kill(all)$ 
numer:true$ 
phase1:0; freq1:1; freq2:1.5; x:pi/2; solve(sin(freq1*(x-phase1))=sin(freq2*(x-phase2)),phase2); 

答案我得到以下 Answer I get

回答

2

solve通常只適用於簡單的公式,嘗試Solver

另外,pi(變量)是不一樣的%pi(常數)。

kill(all)$ 
load(solver)$ 
numer:true; 
f:sin(freq2*(x-phase2))=sin(freq1*(x-phase1)); 
phase1:0; freq1:1; freq2:1.5; x:%pi/2; a:Solver([f],[phase2]); 
rhs(a[1][1]),numer; 

答:0.5235987755982978

你的第二個問題:

kill(all); 
f:sin(b1*(x-c1)) - sin(b2*(x-c2))=0; 
triginverses:all; 
solve(f,c2); 
+0

感謝有沒有辦法讓最大值,顯示它曾經得到答案的方程式。 'C2 =(X-(B1 *(X-C1))/ B2)' –

+0

見編輯答案。 – 2016-12-28 16:01:11