<pre style="font-family: Monospaced; font-style: normal; "><span style="color: rgb(1, 168, 1); font-style: italic; "><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; white-space: normal; ">Dear Samuel,</span><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; white-space: normal; "><br></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; white-space: normal; ">thanks for your quick answer. The following lines solve the heat equation and provides </div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; white-space: normal; "> a smooth evolution of the solution in the plot. SCILAB 5.3.3 likes but SCILAB 5.4.0 does not like it.</div></span><span style="color: rgb(1, 168, 1); font-style: italic; "><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; white-space: normal; "><br></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; white-space: normal; ">thanks,</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; white-space: normal; "><br></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; white-space: normal; ">eliseo  (hope this time gets to the list right)</div></span></pre><pre style="font-family: Monospaced; font-style: normal; "><span class="Apple-style-span" style="font-size: 12px;"><span style="font-style: italic; ">///</span>
<span style="font-style: italic; ">// heat equation</span>
<span style="font-style: italic; ">//</span>
clear;
<span style="font-style: italic; ">//</span>
<span style="font-style: italic; ">// Initial value</span>
<span style="font-style: italic; ">//</span>
function z=<span style="text-decoration: underline; ">u0</span>(xx)
if (abs(xx)<=1) then
    z=1;
else
    z=0;
end
endfunction
<span style="font-style: italic; ">//</span>
<span style="font-style: italic; ">//  b heat coef.</span>
<span style="font-style: italic; ">//</span>
b=1;

f0=<span style="text-decoration: underline; ">scf</span>(0);
f0.pixmap='on';
<span style="text-decoration: underline; ">clf</span>(f0);
show_window();
<span style="font-style: italic; ">//</span>
<span style="font-style: italic; ">//  space interval</span>
<span style="font-style: italic; ">//</span>
xmin=-5;
xmax=5;
Nx=125;   <span style="font-style: italic; ">// Number of points</span>
h=(xmax-xmin)/Nx;
x=xmin:h:xmax; 
<span style="font-style: italic; ">//</span>
u=zeros(1,Nx+1);    
uold=zeros(1,Nx+1);
u2=zeros(1,Nx+1);    <span style="font-style: italic; ">// dimensionamos inicialmente a cero</span>
uold2=zeros(1,Nx+1);
ucero=zeros(1,Nx+1);
<span style="font-style: italic; ">//</span>
<span style="font-style: italic; ">// time</span>
<span style="font-style: italic; ">//</span>
t0=0;
time=t0;

for i=1:Nx+1
   uold(i)=<span style="text-decoration: underline; ">u0</span>(x(i));    <span style="font-style: italic; ">// initial value</span>
   uold2(i)=<span style="text-decoration: underline; ">u0</span>(x(i));
   ucero(i)=<span style="text-decoration: underline; ">u0</span>(x(i)); 
end
<span style="text-decoration: underline; ">plot</span>(x,uold,'dr')
ejes=<span style="text-decoration: underline; ">gca</span>();  </span></pre><pre style="font-family: Monospaced; font-style: normal; "><span class="Apple-style-span" style="font-size: 12px;">ejes.data_bounds=[xmin, 0; xmax,1.2];</span></pre><pre style="font-family: Monospaced; "><span class="Apple-style-span" style="font-size: 12px;"><span style="font-style: normal; text-decoration: underline; ">title</span><span style="font-style: normal; ">(</span><span class="Apple-style-span" style="font-style: normal; ">" Initial data ");<br></span><span style="font-style: normal; ">show_pixmap</span><span style="font-style: normal; ">(</span><span style="font-style: normal; ">)</span><span style="font-style: normal; ">;</span>
<span style="font-style: normal; ">sleep</span><span style="font-style: normal; ">(10</span><span style="font-style: normal; ">00</span><span style="font-style: normal; ">)</span><span style="font-style: normal; ">;</span>

<span style="font-style: normal; ">k</span><span style="font-style: normal; ">=</span><span style="font-style: normal; ">0.9</span><span style="font-style: normal; ">*</span><span style="font-style: normal; ">h</span><span style="font-style: normal; ">^</span><span style="font-style: normal; ">2</span><span style="font-style: normal; ">/</span><span style="font-style: normal; ">(</span><span style="font-style: normal; ">2</span><span style="font-style: normal; ">*</span><span style="font-style: normal; ">b</span><span style="font-style: normal; ">)</span><span style="font-style: normal; ">;// stability</span>

<span style="font-style: italic; ">//</span>
<span style="font-style: italic; ">// coeficiente mu=k/h^2</span>
<span style="font-style: italic; ">//</span>

