<div dir="ltr"><div>You could simulate those in XCOS like an analog computation using Differentiators and its inverse for the solution also multipliers by the way.<br><br></div>Berns B.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Sep 14, 2014 at 10:54 PM, Farid Afandiyev <span dir="ltr"><<a href="mailto:faridafandiyev@gmail.com" target="_blank">faridafandiyev@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks Mehran! This is exactly what I want!<div><br></div><div>Kind regards,</div><div><br>Farid.<div><div class="h5"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Sep 14, 2014 at 4:04 PM, A Khorshidi <span dir="ltr"><<a href="mailto:akhorshidi@live.com" target="_blank">akhorshidi@live.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Farid Afandiyev wrote<br>
> It looks like this<br>
> dV1/dt = 0.01V1 - 0.01V2<br>
> dV2/dt = -0.01V1 + 0.01V2<br>
> V1(0) = 10000<br>
> V2(0) = 5000<br>
><br>
> I want to plot V1 and V2 against time t=[0:10]<br>
<br>
Hi;<br>
<br>
You can use the scheme below to solve system of ODEs in Scilab:<br>
//<br>
function xdot = modelName(t,x)<br>
    xdot = f(t,x) // where xdot and x are vectors<br>
endfunction<br>
<br>
x0 = [x1(0) x2(0)... xn(0)]' // a vector of the initial conditions<br>
t0 = initialTime // a scalar: initial time<br>
tf = finalTime // a scalar: final time<br>
t = linspace(t0, tf)// a vector: the times that you want a solution for<br>
<br>
x = ode(x0,t0,t,modelName);<br>
<br>
plot(t', [x(1,:); x(2,:); ... x($,:)]')<br>
//<br>
<br>
And to really answer your question:<br>
<br>
function Vdot=model(t, V)<br>
    Vdot(1) = 0.01*V(1) - 0.01*V(2)<br>
    Vdot(2) = -0.01*V(1) + 0.01*V(2)<br>
endfunction<br>
V0=[10000 5000]';<br>
t0=0;<br>
t=0:0.1:10;<br>
V = ode(V0,t0,t,model);<br>
plot(t', [V(1,:); V(2,:)]')<br>
<br>
HTH<br>
Mehran<br>
_<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://mailinglists.scilab.org/Scilab-users-Fwd-Help-modeling-ODE-system-tp4031148p4031151.html" target="_blank">http://mailinglists.scilab.org/Scilab-users-Fwd-Help-modeling-ODE-system-tp4031148p4031151.html</a><br>
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.<br>
_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a><br>
<a href="http://lists.scilab.org/mailman/listinfo/users" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a><br>
</blockquote></div><br></div></div></div></div></div>
<br>_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@lists.scilab.org">users@lists.scilab.org</a><br>
<a href="http://lists.scilab.org/mailman/listinfo/users" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Bernardino (Berns) Jerez Buenaobra<div>Senior Science Research Specialist <br></div><div>Data Processing Component<br></div><div>USC DOST-UP/NEC Project LiDAR (Light Detection and Ranging)<br></div><div>for Disaster Risk Exposure Assessment for Mitigation (DREAM)<br>University of San Carlos (Talamban Campus)<br></div><div>Contact information: <br>
Mobile: <a value="+639054732772">+639054732772</a> </div><div>Office: +63323464614<br>Google+ <a href="mailto:berns.buenaobra@gmail.com" target="_blank">berns.buenaobra@gmail.com</a></div><div>Skype ID: poormanphysics<br>Professional Reference, Research and Education link:<br>
<a href="http://ph.linkedin.com/pub/bernardino-buenaobra/16/42/637" target="_blank">http://ph.linkedin.com/pub/bernardino-buenaobra/16/42/637</a><br><br></div></div>
</div>