<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div>Hi Scilab users,</div><div> </div><div>I could plot the following functions (i.e., absolute value and logarithmic function <strong>modules</strong> and <strong>phase</strong> function) in just one window.</div><div> </div><div>However, as you can run and see, the subtitles are mixing ... that's my problem !</div><div> </div><div>Well, in case it is possible to separate those subtitles to be visible, how could I do it ?</div><div> </div><div>In case it is not possible to separate them, how could I plot on different graph windows ?</div><div> </div><div>The Scilab script is shown, as follows. This script is based on the Bode's Diagram in Scilab demonstration example.</div><div> </div><pre style="font-family: Monospaced; font-style: normal;"><span style="color: rgb(50, 185,
185);">stacksize</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(188, 143, 143);">15000000</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">;</span>
<span style="color: rgb(1, 168, 1); font-style: italic;">// Define "s" as variable </span>
<span style="color: rgb(1, 168, 1); font-style: italic;">// (s é um polinômio de raiz zero)</span>
<span style="color: rgb(0, 0, 0);">s</span> <span style="color: rgb(92, 92, 92);">=</span> <span style="color: rgb(50, 185, 185);">poly</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(188, 143, 143);">0</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(188, 143, 143);">'</span><span style="color: rgb(188, 143, 143);">s</span><span style="color: rgb(188, 143, 143);">'</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">;</span>
<span style="color: rgb(1, 168, 1); font-style: italic;">// Define the transfer function:</span></pre><pre style="font-family: Monospaced; font-style: normal;"><span style="color: rgb(1, 168, 1); font-style: italic;"></span><span style="color: rgb(0, 0, 0);">H</span> <span style="color: rgb(92, 92, 92);">=</span> <span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(0, 0, 0);">s</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(92, 92, 92);">/</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(0, 0, 0);">s</span><span style="color: rgb(92, 92, 92);">+</span><span style="color: rgb(188, 143, 143);">1</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">;</span>
<span style="color: rgb(1, 168, 1); font-style: italic;">// Define the frequency range (Hz)</span>
<span style="color: rgb(0, 0, 0);">f</span> <span style="color: rgb(92, 92, 92);">=</span> <span style="color: rgb(188, 143, 143);">0.001</span><span style="color: rgb(255, 170, 0);">:</span><span style="color: rgb(188, 143, 143);">0.001</span><span style="color: rgb(255, 170, 0);">:</span><span style="color: rgb(188, 143, 143);">100</span><span style="color: rgb(0, 0, 0);">;</span>
<span style="color: rgb(1, 168, 1); font-style: italic;">// Calculate the frequency-response:</span></pre><pre style="font-family: Monospaced; font-style: normal;"><span style="color: rgb(1, 168, 1); font-style: italic;"></span><span style="color: rgb(0, 0, 0);">y</span> <span style="color: rgb(92, 92, 92);">=</span> <span style="color: rgb(50, 185, 185);">freq</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(0, 0, 0);">H</span><span style="color: rgb(92, 92, 92);">.</span><span style="color: rgb(170, 170, 170);">num</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">H</span><span style="color: rgb(92, 92, 92);">.</span><span style="color: rgb(170, 170, 170);">den</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(188, 143, 143);">2</span><span style="color: rgb(92, 92, 92);">*</span><span style="color: rgb(218, 112, 214);">%pi</span><span style="color: rgb(92, 92,
92);">*</span><span style="color: rgb(218, 112, 214);">%i</span><span style="color: rgb(92, 92, 92);">*</span><span style="color: rgb(0, 0, 0);">f</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">;</span>
<span style="color: rgb(1, 168, 1); font-style: italic;">// Calculate the absolute value function module:</span></pre><pre style="font-family: Monospaced; font-style: normal;"><span style="color: rgb(1, 168, 1); font-style: italic;"></span><span style="color: rgb(0, 0, 0);">yabs</span> <span style="color: rgb(92, 92, 92);">=</span> <span style="color: rgb(50, 185, 185);">abs</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(0, 0, 0);">y</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">;</span>
<span style="color: rgb(1, 168, 1); font-style: italic;">// Calcula the function module in dB</span>
<span style="color: rgb(0, 0, 0);">ym</span> <span style="color: rgb(92, 92, 92);">=</span> <span style="color: rgb(188, 143, 143);">20</span><span style="color: rgb(92, 92, 92);">*</span><span style="color: rgb(174, 92, 176); text-decoration: underline;">log10</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(50, 185, 185);">abs</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(0, 0, 0);">y</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">;</span>
</pre><pre style="font-family: Monospaced; font-style: normal;"><span style="color: rgb(1, 168, 1); font-style: italic;">// Calculate the phase function in degree:</span>
<span style="color: rgb(0, 0, 0);">yf</span> <span style="color: rgb(92, 92, 92);">=</span> <span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(188, 143, 143);">180</span><span style="color: rgb(92, 92, 92);">/</span><span style="color: rgb(218, 112, 214);">%pi</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(92, 92, 92);">*</span><span style="color: rgb(50, 185, 185);">atan</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(50, 185, 185);">imag</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(0, 0, 0);">y</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(50, 185, 185);">real</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(0, 0, 0);">y</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(74, 85, 219);">)</span><span style="color:
rgb(0, 0, 0);">;</span>
<span style="color: rgb(1, 168, 1); font-style: italic;">// open and clean the graph window</span>
<span style="color: rgb(0, 0, 0);">xbasc</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">,</span>
<span style="color: rgb(1, 168, 1); font-style: italic;">// Divide the graph window in three rows:</span>
<span style="color: rgb(174, 92, 176); text-decoration: underline;">subplot</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(188, 143, 143);">3</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(188, 143, 143);">1</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(188, 143, 143);">1</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">,</span>
<span style="color: rgb(50, 185, 185);">plot2d</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(188, 143, 143);">'</span><span style="color: rgb(188, 143, 143);">ln</span><span style="color: rgb(188, 143, 143);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">f</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">yabs</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">style</span><span style="color: rgb(92, 92, 92);">=</span><span style="color: rgb(188, 143, 143);">2</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">,</span>
<span style="color: rgb(50, 185, 185);">xgrid</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">,</span>
<span style="color: rgb(50, 185, 185);">xtitle</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(188, 143, 143);">Modulo em valores absolutos da Função de Transferência</span><span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(188, 143, 143);">Freqüência [Hz]</span><span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(188, 143, 143);">Módulo em dB</span><span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">;</span></pre><pre style="font-family: Monospaced; font-style: normal;"><span style="color: rgb(174, 92, 176); text-decoration: underline;">subplot</span><span style="color:
rgb(74, 85, 219);">(</span><span style="color: rgb(188, 143, 143);">3</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(188, 143, 143);">1</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(188, 143, 143);">2</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">,</span>
<span style="color: rgb(50, 185, 185);">plot2d</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(188, 143, 143);">'</span><span style="color: rgb(188, 143, 143);">ln</span><span style="color: rgb(188, 143, 143);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">f</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">ym</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">style</span><span style="color: rgb(92, 92, 92);">=</span><span style="color: rgb(188, 143, 143);">2</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">,</span>
<span style="color: rgb(50, 185, 185);">xgrid</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">,</span>
<span style="color: rgb(50, 185, 185);">xtitle</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(188, 143, 143);">Modulo em dB da Função de Transferência</span><span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(188, 143, 143);">Freqüência [Hz]</span><span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(188, 143, 143);">Módulo em dB</span><span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">;</span>
</pre><pre style="font-family: Monospaced; font-style: normal;"><span style="color: rgb(174, 92, 176); text-decoration: underline;">subplot</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(188, 143, 143);">3</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(188, 143, 143);">1</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(188, 143, 143);">3</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">,</span>
<span style="color: rgb(50, 185, 185);">plot2d</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(188, 143, 143);">'</span><span style="color: rgb(188, 143, 143);">ln</span><span style="color: rgb(188, 143, 143);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">f</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">yf</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">style</span><span style="color: rgb(92, 92, 92);">=</span><span style="color: rgb(188, 143, 143);">3</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">,</span>
<span style="color: rgb(50, 185, 185);">xtitle</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(188, 143, 143);">Fase da Função de Transferência</span><span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(188, 143, 143);">Freqüência [Hz]</span><span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(188, 143, 143);">Fase em Graus</span><span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">;</span>
<span style="color: rgb(50, 185, 185);">xgrid</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">;</span>
<span style="color: rgb(1, 168, 1); font-style: italic;">// end</span></pre><div> </div><div>Thank you very much !</div><div> </div><div>All best,</div><div>Reinaldo.</div><div> </div><div>PS: send to me the modified Scilab script as attachment. Tnx.</div><div> </div><div> </div></div></body></html>