<span style="font-style: normal; ">mu</span><span style="font-style: normal; ">=</span><span style="font-style: normal; ">k</span><span style="font-style: normal; ">/</span><span style="font-style: normal; ">h</span><span style="font-style: normal; ">^</span><span style="font-style: normal; ">2</span><span style="font-style: normal; ">;</span>

<span style="font-style: italic; ">//  </span>
<span style="font-style: normal; ">coef1</span><span style="font-style: normal; ">=</span><span style="font-style: normal; ">b</span><span style="font-style: normal; ">*</span><span style="font-style: normal; ">mu</span><span style="font-style: normal; ">;</span>
<span style="font-style: normal; ">coef2</span><span style="font-style: normal; ">=</span><span style="font-style: normal; ">1</span><span style="font-style: normal; ">-</span><span style="font-style: normal; ">2</span><span style="font-style: normal; ">*</span><span style="font-style: normal; ">b</span><span style="font-style: normal; ">*</span><span style="font-style: normal; ">mu</span><span style="font-style: normal; ">;</span>
<span style="font-style: normal; ">coef3</span><span style="font-style: normal; ">=</span><span style="font-style: normal; ">b</span><span style="font-style: normal; ">*</span><span style="font-style: normal; ">mu</span><span style="font-style: normal; ">;</span>

