[scilab-Users] Re: ploting planck's function

Alexandre Abbes alexandre.abbes at ac-toulouse.fr
Sun Nov 27 17:21:11 CET 2011


Le 27/11/2011 15:01, philippe a écrit :

> function y=f(l)
>     T=1000,c=3e8,k=1.3e-23,h=6.3e-34
> y=(2*h*c^2/l^5)* 1/(exp(h*c/(k*t*l))-1)
> endfunction

> l=[1:0.01:10]// becareful to l=0 !!!
> y=feval(l,f)
>
> then you can plot the curve and had grids or ...
>
> plot(l,y,'-r')
> xgrid(3)

OK thank you very much, it works well, the curve is OK.

Yet, I cannot anderstand why
  plot(l,f(l)),
which is the comamnd I used before, still gives me a false result.


best regards

Alexandre



>
>
>
>>
>> l is the wavelength.
>> T=1000 (temperature).
>>
>> and c=3e8, k=1.3e-23, h=6.3e-34.
>
>
> remind that scilab use a floating point representation of reals numbers
> with 1e-16 relative precision so that  : k=1.3e-23=h=6.3e-34=0 compared
> to c=3e8 !!!
>
>>
>> The curve I get is increasing, and looks like a parabola, wich is false,
>> obviously. I get a better result with maxima, by the way.
>
> since maxima use  symbolic calculus it can perform arbitrary precision
> calculus.
>>
>> Does anybody know how to increase the precision?
>
> use a unit system where k=c=h=1 (and rescale results after calculations
> ....).
>
> Philippe.
>
>




More information about the users mailing list