Paras31

25 Reputation

0 Badges

0 years, 56 days
Hellenic Open University

Social Networks and Content at Maplesoft.com

Teacher of Mathematics with a proven track record of working in education management. Proficient in Ease of Adaptation, Course Design, and Instructional Technology. Strong education professional with a Bachelor's degree with an emphasis in Mathematics from the University of Aegean. Currently, he is pursuing a Master's degree in Applied Mathematics at the Hellenic Open University, with a specific focus on Ordinary and Partial Differential equations. His enthusiasm lies in the application of mathematical models to real-world contexts, such as epidemiology and population growth. His academic exploration led them to participate in a specialized course on Mathematical Modeling with Differential Equations at Delft University, broadening their horizons. His overarching goal is to leverage their adeptness in modeling to enhance their teaching approach and provide valuable contributions to the field through insightful perspective

MaplePrimes Activity


These are questions asked by Paras31

In this exercise, we are going back to the simple SIR model, without births or deaths, to look at the effect of vaccination. The aim of this activity is to represent vaccination in a very simple way - we are assuming it already happened before we run our model! By changing the initial conditions, we can prepare the population so that it has received a certain coverage of vaccination.

We are starting with the transmission and recovery parameters b = 0.4 days-1 and  c=0.1 days-1. To incorporate immunity from vaccination in the model, we assume that a proportion p of the total population starts in the recovered compartment, representing the vaccine coverage and assuming the vaccine is perfectly effective. Again, we assume the epidemic starts with a single infected case introduced into the population.​
We are going to model this scenario for a duration of 2 years, assuming that the vaccine coverage is 50%, and plot the prevalence in each compartment over time.

I have used the following code to solve this problem but I face difficulties when I am trying to define and plot the effective reproduction number.

Any suggestions? Thank you in advance!
with(Physics, diff);
with(LinearAlgebra);

with(plots);
with(DEtools);

b := 0.4;
c := 0.1;
n := 10^6;
p := 0.5;
deS := diff(S(t), t) = -b*S(t)*I0(t);
deI := diff(I0(t), t) = b*S(t)*I0(t) - c*I0(t);
deR := diff(R(t), t) = c*I0(t);

F := dsolve([deS, deI, deR, S(0) = 1 - p, I0(0) = 1/n, R(0) = p], [S(t), I0(t), R(t)], numeric, method = rkf45, maxfun = 100000)

odeplot(F, [[t, S(t)], [t, I0(t)], [t, R(t)]], t = 0 .. 730, colour = [blue, red, green], legend = ["S(t)", "I0(t)", "R(t)"], labels = ["Time (days)", "Proportion of Population"], title = "SIR Model with vaccination")


#define the effective reproduction number
Reff := t -> b*1/c*S(t)*1/n;
Reff(100);

SI_MODEL.mw
I have tried the following code to simulate the following SI Model. But when I run it, it gives me several mistakes and most importantly does not calculate the Jacobian Matrix and the eigenvalues. 

Any help would be deeply appreciated


Many of the most interesting dynamics in nature have to do with interactions between organisms. These interactions are often subtle, indirect, and difficult to detect. Interactions in which one organism consumes all or part of another. This includes predator-prey, herbivore-plant, and parasite-host interactions. These linkages are the prime movers of energy through food chains. They are an important factor in the ecology of populations, determining the mortality of prey and the birth of new predators.

Mathematical models and logic suggest that a coupled system of predator and prey should cycle: predators increase when prey is abundant, prey are driven to low numbers by predation, the predators decline, and the prey recover, ad infinitum. One such model that simulates predator-prey interactions is the Lotka - Volterra Model.

 


We will discuss a behavior of 2 D - subsystems: SI - model.


SI Model (without predator)

 

We will study a mathematical model that appears in eco - eco-epidemiology.


The SI model describes the interactions between S-prey with density x and I-prey with density y under the assumption z≡0


Break the population into compartments.

• 

