[Scilab-users] Use of show_pixmap() obsolete. Alternative??

Eliseo Chacon Vera eliseo at um.es
Fri Nov 9 13:32:42 CET 2012


Thanks,

but your modiffication  does NOT work for me with Mac OSX 10.6.8, 64 bits

Eliseo

El 09/11/2012, a las 00:25, Samuel GOUGEON [via Scilab / Xcos - Mailing Lists Archives] escribió:

> Here it is, working for me with Scilab 5.4.0 / window 7 64 bits:
> -------------------
> // Initial value
> function z=u0(xx)
>     if (abs(xx)<=1) then
>         z=1;
>     else
>         z=0;
>     end
> endfunction
> 
> //  b heat coef.
> b=1;
> 
> f0=scf(0);
> //f0.pixmap='on;       // CANCELLED
> clf(f0);
> //show_window();    // CANCELLED
> 
> //
> //  space interval
> //
> xmin=-5;
> xmax=5;
> Nx=125;   // Number of points
> h=(xmax-xmin)/Nx;
> x=xmin:h:xmax; 
> //
> u=zeros(1,Nx+1);    
> uold=zeros(1,Nx+1);
> u2=zeros(1,Nx+1);    // dimensionamos inicialmente a cero
> uold2=zeros(1,Nx+1);
> ucero=zeros(1,Nx+1);
> //
> // time
> //
> t0=0;
> time=t0;
> 
> for i=1:Nx+1
>     uold(i)=u0(x(i));    // initial value
>     uold2(i)=u0(x(i));
>     ucero(i)=u0(x(i)); 
> end
> plot(x,uold,'dr')
> ejes=gca();  
> 
> ejes.data_bounds=[xmin, 0; xmax,1.2];
> 
> title(" Initial data ");
> //show_pixmap();      // CANCELLED
> 
> sleep(1000);
> 
> k=0.9*h^2/(2*b);// stability
> 
> // coeficiente mu=k/h^2
> 
> mu=k/h^2;
> 
> //  
> coef1=b*mu;
> coef2=1-2*b*mu;
> coef3=b*mu;
> 
> //
> while (time<0.5)
>     drawlater()         // <<<<<<
>     time=time+k;
>     u(1)=0;
>     u(Nx+1)=0;
>     for i=2:Nx
>         u(i)=coef1*uold(i+1)+coef2*uold(i)+coef3*
>  
> uold(i-1); 
>     end  
>     clf(f0);
>     plot(x,u,'or',x,ucero,'db');
>     ejes=gca();
>     ejes.data_bounds=[xmin, 0; xmax,1.2];  
>     title("Euler explicit: time=  "+string(time)..
>     +"; time step =  "+string(k)+..
>     +"; spatial h="+string(h)+"; diffusion = "+string(b));
>     legend('b=1','initial');
>     //show_pixmap();      // CANCELLED
>     uold=u;
>     drawnow()        // <<<<<<
>     sleep(30);        // <<<<<<
> end
> 
> 
> _______________________________________________ 
> users mailing list 
> [hidden email] 
> http://lists.scilab.org/mailman/listinfo/users
> 
> 
> If you reply to this email, your message will be added to the discussion below:
> http://mailinglists.scilab.org/Use-of-show-pixmap-obsolete-Alternative-tp4025179p4025188.html
> To start a new topic under Scilab users - Mailing Lists Archives, email ml-node+s994242n2602246h85 at n3.nabble.com 
> To unsubscribe from Use of show_pixmap() obsolete. Alternative??, click here.
> NAML





--
View this message in context: http://mailinglists.scilab.org/Use-of-show-pixmap-obsolete-Alternative-tp4025179p4025192.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20121109/19d7cf7e/attachment.htm>


More information about the users mailing list