<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">
<pre class="bz_comment_text" id="comment_text_1">Take care that your system is unstable because the some roots of the
denominator have positive real parts. Consequently the step response diverge.
The solver sends messages about that and finally stops the integration before
the final time.
The csim function really do not take care of such cases. I will fix it
(probabily sending ans error message), but in any case it is not possible to
get correct result simulating a unstable system for a so long time.
//the following instructions work and reveal the divergence.
t=0:0.01:1;//a shorter simulation time
y=csim('step',t,syslin('c',numerador/denominador));
plot(t,y)</pre>
<br>
Le 11/10/2012 00:39, Gledson Melotti a écrit :<br>
</div>
<blockquote
cite="mid:1349908789.3960.YahooMailNeo@web125406.mail.ne1.yahoo.com"
type="cite">
<div style="color:#000; background-color:#fff; font-family:times
new roman, new york, times, serif;font-size:12pt">
<div><span id="result_box" class="" lang="en"><span class="hps">Hi,</span>
<span class="hps">deculpa</span> <span class="hps">me</span>
<span class="hps">the hassle</span><span>.</span> <span
class="hps">I</span> <span class="hps">gostari</span> <span
class="hps">to simulate</span> <span class="hps">a
transfer function</span> <span class="hps">in</span> <span
class="hps">SCILAB</span> <span class="hps">(as</span> <span
class="hps">the commands below</span><span>)</span><span>,</span>
<span class="hps">but I can not</span> <span class="hps">because</span>
<span class="hps">scilab</span> <span class="hps">provides</span>
<span class="hps">several errors</span><span>.</span> <span
class="hps">Could</span> <span class="hps">you</span> <span
class="hps">tell me</span> <span class="hps">what I
should</span> <span class="hps">do to get</span> <span
class="hps">simulate</span> <span class="hps">the
transfer function</span><span>.</span></span></div>
<pre style="font-family:Monospaced;font-style:normal;font-size:14.0;"><span style=""><span style="">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="">,</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="">;</span>
<span style="color:rgb(50,185,185);">funcprot</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">0</span><span style="color:rgb(74,85,219);">)</span><span style="">;
</span>num</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(50,185,185);">x_dialog</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(188,143,143);">numerador</span><span style="color:rgb(188,143,143);">'</span><span style="">,</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(188,143,143);">s^5*kd+s^4*(60*kd+kp)+s^3*(1500*kd-60*kp+ki)+s^2*(-15000*kd+1500*kp-60*ki)+s*(-15000*kp+1500*ki)-15000*ki</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(74,85,219);">)</span>
<span style="">den</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(50,185,185);">x_dialog</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(188,143,143);">denominador</span><span style="color:rgb(188,143,143);">'</span><span style="">,</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(188,143,143);">s^5*(kd)+s^4*(-1-60*kd+kp)+s^3*(-1500-60+1500*kd-60*kp+ki)+s^2*(-15000-1500-15000*kd+1500*kp-60*ki)+s*(-15000-15000*kp+1500*ki)-15000*ki</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(74,85,219);">)</span></pre>
<div
style="font-style:normal;font-size:16px;background-color:transparent;font-family:times
new roman, new york, times, serif;"><span>kp=96.770532;</span></div>
<div
style="font-style:normal;font-size:16px;background-color:transparent;font-family:times
new roman, new york, times, serif;">
<span>ki=42.568724 ;</span></div>
<div
style="font-style:normal;font-size:16px;background-color:transparent;font-family:times
new roman, new york, times, serif;"><span>kd=18.711118;<br>
</span></div>
<div><br>
</div>
<div
style="font-style:normal;font-size:16px;background-color:transparent;font-family:times
new roman, new york, times, serif;">
t=0:0.01:100;<br>
</div>
<pre style="font-family:Monospaced;font-style:normal;font-size:14.0;"><span style="">numerador</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(174,92,176);text-decoration:underline;">evstr</span><span style="color:rgb(74,85,219);">(</span><span style="">num</span><span style="color:rgb(74,85,219);">)</span><span style="">;</span>
<span style="">denominador</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(174,92,176);text-decoration:underline;">evstr</span><span style="color:rgb(74,85,219);">(</span><span style="">den</span><span style="color:rgb(74,85,219);">)</span><span style="">;
</span><span style="">y</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(174,92,176);text-decoration:underline;">csim</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(188,143,143);">step</span><span style="color:rgb(188,143,143);">'</span><span style="">,</span><span style="">t</span><span style="">,</span><span style="">numerador</span><span style="color:rgb(74,85,219);"></span><span style=""></span><span style="color:rgb(74,85,219);"></span><span style="color:rgb(92,92,92);">/</span><span style="">denominador</span><span style="color:rgb(74,85,219);"></span><span style=""></span><span style="color:rgb(74,85,219);"></span><span style="color:rgb(74,85,219);">)</span>
</pre>
<span class="hps">I thank you</span> <span class="hps">for your
attention</span><span>,</span><br>
<div style="color: rgb(0, 0, 0); font-size: 16px; font-family:
times new roman,new york,times,serif; background-color:
transparent; font-style: normal;"><span id="result_box"
class="" lang="en"><br>
<span class="hps">Gledson</span> <span class="hps">Melotti</span><span
class="">.</span></span></div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:dev@lists.scilab.org">dev@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/dev">http://lists.scilab.org/mailman/listinfo/dev</a>
</pre>
</blockquote>
<br>
</body>
</html>