Problem with complex number (SMath v0.89)

Problem with complex number (SMath v0.89) - Mensajes

#1 Publicado: 2/3/2011 13:13:24
pajik

pajik

0 me gusta en 1 mensajes.

Grupo: User

I have problem with comlex calculate...

l←(1+795.7747*i)*(1+795.7747*i)
l=-6.3326*10^5+1591.5494*i

BUT

el(a,1,2)=1+795.7747*i
el(a,2,1)=1+795.7747*i
m←el(a,1,2)*el(a,2,1)
m=6.3326*10^5-1591.5494*i

full program:
http://matros.comehere.cz/tmp/problem.zip
download


printscreen:
http://img828.imageshack.us/i/38752541.png/
#2 Publicado: 2/3/2011 17:50:35
Radovan Omorjan

Radovan Omorjan

325 me gusta y 1 no me gusta en 2.052 mensajes.

Grupo: Moderator

Hello,

You can see the symbolic representation of your matrix elements:
[MATH=eng]el(a,1,2)—{2500+i*π}/{i*π}[/MATH][MATH=eng]el(a,1,2)—{2500+i*π}/{i*π}[/MATH]
They are the same. Now, get their product and see the symbolical result:
[MATH=eng]m←el(a,1,2)*el(a,2,1)[/MATH]
[MATH=eng]m—{(2500+i*π)^2}/{π^2}[/MATH]
and the numerical value would be:
[MATH=eng]m=6.3326*10^5+1591.5494*i[/MATH]
Change the Optimization of calculating "m" Into Optimization|None or Optimization|Numeric and see the numerical value. The numerical result will be:
[MATH=eng]m=-6.3326*10^5-1591.5494*i[/MATH]

I do not get it? Could anyone explain this?

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#3 Publicado: 5/3/2011 14:18:35
Edward Ulle

Edward Ulle

21 me gusta en 182 mensajes.

Grupo: Moderator

Pecular, I tried to duplicate the equations in the original post and no matter what I do I get the same and correct results. I'm using SMath 0.89 Win7.



However, when I duplicate the equations from the attached zip file I do get incorrect results but I noted that the (i*pi)^2 in the denominator does not calculate correctly. The result is 1/pi^2. It should be -1/pi^2. Something happened to the i^2 in the denominator.

When I change optimization to Numeric in the last set of equations, then I get the correct result.



Just by looking at the results without optimization changed, you'ld have a hard time finding this discrepency.
Ed
  • Nuevos mensajes
  • Sin mensajes nuevos