If one does

sage: Ii.subs(pars).variables()
(x,)

so that is fine. However,

sage: RR(Ii.subs(pars)(x=-10))
Traceback (most recent call last):
...
TypeError

which tells you what the error is (not very helpful in this case). On  
a hunch

sage: CC(Ii.subs(pars)(x=-10))
2.59329101030962e-14*I

so the problem here is that there is some numerical noise and you're  
taking the square root of a tiny, negative number (which should  
probably be 0?).

- Robert


On Nov 12, 2008, at 12:06 PM, kex wrote:

>
> Thank you very much Stan, this was helpfull
>
> I have more questions,
> I get this message:
>
> verbose 0 (3605: plot.py, _plot) WARNING: When plotting, failed to
> evaluate function at 200 points.
> verbose 0 (3605: plot.py, _plot) Last error message: ''
>
> Why does it fail to evaluate ?
>
> my datasheet:
>
> #Definiram vrednosti parametrov
> var('mi r_sonde h_sonde A T e0 V_P T_e k_b m_e n_se')
> pars=dict(mi=1.67e-27,r_sonde=75e-6,h_sonde=1e-2,A=6e5,T=34782,
> e0=1.6e-19,V_P=3,T_e=34782,k_b=1.38e-22,m_e=9.1e-31,n_se=1e16)
>
> # Temperaturno omejeno obmocje
> #var('A T e0 k_b')
> #pars0=dict(A=6e5,T=34782,e0=1.6e-19,k_b=1.38e-23)
> jemt= ( A*T^2*exp(-e0*x/(k_b *T)))
> show(jemt)
> plot(jemt.subs(pars),-90,0)
>
> # Obmocje omejeno s prostorskim nabojem
>
> # PHI je normalizirana napetost
> phi=e0*(x - V_P)/T_e #Te je bil pomno%u017Een z kb
> # F vstavim v beta
> F=exp(phi)-1
> # beta vstavim v G
> beta_0= -4*phi^2 - 2*phi*(F^2 -2*F)
> beta_1= 4*(-2*F-1)*phi^2 + 8*F*phi-F^2
> beta_2= 4*phi^2 - 8*phi^3
> # enacba za G
> G=(-beta_1+sqrt(beta_1^2 - 4*beta_0*beta_2))*(2*beta_2)^-1
> # Definiram Ce
> Ce=sqrt(8*T_e*(pi*m_e)^-1)
> # Koncno definiram emisijski tok za obmocje prostorskega naboja
> jems=0.5*G*(1+G)^-1 * e0*n_se*Ce*sqrt(-pi*phi)
> show(jems)
> plot(jems.subs(pars),-100,0)
>
> #--------------------------ERROR IS PRODUCED BY THE CODE THAT FOLLOWS
> Cs=sqrt(T_e/mi)
> S=pi*r_sonde^2*h_sonde
> # V temperaturnem obmo%u010Dju Vb<Vs je g izra%u017Een tako
> g=jemt * (e0*n_se*Ce*sqrt(-0.25*pi*phi)-jemt)^-1
> M=sqrt((1+g)*(1+g/(2*phi))^-1)
> Ii=e0*n_se*M*Cs*S   # ko smo v obmocju kjer velja Vb<Vp    Ii=0 ko smo
> v Vb>Vp
> show(Ii)
> plot(Ii.subs(pars),-100,0)
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to