Application Center - Maplesoft

App Preview:

Classroom Tips and Techniques: An Implicit Analytic Solution of the Lotka-Volterra Model

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application


Image 

Classroom Tips and Techniques: An Implicit Analytic Solution of the Lotka-Volterra Model

Robert J. Lopez
Emeritus Professor of Mathematics and Maple Fellow
Maplesoft 

Introduction 

 

The nonlinear autonomous system of ODEs 

 

 

 

 

is a realization of the Lotka-Volterra predator-prey model whose phase portrait is typically drawn by solving the equations numerically.  Some texts reveal that an implicit analytic solution exists, and in this column we use Maple to investigate this claim. 

 

Initializations 

 

 

 

 

Graphical Solution by Tutor 

 

Figure 1 shows how to access the DE Plots Tutor from the Tools menu. 

 

Image 

Figure 1   Accessing the DE Plots Tutor 

 

Figure 2 shows the starting pane for the DE Plots Tutor. 

 

Image 

Figure 2   Starting pane for the DE Plots Tutor 

 

The drop-down box on the upper-right provides access to a number of built-in models, the first of which is the Lotka-Volterra model.  The two leftmost buttons (DEplot and Animate) will launch panes in which interactions with the Lotka-Volterra model take place.  Figure 3 shows the default view obtained by pressing the DEplot button. 

 

Image 

Figure 3   Default view of the Lotka-Volterra model in the DEplot Tutor 

 

The default color for trajectories in the phase plane is, unfortunately, difficult to see against the background of arrows, and if projected onto a screen, will seem to disappear entirely.  The underlying command is the DEplots command from the DEtools package.  Options to this command can be entered in the box labeled "Other options."  Figure 4 shows how to change the color of trajectories, and also shows how to increase the default range (10) on the path parameter so that the orbits close. 

 

Image 

Figure 4   Trajectories rendered in black, with integration range increased to 14 (from 10) 

 

If in the pane displayed in Figure 2 the Animate button is pressed, an animation of the tracing of the trajectories will be obtained.  Unfortunately, the orbit colors and the integration range will revert to their default values, and will have to be reset for the animation. 

 

Examination of Figure 3 or 4 will reveal that the Lotka-Volterra model consists of the equations 

 

   

 

 

with .  The trajectories are qualitatively the same if , the values we have assumed in the Introduction. 

 

Graphical Solution by Task Template 

 

Table 1 shows a phase portrait for a realization of the Lotka-Volterra model developed interactively by a Task Template. The path to the Task Template is given at the top of the table.  The equilibrium points are easily determined to be and .  The first is a saddle point that represents extinction of both species; the second, a neutrally stable center. 

 

Tools?Tasks?Browse: Differential Equations?ODEs?Phase Portrait - Autonomous Systems 

Phase Portraits for Autonomous Systems 

Plot Window 

 

Embedded componentEmbedded component,     Embedded componentEmbedded component 

 

Differential Equations 

 

= Embedded component 

= Embedded component 

 

Equilibrium (Critical) Points 

 

Embedded component 

 

Parameter  

     Embedded componentEmbedded component                      Enter Data 

Embedded component 

 Erase Phase Portrait                Clear All 

Table 1   Interactive phase portrait drawn by Task Template 

 

Solutions via the dsolve Command 

 

If the path parameter is eliminated from the model, the single ODE 

 

 

 

results.  Maple can provide both an implicit and an explicit solution of this variable-separable equation.  An explicit solution of the initial value problem (IVP) consisting of this equation and the initial condition is obtained in Table 2. 

 

 

y(x) = `+`(`-`(LambertW(-1, `+`(`-`(`/`(`*`(2, `*`(exp(`+`(x, `-`(3))))), `*`(x)))))))
 

Table 2   Explicit solution of the IVP defining one orbit for the Lotka-Volterra model 

 

The LambertW function provides an explicit solution of the equation .  Figure 5 contains a graph of the solution displayed in Table 2. 

 


 