Prey (S)

• 

Infected prey (I)


SI Equations :

(D(x))(t) = r*x(t)-b*x(t)^2-c*x(t)*y(t)-beta*x(t)*y[t]/(a+x(t))

(D(y))(t) = -mu*y(t)+beta*x(t)*y(t)/(a+x(t))

– 

 r stands for the intrinsic growth rate of S-prey.

– 

b defines the intra-class competition in S-prey.

– 

c characterizes the inter-class competition between S-prey and I-prey.

– 

μ stands for the mortality of the I-prey

– 

β considered as the bifurcation parameter.

• 

Note: The dynamics of the system depend on parameter β

 

Modeling with Differential Equations

 

• 

We will fix the parameters in the study to have the following values r = 1, b = 1, c = 1/100, μ = 4/10, a=1/2.75.

• 

The initial values will be x(0)=0.2, y(0)=0.05


As mentioned above the dynamics of the system depend on parameter β. So we will consider two cases when β=0.75 and β=1


We will solve the system for the above values of parameters and initial conditions and for a time interval [0,200] , then we will create its plots

 

Case 1

  restart

beta := .75; r := 1; b := 1; c := 1/100; mu := 4*(1/10); a := 1/2.75; f := r*x(t)-b*x(t)^2-c*x(t)*y(t)-(3/4)*x(t)*y(t)/(a+x(t)); g := -mu*y(t)+(3/4)*x(t)*y(t)/(a+x(t)); deq1 := diff(x(t), t) = f; deq2 := diff(y(t), t) = g; equilibrio := solve({f = 0, g = 0}, {x(t), y(t)}); jacobian := simplify(Matrix(2, 2, [[diff(f, x(t)), diff(f, y(t))], [diff(g, x(t)), diff(g, y(t))]])); A := simplify(eval(jacobian, equilibrio[1])); B := simplify(eval(jacobian, equilibrio[2])); Q := simplify(eval(jacobian, equilibrio[3])); eigen1 := Eigenvalues(A); eigen2 := Eigenvalues(B); eigen3 := Eigenvalues(Q); soln := dsolve({deq1, deq2, x(0) = .2, y(0) = 0.5e-1}, numeric, output = listprocedure); plots:-display(plots:-odeplot(soln, [t, x(t)], 0 .. 200, color = blue, legend = ["x(t)"]), plots:-odeplot(soln, [t, y(t)], 0 .. 200, color = red, legend = ["y(t)"]), labels = ["t", "Population"], title = "Population Dynamics")

 

NULL

 

 

Case 2

restart``

beta := 1; r := 1; b := 1; c := 1/100; Mu := 4*(1/10); a := 1/2.75; f := r*x(t)-b*x(t)^2-c*x(t)*y(t)-x(t)*y(t)/(a+x(t)); g := -Mu*y(t)+x(t)*y(t)/(a+x(t)); deq1 := diff(x(t), t) = f; deq2 := diff(y(t), t) = g; equilibrio := solve({f = 0, g = 0}, {x(t), y(t)}); jacobian := Matrix(2, 2, [[diff(f, x(t)), diff(f, y(t))], [diff(g, x(t)), diff(g, y(t))]], simplify); J_at_equilibrio := [eval(jacobian, equilibrio)]; eigen1 := Eigenvalues(A); eigen2 := Eigenvalues(B); eigen3 := Eigenvalues(Q); soln := dsolve({deq1, deq2, x(0) = .2, y(0) = 0.5e-1}, numeric); plots:-display(plots:-odeplot(soln, [t, x(t)], 0 .. 200, color = blue, legend = ["x(t)"]), plots:-odeplot(soln, [t, y(t)], 0 .. 200, color = red, legend = ["y(t)"]), labels = ["t", "Population"], title = "Population Dynamics with Beta = 1")

 

NULL


 

Download SI_MODEL.mw

 

 

Good evening!

