Difference between revisions of "Lotka Volterra fishing problem (Muscod)"

From mintOC
Jump to: navigation, search
m (In)
 
m (SebastianSager moved page Lotka Volterra fishing problem (C) to Lotka Volterra fishing problem (Muscod) without leaving a redirect: Moved C to Muscod)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
The differential equations for the [[Lotka Volterra fishing problem]] in [[:Category:C | C code]] read as follows
+
The differential equations for the [[Lotka Volterra fishing problem]] in [[:Category:Muscod | Muscod code]] read as follows
  
The differential equations in C code:
 
 
<source lang="cpp">
 
<source lang="cpp">
 
/* steady state with u == 0 */
 
/* steady state with u == 0 */
Line 14: Line 13:
 
</source>
 
</source>
  
[[Category:C]]
+
[[Category:Muscod]]

Latest revision as of 10:20, 28 January 2016

The differential equations for the Lotka Volterra fishing problem in Muscod code read as follows

/* steady state with u == 0 */
double ref0 = 1, ref1 = 1;
 
/* Biomass of prey */
rhs[0] =   xd[0] - xd[0]*xd[1] - p[0]*u[0]*xd[0];
/* Biomass of predator */
rhs[1] = - xd[1] + xd[0]*xd[1] - p[1]*u[0]*xd[1];
/* Deviation from reference trajectory */
rhs[2] = (xd[0]-ref0)*(xd[0]-ref0) + (xd[1]-ref1)*(xd[1]-ref1);