Plot_2d
 

Figure 5   Graph of the explicit solution from Table 1 

 

The phase-plane trajectories for the Lotka-Volterra model are closed orbits, and hence are relations, not functions.  When Maple provides the explicit solution in Table 2, it is necessarily a function.  Hence, just the top half of the orbit is expressed by this solution. 

 

The full orbit is best expressed by the implicit solution obtained in Table 3. 

 

 

`+`(x, `-`(ln(x)), y(x), `-`(ln(y(x))), `-`(3), ln(2)) = 0
 

Table 3   Implicit solution of the IVP defining one orbit for the Lotka-Volterra model 

 

In order to graph this solution as an implicit function, each has to be written as simply .  This is done in Table 4. 

 

 

`+`(x, `-`(ln(x)), y, `-`(ln(y)), `-`(3), ln(2)) = 0
 

Table 4   Edited version of the implicit solution in Table 3. 

 

Figure 6 is a graph of the implicit solution in Table 4. 

 



 

Plot_2d
 

Figure 6   Graph of the implicit solution in Table 4 

 

Solutions via the ODE Analyzer Assistant 

 

The Context Menu for the parameter-free equation 

 

 

 

will contain the option Solve DE Interactively.  Selection of this option launches the ODE Analyzer Assistant.  See Figure 7. 

 

Image 

Figure 7   ODE Analyzer Assistant applied to the parameter-free form of the Lotka-Volterra equations 

 

Pressing the "Solve Symbolically" button accesses the panel shown in Figure 8.  The explicit solution shown is obtained by pressing the "Solve" button. 

 

Image 

Figure 8   Symbolic solution of the Lotka-Volterra model via the ODE Analyzer Assistant 

 

Notice the "Explicit" options in the middle on the left.  The default is that a symbolic solution will automatically be rendered in explicit form (where possible).  Figure 8 provides a general solution to the differential equation.  Figure 9 provides a general solution in implicit form. 

 

Image 

Figure 9   Implicit form of general solution to parameter-free Lotka-Volterra model 

 

The implicit solution in Figure 9 is obtained by selecting the "no" option in the "Explicit" drop-down box on the left. 

 

An initial condition can be declared by pressing the "Edit" button under the "Conditions" window (see Figure 7).  The "Edit Conditions" pane where this is done is shown in Figure 10. 

 

Image 

Figure 10   Declaring an initial condition 

 

After entering the values of and , the "Add" and "Done" buttons must be pressed.  When the "Solve Symbolically" button is pressed, the "Solve Symbolically" pane opens.  However, the Explicit options on the left are no longer available.  The last option for this setting will be in place, but will be grayed-out, and cannot be changed.  Figure 11 shows the result of pressing the "Solve" button at this point. 

 

Image 

Figure 11   Implicit solution of the IVP for the orbit through  

 

The behavior of the Explicit option when an initial condition has been added is not optimal, and is being reviewed for a future release of Maple.  At the time the ODE Analyzer Assistant was written, the underlying dsolve command could not return an implicit solution of an IVP.  In the years since, dsolve has been strengthened, but this improvement was not passed on to the Assistant. 

 

Implicit vs. Explicit General Solutions 

 

Table 5 contains an explicit general solution of the Lotka-Volterra model in which is replaced by the name , and the constant of integration is isolated.  This results in an implicit form , for which the level curves (contours) are the phase-plane trajectories of the system.  The surface illustrates graphically the values of on each trajectory. 

 

 

  • Enter the parameter-free ODE for the model.
    Press the Enter key.
 

 

  • Context Menu: Solve DE?
 

 

diff(y(x), x) = `/`(`*`(y(x), `*`(`+`(x, `-`(1)))), `*`(x, `*`(`+`(1, `-`(y(x))))))
 

 

