Menu

Python Code Differential Equations Octave Code Need Python 1 1985 1995 Yellowstone Nationa Q43829865

What is the python code for these differential equations? Wehave the octave code for each, but we need it in python.

1. From 1985 to 1995 in the Yellowstone national park, the elkpopulation in the park increased by 40% , from 13.000 to 18.000 .In year 1995, wolves were released in the park and and til 2009 theelk population fell from 18.000 to 7000. The model for thepopulation dynamics is :

frac{dE}{dt} = rE

E(0) = 13.0, E (10) = 18.0

In this equation, E(t) represents the elk population (inthousands) where t is measured
in years since 1985. The solution finds the combined birth/deathgrowth rate r to be approximately 0.0325 yielding:

E(t) = 13.0 x 0.0325

Octave:

>> function xdot = f(x,t) r=0.0325;

xdot(1) = r*x(1);

endfunction

>> x = 1sode (”f”, [13]. (t = 1inspace (0, 50,200)’));

>> plot (t,x)

2.  In 1995, 21 wolves were initially released andtheir numbers have risen. In 2007, biologists estimated theirnumber to get to 171.

de dt = = 0.0325 E - 0.8EW W = -0,6W + 0.05 EW dt E(0) = 18.0,W(0) = 0.021

We need to solve this system of equations in Python.

Octave :

>> function xdot = f(x,t)

xdot(1) = 0.0325 * x(1) – 0.8 * x(1) * x(2);

xdot(2) = -0.6 * x(2) + 0.05 * x(1) * x(2);

endfunction

>> x = 1sode (”f”, [18; 0.021], (t = 1inspace (0, 50,200)’));

>> plot (t,x)

We were unable to transcribe this imageE(0) = 13.0, E (10) = 18.0 E(t) = 13.0 x 0.0325 de dt = = 0.0325 E – 0.8EW W = -0,6W + 0.05 EW dt E(0) = 18.0,W(0) = 0.021 Show transcribed image text
E(0) = 13.0, E (10) = 18.0
E(t) = 13.0 x 0.0325
de dt = = 0.0325 E – 0.8EW W = -0,6W + 0.05 EW dt E(0) = 18.0,W(0) = 0.021

Expert Answer


Answer to What is the python code for these differential equations? We have the octave code for each, but we need it in python. 1….

OR