I am Athanasios Paraskevopoulos, a graduate student specializing in applied mathematics. Recently, I've started exploring Maple through its trial version and I'm considering making a purchase. My question for you all is: Am I restricted to buying only the graduate student package, or am I free to choose from any of the Maple packages available? Any guidance or personal experiences with different packages would be greatly appreciated!

Thank you in advance for your help!

Hello, everyone,

I am new to Maple and I am trying to get use of it.

I tried to plot the following linear systems in different ways. I realized that the Student Linear Algebra is not as flexible as Linear Algebra. My question is the following. Is there any other way to create a plot without defining the implicit plots?

with(Student[LinearAlgebra])

A := Matrix([[1, 1], [12, 16]]); b := Vector([10, 136]); sol := LinearSolve(A, b)

Matrix(2, 2, {(1, 1) = 1, (1, 2) = 1, (2, 1) = 12, (2, 2) = 16})

 

Vector(2, {(1) = 10, (2) = 136})

 

Vector[column](%id = 36893488153382714652)

(1)

LinearSystemPlot({x+y = 10, 12*x+16*y = 136}, axes = normal)

 

restart

 

 

with(Student[LinearAlgebra])

A := Matrix([[2, -1, 1], [0, 1, 3], [0, 0, 1]]); b := Vector([-5, 7, 2]); sol := LinearSolve(A, b)

Matrix(3, 3, {(1, 1) = 2, (1, 2) = -1, (1, 3) = 1, (2, 1) = 0, (2, 2) = 1, (2, 3) = 3, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1})

 

Vector(3, {(1) = -5, (2) = 7, (3) = 2})

 

LinearSolve(Matrix(%id = 36893488151878044716), Vector[column](%id = 36893488151878030628))

(2)

LinearSystemPlot({w = 2, y+3*w = 7, 2*x-y+w = -5}, axes = normal)

 

restart

with(plots); with(LinearAlgebra); A := Matrix([[1, 1], [12, 16]]); b := Vector([10, 136]); sol := LinearSolve(A, b); eq1 := x+y = 10; eq2 := 12*x+16*y = 136; plot1 := implicitplot(eq1, x = -5 .. 10, y = -50 .. 50, color = "red", thickness = 2, labels = ["x", "y"]); plot2 := implicitplot(eq2, x = -5 .. 10, y = -50 .. 50, color = "blue", thickness = 2); display(plot1, plot2, title = "Plot of Linear System", legend = [x+y = 10, 12*x+16*y = 136])

Matrix(2, 2, {(1, 1) = 1, (1, 2) = 1, (2, 1) = 12, (2, 2) = 16})

 

Vector(2, {(1) = 10, (2) = 136})

 

Vector[column](%id = 36893488153330030820)

 

x+y = 10

 

12*x+16*y = 136

 

 

A := Matrix([[2, -1, 1], [0, 1, 3], [0, 0, 1]]); b := Vector([-5, 7, 2]); solution := LinearSolve(A, b); eq1 := 2*x-y+z = -5; eq2 := y+3*z = 7; eq3 := z = 2; plot1 := implicitplot3d(eq1, x = -10 .. 10, y = -10 .. 10, z = -10 .. 10, color = "red", style = surface); plot2 := implicitplot3d(eq2, x = -10 .. 10, y = -10 .. 10, z = -10 .. 10, color = "blue", style = surface); plot3 := implicitplot3d(eq3, x = -10 .. 10, y = -10 .. 10, z = -10 .. 10, color = "green", style = surface); display(plot1, plot2, plot3, title = "3D Plot of Linear System", axes = boxed)

Matrix(3, 3, {(1, 1) = 2, (1, 2) = -1, (1, 3) = 1, (2, 1) = 0, (2, 2) = 1, (2, 3) = 3, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1})

 

Vector(3, {(1) = -5, (2) = 7, (3) = 2})

 

Vector[column](%id = 36893488152610632156)

 

 

NULL


 

Download linear_systems.mw

 

Page 1 of 1