pantole

29 Reputation

7 Badges

16 years, 154 days

MaplePrimes Activity


These are replies submitted by pantole

Can you upload the Maple file?
J. Tarr is right when he points that it should work with variable omega without problem. I checked it out, but another paradox emerged: although, fsolve gave results with both omega and alternative variable, when used with omega the calculations delayed a little. Again with time function: < restart: st:=time(): Digits:=10: eq[1]:=add((-1)^(i+1)*cos(omega*t[i]),i=1..5): eq[2]:=add((-1)^(i+1)*sin(omega*t[i]),i=1..5): eq[3]:=add((-1)^(i+1)*cos(r*omega*t[i]),i=1..5): eq[4]:=add((-1)^(i+1)*sin(r*omega*t[i]),i=1..5): eq[5]:=t[1]: eq[6]:=t[4]-2*t[3]+t[2]: eq[7]:=t[5]-2*t[3]: s1:=fsolve({seq(eq[i],i=1..7)},{seq(t[i],i=1..5),r,omega}): Solutions:=subs(s1,[seq(t[i],i=1..5), r, omega]): t:=[seq(op(i,Solutions),i=1..5)]; r:=op(6,Solutions); omega:=op(7,Solutions); seq(eq[i],i=1..7); time()-st; > If omega is substituted for om for instance, calculations do not delay (maybe this happens at random). Still, since Maple output generates the greek omega (something like a w) for omega variable, then I guess that one should be sceptical for using this variable. But, maybe he shouldn't. pantole
First of all I think you should change omega variable to sth. else, e.g. om, since Maple translates omega as a built-in function [except, of course, you need to use omega]. You may change the code writing: restart: eq[1]:=add((-1)^(i+1)*cos(om*t[i]),i=1..5): eq[2]:=add((-1)^(i+1)*sin(om*t[i]),i=1..5): eq[3]:=add((-1)^(i+1)*cos(r*om*t[i]),i=1..5): eq[4]:=add((-1)^(i+1)*sin(r*om*t[i]),i=1..5): eq[5]:=t[1]: eq[6]:=t[4]-2*t[3]+t[2]: eq[7]:=t[5]-2*t[3]: s1:=fsolve({seq(eq[i],i=1..7)},{seq(t[i],i=1..5),r,om}); Solutions:=subs(s1,[seq(t[i],i=1..5), r, om]): t:=[seq(op(i,Solutions),i=1..5)]; r:=op(6,Solutions); om:=op(7,Solutions);
You can check results by writing: seq(eq[i],i=1..7); pantole
1 2 Page 2 of 2