<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
In fact I have try several methods and no one is working, do you know if it's possible with scilab to plot alpha(t) and alpha'(t) when the differential equation is like : <div>alpha''(t) = A*(1-sin(alpha(t)))/(pi/2-alpha(t))-B*(alpha'(t))^2/(pi/2-alpah(t))</div><div><br></div><div>What would be the function to use ?</div><div><br></div><div><br><br><div><hr id="stopSpelling">Date: Thu, 21 Jul 2011 14:06:16 +0200<br>From: Serge.Steer@inria.fr<br>To: users@lists.scilab.org<br>Subject: Re: [scilab-Users] problem with scilab<br><br>
<meta http-equiv="Content-Type" content="text/html; charset=unicode">
<meta name="Generator" content="Microsoft SafeHTML">
<br>
What do you mean by "<span style="color:rgb(74, 85, 219)">it
doesn't work.</span>" error message?, unexpected results?<br>
<br>
I was not able to run it because g R DeltaP and B are undefined.<br>
<br>
<br>
Serge Steer<br>
INRIA<br>
<br>
Le 21/07/2011 11:25, arnaud dujeu a écrit :
<blockquote cite="mid:SNT112-W13E300616AF6F3CDFDF1A1884F0@phx.gbl">
<style>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Tahoma;}
</style>
<div dir="ltr">
Hi,
<div><br>
</div>
<div>I've got a problem to solve a non linear differential
equation, which is :</div>
<div><br>
</div>
<div>y1'=A*(1-sin(y2))/(pi/2-y2)-B*y1^2</div>
<div>y2'=y1</div>
<div><br>
</div>
<div><br>
</div>
<div>I'm using ode : </div>
<div><br>
</div>
<div>
<pre style="font-family:Monospaced;font-style:normal;font-size:14px"><span style="color:rgb(176, 24, 19)">function</span> <span style="color:rgb(74, 85, 219)">[</span><span style="color:rgb(131, 67, 16);font-weight:bold">Xprime</span><span style="color:rgb(74, 85, 219)">]</span><span style="color:rgb(92, 92, 92)">=</span><span style="color:rgb(0, 0, 0);text-decoration:underline">VanDerPol</span><span style="color:rgb(74, 85, 219)">(</span><span style="color:rgb(131, 67, 16);font-weight:bold">t</span><span style="color:rgb(0, 0, 0)">, </span><span style="color:rgb(131, 67, 16);font-weight:bold">X</span><span style="color:rgb(74, 85, 219)">)</span>
<span style="color:rgb(131, 67, 16);font-weight:bold">Xprime</span><span style="color:rgb(74, 85, 219)">(</span><span style="color:rgb(188, 143, 143)">1</span><span style="color:rgb(74, 85, 219)">)</span> <span style="color:rgb(92, 92, 92)">=</span> <span style="color:rgb(131, 67, 16);font-weight:bold">X</span><span style="color:rgb(74, 85, 219)">(</span><span style="color:rgb(188, 143, 143)">2</span><span style="color:rgb(74, 85, 219)">)</span>
<span style="color:rgb(131, 67, 16);font-weight:bold">Xprime</span><span style="color:rgb(74, 85, 219)">(</span><span style="color:rgb(188, 143, 143)">2</span><span style="color:rgb(74, 85, 219)">)</span> <span style="color:rgb(92, 92, 92)">=</span> <span style="color:rgb(0, 0, 0)">g</span><span style="color:rgb(92, 92, 92)">/</span><span style="color:rgb(0, 0, 0)">R</span><span style="color:rgb(92, 92, 92)">*</span><span style="color:rgb(74, 85, 219)">(</span><span style="color:rgb(188, 143, 143)">1</span><span style="color:rgb(92, 92, 92)">-</span><span style="color:rgb(50, 185, 185)">sin</span><span style="color:rgb(74, 85, 219)">(</span><span style="color:rgb(131, 67, 16);font-weight:bold">X</span><span style="color:rgb(74, 85, 219)">(</span><span style="color:rgb(188, 143, 143)">1</span><span style="color:rgb(74, 85, 219)">)</span><span style="color:rgb(74, 85, 219)">)</span><span style="color:rgb(74, 85, 219)">)</span><span>/</span><span style="color:rgb(74, 85, 219)">(</span><span style="color:rgb(218, 112, 214)">%pi</span><span style="color:rgb(92, 92, 92)">/</span><span style="color:rgb(188, 143, 143)">2</span><span style="color:rgb(92, 92, 92)">-</span><span style="color:rgb(131, 67, 16);font-weight:bold">X</span><span style="color:rgb(74, 85, 219)">(</span><span style="color:rgb(188, 143, 143)">1</span><span style="color:rgb(74, 85, 219)">)</span><span style="color:rgb(74, 85, 219)">)</span><span style="color:rgb(92, 92, 92)">-</span><span style="color:rgb(0, 0, 0)">deltaP</span><span style="color:rgb(92, 92, 92)">/</span><span style="color:rgb(74, 85, 219)">(</span><span style="color:rgb(0, 0, 0)">B</span><span style="color:rgb(92, 92, 92)">*</span><span style="color:rgb(74, 85, 219)">(</span><span style="color:rgb(218, 112, 214)">%pi</span><span style="color:rgb(92, 92, 92)">/</span><span style="color:rgb(188, 143, 14
3)">2</span><span style="color:rgb(92, 92, 92)">-</span><span style="color:rgb(131, 67, 16);font-weight:bold">X</span><span style="color:rgb(74, 85, 219)">(</span><span style="color:rgb(188, 143, 143)">1</span><span style="color:rgb(74, 85, 219)">)</span><span style="color:rgb(74, 85, 219)">)</span><span style="color:rgb(74, 85, 219)">)</span>
<span style="color:rgb(176, 24, 19)">endfunction</span>
<span style="color:rgb(0, 0, 0)">t</span><span style="color:rgb(92, 92, 92)">=</span><span style="color:rgb(174, 92, 176);text-decoration:underline">linspace</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)">4</span><span style="color:rgb(0, 0, 0)">,</span><span style="color:rgb(188, 143, 143)">3000</span><span style="color:rgb(74, 85, 219)">)</span><span style="color:rgb(0, 0, 0)">;</span> <span style="color:rgb(0, 0, 0)">X0</span><span style="color:rgb(92, 92, 92)">=</span><span style="color:rgb(74, 85, 219)">[</span><span style="color:rgb(188, 143, 143)">85</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(188, 143, 143)">180</span><span style="color:rgb(0, 0, 0)">;</span><span style="color:rgb(188, 143, 143)">0</span><span style="color:rgb(74, 85, 219)">]</span><span style="color:rgb(0, 0, 0)">;</span>
<span style="color:rgb(74, 85, 219)">[</span><span style="color:rgb(0, 0, 0)">u</span><span style="color:rgb(74, 85, 219)">]</span><span style="color:rgb(92, 92, 92)">=</span><span style="color:rgb(50, 185, 185)">ode</span><span style="color:rgb(74, 85, 219)">(</span><span style="color:rgb(0, 0, 0)">X0</span><span style="color:rgb(0, 0, 0)">,</span><span style="color:rgb(188, 143, 143)">0</span><span style="color:rgb(0, 0, 0)">,</span><span style="color:rgb(0, 0, 0)">t</span><span style="color:rgb(0, 0, 0)">,</span><span style="color:rgb(0, 0, 0);text-decoration:underline">VanDerPol</span><span style="color:rgb(74, 85, 219)">)</span><span style="color:rgb(0, 0, 0)">;</span>
<span style="color:rgb(174, 92, 176);text-decoration:underline">plot</span><span style="color:rgb(74, 85, 219)">(</span><span style="color:rgb(0, 0, 0)">t</span><span style="color:rgb(0, 0, 0)">,</span><span style="color:rgb(0, 0, 0)">u</span><span style="color:rgb(74, 85, 219)">(</span><span style="color:rgb(188, 143, 143)">1</span><span style="color:rgb(0, 0, 0)">,</span><span style="color:rgb(255, 170, 0)">:</span><span style="color:rgb(74, 85, 219)">)</span><span style="color:rgb(92, 92, 92)">*</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(0, 0, 0)">,</span><span style="color:rgb(188, 143, 143)">'</span><span style="color:rgb(188, 143, 143)">r</span><span style="color:rgb(188, 143, 143)">'</span><span style="color:rgb(74, 85, 219)">)</span>
<span style="color:rgb(174, 92, 176);text-decoration:underline">plot</span><span style="color:rgb(74, 85, 219)">(</span><span style="color:rgb(0, 0, 0)">t</span><span style="color:rgb(0, 0, 0)">,</span><span style="color:rgb(0, 0, 0)">R</span><span style="color:rgb(92, 92, 92)">*</span><span style="color:rgb(0, 0, 0)">u</span><span style="color:rgb(74, 85, 219)">(</span><span style="color:rgb(188, 143, 143)">2</span><span style="color:rgb(0, 0, 0)">,</span><span style="color:rgb(255, 170, 0)">:</span><span style="color:rgb(74, 85, 219)">)</span><span style="color:rgb(74, 85, 219)">)</span></pre>
<pre style="font-family:Monospaced;font-style:normal;font-size:14px"><span style="color:rgb(74, 85, 219)">
</span></pre>
<pre style="font-family:Monospaced;font-style:normal;font-size:14px"><span style="color:rgb(74, 85, 219)">
</span></pre>
<pre style="font-family:Monospaced;font-style:normal;font-size:14px"><span style="color:rgb(74, 85, 219)">but it doesn't work.</span></pre>
<pre style="font-family:Monospaced;font-style:normal;font-size:14px"><font class="ecxApple-style-span" color="#4a55db">
</font></pre>
<pre style="font-family:Monospaced;font-style:normal;font-size:14px"><font class="ecxApple-style-span" color="#4a55db">Do you know why?</font></pre>
<pre style="font-family:Monospaced;font-style:normal;font-size:14px"><font class="ecxApple-style-span" color="#4a55db">
</font></pre>
<pre style="font-family:Monospaced;font-style:normal;font-size:14px"><font class="ecxApple-style-span" color="#4a55db">Best regards.</font></pre>
</div>
</div>
</blockquote>
<br></div></div> </div></body>
</html>