y(x) = `+`(`-`(LambertW(`+`(`-`(`/`(`*`(exp(x), `*`(_C1)), `*`(x))))))) (1)
 

 

  • Using the evaluation template from the Expression palette, replace with , and with .
 


 

 

  • Context Menu: Solve?Isolate Expression for?
 

 

  • Context Menu: Right-hand Side
 

 

  • Context Menu: Plots?Plot Builder?
 

 

2-D contour plot 

 

 

 

Options?Color?Black 

 

 

y = `+`(`-`(LambertW(`+`(`-`(`/`(`*`(exp(x), `*`(c)), `*`(x)))))))
 

 

c = `/`(`*`(y, `*`(x)), `*`(exp(y), `*`(exp(x))))
 

 

`/`(`*`(y, `*`(x)), `*`(exp(y), `*`(exp(x)))) (2)
 

 

Plot_2d  
 

 

  • Using CTRL L to reference by its equation label, generate a copy of this fraction.
    Press the Enter key.
 

 

  • Context Menu: Plots?Plot Builder?
 

 

 

 

Options? 

 

Style?surface with contour 

Axes?boxed 

 

 

 

`/`(`*`(y, `*`(x)), `*`(exp(y), `*`(exp(x))))
 

 

Plot_2d  
 

Table 5   Phase portrait via an explicit general solution of the model 

 

 

The implicit general solution 

 

>
 

`+`(x, `-`(ln(x)), y(x), `-`(ln(y(x))), _C1) = 0 (3)
 

 

can be brought to the form 

 

>
 

`+`(x, y, alpha, ln(`/`(1, `*`(x, `*`(y))))) = 0 (4)
 

 

after which it's easier to obtain the form by hand. 

 

 

 

 

 

 

 

 

 

 

Implicit General Solution in the General Case 

 

An implicit general solution is available for the general case of the model, namely, for 

 

 

 

the parameter-free version of the model where all four coefficients are positive.  The coefficients are those used in the DEplot Tutor.  The equilibrium points are and . Table 6 summarizes the Maple calculations leading to the general solution. 

 

 

  • Obtain the implicit solution.
 

>
 

`+`(`*`(c, `*`(x)), `-`(`*`(beta, `*`(ln(x)))), `*`(b, `*`(y(x))), `-`(`*`(alpha, `*`(ln(y(x))))), _C1) = 0 (5)
 

 

  • Replace with and with
 

>
 

`+`(`*`(c, `*`(x)), `-`(`*`(beta, `*`(ln(x)))), `*`(b, `*`(y)), `-`(`*`(alpha, `*`(ln(y)))), s) = 0 (6)
 

 

  • Solve for .
 

>
 

s = `+`(`-`(`*`(c, `*`(x))), `*`(beta, `*`(ln(x))), `-`(`*`(b, `*`(y))), `*`(alpha, `*`(ln(y)))) (7)
 

 

  • Exponentiate both sides.
 

>
 

exp(s) = `/`(`*`(`^`(x, beta), `*`(`^`(y, alpha))), `*`(exp(`*`(c, `*`(x))), `*`(exp(`*`(b, `*`(y)))))) (8)
 

Table 6   Implicit general solution for the general case of the Lotka-Volterra model. 

>  
 

Recognizing that is a constant, we have obtained the general solution in the form .  Obtaining the implicit solution requires nothing more than a separation of variables and some elementary integrations.  Indeed, the differential equation can be put into the variable-separated form 

 

 

 

Integrating both sides leads to 

 

 

 

which is equivalent to either or .  Since all coefficients and variables are positive, one readily obtains 

 

 

 

Exponentiating both sides gives 

 

 

 

from which follows. 

 

 

Legal Notice: ? Maplesoft, a division of Waterloo Maple Inc. 2009. Maplesoft and Maple are trademarks of Waterloo Maple Inc. This application may contain errors and Maplesoft is not liable for any damages resulting from the use of this material. This application is intended for non-commercial, non-profit use only. Contact Maplesoft for permission if you wish to use this application in for-profit activities.