<span style="font-style: italic; ">//</span>
   <span style="font-style: normal; ">while</span> <span style="font-style: normal; ">(</span><span style="font-style: normal; ">time</span><span style="font-style: normal; "><</span><span style="font-style: normal; ">0.5</span><span style="font-style: normal; ">)</span>
    <span style="font-style: normal; ">time</span><span style="font-style: normal; ">=</span><span style="font-style: normal; ">time</span><span style="font-style: normal; ">+</span><span style="font-style: normal; ">k</span><span style="font-style: normal; ">;</span>
     <span style="font-style: normal; ">u</span><span style="font-style: normal; ">(</span><span style="font-style: normal; ">1</span><span style="font-style: normal; ">)</span><span style="font-style: normal; ">=</span><span style="font-style: normal; ">0</span><span style="font-style: normal; ">;</span>
     <span style="font-style: normal; ">u</span><span style="font-style: normal; ">(</span><span style="font-style: normal; ">Nx</span><span style="font-style: normal; ">+</span><span style="font-style: normal; ">1</span><span style="font-style: normal; ">)</span><span style="font-style: normal; ">=</span><span style="font-style: normal; ">0</span><span style="font-style: normal; ">;</span>
    <span style="font-style: normal; ">for</span> <span style="font-style: normal; ">i</span><span style="font-style: normal; ">=</span><span style="font-style: normal; ">2</span><span style="font-style: normal; ">:</span><span style="font-style: normal; ">Nx</span>
     <span style="font-style: normal; ">u</span><span style="font-style: normal; ">(</span><span style="font-style: normal; ">i</span><span style="font-style: normal; ">)</span><span style="font-style: normal; ">=</span><span style="font-style: normal; ">coef1</span><span style="font-style: normal; ">*</span><span style="font-style: normal; ">uold</span><span style="font-style: normal; ">(</span><span style="font-style: normal; ">i</span><span style="font-style: normal; ">+</span><span style="font-style: normal; ">1</span><span style="font-style: normal; ">)</span><span style="font-style: normal; ">+</span><span style="font-style: normal; ">coef2</span><span style="font-style: normal; ">*</span><span style="font-style: normal; ">uold</span><span style="font-style: normal; ">(</span><span style="font-style: normal; ">i</span><span style="font-style: normal; ">)</span><span style="font-style: normal; ">+</span><span style="font-style: normal; ">coef3</span><span style="font-style: normal; ">*</span><span style="font-style: normal; ">uold</span><span style="font-style: normal; ">(</span><span style="font-style: normal; ">i</span><span style="font-style: normal; ">-</span><span style="font-style: normal; ">1</span><span style="font-style: normal; ">)</span><span style="font-style: normal; ">;</span> 
    <span style="font-style: normal; ">end</span>  
    <span style="font-style: normal; text-decoration: underline; ">clf</span><span style="font-style: normal; ">(</span><span style="font-style: normal; ">f0</span><span style="font-style: normal; ">)</span><span style="font-style: normal; ">;</span>
   <span style="font-style: normal; text-decoration: underline; ">plot</span><span style="font-style: normal; ">(</span><span style="font-style: normal; ">x</span><span style="font-style: normal; ">,</span><span style="font-style: normal; ">u</span><span style="font-style: normal; ">,</span><span style="font-style: normal; ">'</span><span style="font-style: normal; ">or</span><span style="font-style: normal; ">'</span><span style="font-style: normal; ">,</span><span style="font-style: normal; ">x</span><span style="font-style: normal; ">,</span><span style="font-style: normal; ">ucero</span><span style="font-style: normal; ">,</span><span style="font-style: normal; ">'</span><span style="font-style: normal; ">db</span><span style="font-style: normal; ">'</span><span style="font-style: normal; ">)</span><span style="font-style: normal; ">;</span>
   <span style="font-style: normal; ">ejes</span><span style="font-style: normal; ">=</span><span style="font-style: normal; text-decoration: underline; ">gca</span><span style="font-style: normal; ">(</span><span style="font-style: normal; ">)</span><span style="font-style: normal; ">;</span>
   <span style="font-style: normal; ">ejes</span><span style="font-style: normal; ">.</span><span style="font-style: normal; ">data_bounds</span><span style="font-style: normal; ">=</span><span style="font-style: normal; ">[</span><span style="font-style: normal; ">xmin</span><span style="font-style: normal; ">,</span> <span style="font-style: normal; ">0</span><span style="font-style: normal; ">;</span> <span style="font-style: normal; ">xmax</span><span style="font-style: normal; ">,</span><span style="font-style: normal; ">1.2</span><span style="font-style: normal; ">]</span><span style="font-style: normal; ">;</span>  
   <span style="font-style: normal; text-decoration: underline; ">title</span><span style="font-style: normal; ">(</span><span style="font-style: normal; ">"</span><span style="font-style: normal; ">Euler explicit: time=  </span><span style="font-style: normal; ">"</span><span style="font-style: normal; ">+</span><span style="font-style: normal; ">string</span><span style="font-style: normal; ">(</span><span style="font-style: normal; ">time</span><span style="font-style: normal; ">)</span><span style="font-style: normal; ">..</span>
     <span style="font-style: normal; ">+</span><span style="font-style: normal; ">"</span><span style="font-style: normal; ">; time step =  </span><span style="font-style: normal; ">"</span><span style="font-style: normal; ">+</span><span style="font-style: normal; ">string</span><span style="font-style: normal; ">(</span><span style="font-style: normal; ">k</span><span style="font-style: normal; ">)</span><span style="font-style: normal; ">+</span><span style="font-style: normal; ">..</span>
     <span style="font-style: normal; ">+</span><span style="font-style: normal; ">"</span><span style="font-style: normal; ">; spatial h=</span><span style="font-style: normal; ">"</span><span style="font-style: normal; ">+</span><span style="font-style: normal; ">string</span><span style="font-style: normal; ">(</span><span style="font-style: normal; ">h</span><span style="font-style: normal; ">)</span><span style="font-style: normal; ">+</span><span style="font-style: normal; ">"</span><span style="font-style: normal; ">; diffusion = </span><span style="font-style: normal; ">"</span><span style="font-style: normal; ">+</span><span style="font-style: normal; ">string</span><span style="font-style: normal; ">(</span><span style="font-style: normal; ">b</span><span style="font-style: normal; ">)</span><span style="font-style: normal; ">)</span><span style="font-style: normal; ">;</span>
    <span style="font-style: normal; text-decoration: underline; ">legend</span><span style="font-style: normal; ">(</span><span style="font-style: normal; ">'</span><span style="font-style: normal; ">b=1</span><span style="font-style: normal; ">'</span><span style="font-style: normal; ">,</span><span style="font-style: normal; ">'</span><span style="font-style: normal; ">initial</span><span style="font-style: normal; ">'</span><span style="font-style: normal; ">)</span><span style="font-style: normal; ">;</span>
    <span style="font-style: normal; ">show_pixmap</span><span style="font-style: normal; ">(</span><span style="font-style: normal; ">)</span><span style="font-style: normal; ">;</span>
    <span style="font-style: normal; ">uold</span><span style="font-style: normal; ">=</span><span style="font-style: normal; ">u</span><span style="font-style: normal; ">;</span>
    <span style="font-style: normal; ">sleep</span><span style="font-style: normal; ">(</span><span style="font-style: normal; ">1</span><span style="font-style: normal; ">)</span><span style="font-style: normal; ">;</span>
<span style="font-style: normal; ">end</span>
</span></pre><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: 12px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "></div></span></div></span></div></span></div></span></div></div></div></span></div></div><div><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "> </span></div></div></span></div></span></div></span></div></span></div></div></div></span></div></span></span></div>

        
        
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://mailinglists.scilab.org/Use-of-show-pixmap-obsolete-Alternative-tp4025179p4025186.html">Re: Use of show_pixmap() obsolete. Alternative??</a><br/>
Sent from the <a href="http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html">Scilab users - Mailing Lists Archives mailing list archive</a> at Nabble.com.<br/>