ogunmiloro

105 Reputation

6 Badges

2 years, 331 days

MaplePrimes Activity


These are replies submitted by ogunmiloro

@mmcdara 
 

restart

with(LinearAlgebra); A := Matrix(5, 5, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = tau*`Πu`/mu, (3, 4) = 0, (3, 5) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = `ϖ`*`Πg`/mu}); B := Matrix(5, 5, {(1, 1) = mu, (1, 2) = 0, (1, 3) = 0, (1, 4) = gamma, (1, 5) = 0, (2, 1) = 0, (2, 2) = mu+omega, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = mu+sigma1, (3, 4) = theta, (3, 5) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = alpha2+gamma+mu, (4, 5) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = sigma1+alpha2, (5, 4) = 0, (5, 5) = theta}); C := A.(1/B); Rank(C); evs := Eigenvalues(C); eig := op(`minus`({entries(evs, nolist)}, {0}))

A := Matrix(5, 5, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = tau*`Πu`/mu, (3, 4) = 0, (3, 5) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = `ϖ`*`Πg`/mu})

 

B := Matrix(5, 5, {(1, 1) = mu, (1, 2) = 0, (1, 3) = 0, (1, 4) = gamma, (1, 5) = 0, (2, 1) = 0, (2, 2) = mu+omega, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = mu+sigma1, (3, 4) = theta, (3, 5) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = alpha2+gamma+mu, (4, 5) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = sigma1+alpha2, (5, 4) = 0, (5, 5) = theta})

 

C := Matrix(5, 5, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = tau*`Πu`/(mu*(mu+sigma1)), (3, 4) = -tau*`Πu`*theta/(mu*(alpha2+gamma+mu)*(mu+sigma1)), (3, 5) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = -`ϖ`*`Πg`*(sigma1+alpha2)/(mu*(mu+sigma1)*theta), (5, 4) = `ϖ`*`Πg`*(sigma1+alpha2)/(mu*(alpha2+gamma+mu)*(mu+sigma1)), (5, 5) = `ϖ`*`Πg`/(mu*theta)})

 

2

 

evs := Vector(5, {(1) = 0, (2) = 0, (3) = 0, (4) = tau*`Πu`/(mu*(mu+sigma1)), (5) = `ϖ`*`Πg`/(mu*theta)})

 

`ϖ`*`Πg`/(mu*theta), tau*`Πu`/(mu*(mu+sigma1))

(1)

params := {`Πg` = 2.2, `Πu` = 3.4, `ϖ` = 0.96e-1, alpha2 = .33, mu = .2041, omega = .5, sigma1 = .72, tau = .33, theta = .9};

{`Πg` = 2.2, `Πu` = 3.4, `ϖ` = 0.96e-1, alpha2 = .33, mu = .2041, omega = .5, sigma1 = .72, tau = .33, theta = .9}

(2)

``

# what are you trying to plot?

eval(eig, remove(has, params, varpi));

1.149763188, 5.948820737

(3)

# two ways :
#  1/ plot these 2 quantities

plot([eval(eig, remove(has, params, varpi))], varpi = 0 .. .5, filled = true, thickness = 4, color = [blue, red], transparency = .4);

 


#  2/ plot only the last one

plot(eval(eig, remove(has, params, varpi))[2], varpi = 0 .. .5, filled = true, thickness = 4, color = blue, transparency = .4);

 

 


 

Download graph_mmcdara.mw Issues
(1) After running the code the behavior of the graph i observed is not the same as the one you plotted (using the same variable values). What could be the reason?
(ii) Pig means (One of the variables in Params Pig against varpi), that is, plotting two variables (in Params) against each other. Thanks

@mmcdara thanks for your effort. Please can you plot Pig against sigma1 (I mean two parameters against each other and not against eig)

@acer Thank you very much for the job well done

@mmcdara I thank you very much for the job well done

@mmcdara Oh I'm very sorry. Your contribution have been very useful to me and the scientific community. I'm gonna get the new version soonest to handle the graphs. ***my question really is how to obtain the stationary points of the new matrixPP since the method you earlier use cannot handle that. Thanks

@mmcdara 
Thanks so far. I have re-evaluated the transtion martrix (PP). The graph obtained is given.
(1)The stationary values are to be obtained since the former method for 2 states cannot work for this
(2) The long term analysis and other statistical analysis are needed to be performed
The work sheet is attached below the graph


re-markov.mw

@mmcdara 
Thanks for your good effort so far. Questions
(1) Since the problem reduces to a two state problem. How can one predict/simulation which of the states will likely prevail or extinct?
(2) You proposed a method for the two state problem, what is the name of the analytical method?
 

@mmcdara Thank you very much for the effort.

@itsme thanks very much

@dharr Thanks very much. The code now runs well.
The last question is that how do i limit the colors of the parametric solution in the last graph to 4 colors only (Red, Blue, Black, Purple)


The sheet is attachedMal_simulation.mw

@Carl Love 
Thanks, i have balanced the parenthesis and still got an error
''Error, (in dsolve/numeric/DAE/make_proc) number of unknown functions and equations must match, got 14 functions {Ia, Ib, If, Ij, Ik, Il, Ima, Imo, Rm, Roc, Rom, Sa, Sb, Sm}, and 13 equations''
The sheet is attached.Mal_simulation.mw

 

@dharr thanks for your effort. One more thing,
Since "eigs := 3.482540032*10^(-7), -3.482540032*10^(-7)", I need to extract a table of results from the plot, which goes thus,
at "\betahh = 0, eigs = ?"
    "\betahh = 0.1.., eigs = ?"
    .................till \betahh = 1.., eigs = ?"

Please a table of results is needed

@acer I have properly corrected the series and included the parameter values for 2D plots attached
Seriess.mw

@acer oh I checked my book and discovered that the numerator was a mistake. It should be gamma (1).

@acer ok I got you better

(1) gamma 1 should take 1. (Gamma 1=1) and 

(2) tau should take 0.2 (tau= 0.2) 

thanks

1 2 3 4 5 6 Page 1 of 6