Download as pdf or txt
Download as pdf or txt
You are on page 1of 32

1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.

jl

Answerbook
Candidate no. 276299
1 begin
2 using LinearAlgebra,PlutoUI,Pluto, Distributions, Interact, Plots,
DifferentialEquations, Symbolics
3 end

Selection deleted

localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 1/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl

Table of Contents
Answerbook
Candidate no. 276299

Question 1
Part (a)
Part (b)
Part (c)
Part (d)
Part (e)
Part (f)
Part (g)

Question 2
Part (a)
Part (b)
Part (c)
Part (d)

Question 3
Selection deleted
Game 1
Game 2

Question 4
Part (a)
Part (b)
Part (c)
Part (d)
Part (e)
Part (f)
Part (g)
Part (h)
Part (i)

Question 5
Part (a)
Part (b)
Part (c)
Part (d)
Part (e)
Part (f)

localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 2/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl

Question 1

Part (a)
my_transf (generic function with 1 method)
1 # (a) Defining my_transf(A)
2
3 function my_transf(A)
4 A_transpose = transpose(A) #transpose of matrix A
5 sum_matrix = A + A_transpose #sum
6 return sum_matrix
7 end

Part (b)
eigprod (generic function with 1 method)
1 # (b) Defining eigprod(A::Matrix,i::Number,j::Number)
Selection
2 deleted
3 function eigprod(A::Matrix, i::Number, j::Number)
4 eigenvalues, eigenvectors = eigen(A)
5 eigenvec_i = eigenvectors[:, i]
6 eigenvec_j = eigenvectors[:, j]
7 dot_product = dot(eigenvec_i, eigenvec_j)
8 return dot_product
9 end

Part (c)
5
1 # (c) Creating a 4x4 Matrix using a normal distribution
2 begin
3 μ = 10 #mean
4 σ = 5 #standard deviation
5 end

A = 4×4 Matrix{Float64}:
16.9724 5.75398 6.3386 0.497352
16.1124 16.2369 11.1407 5.06605
9.04005 7.42089 13.351 1.30722
8.33227 5.19501 11.9601 14.2458
1 A = μ .+ σ * rand(Normal(), 4, 4)

localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 3/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl
-1.6653345369377348e-16
1 begin
2 i = 2
3 j = 3
4 partc = eigprod(my_transf(A), i, j)
5 end

PART (c): -1.6653345369377348e-16

The answers are almost close to zero. This may show that the eigenvectors are nearly orthogonal or
close to perpendicular to each other. If the dot product is zero, the eigenvectros are interpreted to be
perpendicular.

Part (d)
[-0.319736+0.0im, 0.234666+0.0im, -0.0409907+0.0im, 0.917072+0.0im]
1 begin
2
3 eigenvalues, eigenvectors = eigen(A)
4 eigenvec_i = eigenvectors[:, i]
Selection
5 deleted
eigenvec_j = eigenvectors[:, j]
6
7 vi = transpose(eigenvec_i)
8 vj= eigenvec_j
9 end

4×4 Matrix{Float64}:
0.0 10.3585 2.70145 7.83492
-10.3585 0.0 -3.7198 0.128961
-2.70145 3.7198 0.0 10.6529
-7.83492 -0.128961 -10.6529 0.0
1 begin
2 A_transpose = transpose(A)
3 sub= A_transpose - A
4 end

partd = 2.5459671863987667 + 1.7540483520627983im


1 partd = vi * sub * vj

2.5459671863987667 + 1.7540483520627983im
1 partd

1 println("PART (d): ", partd)

PART (d): 2.5459671863987667 + 1.7540483520627983im

localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 4/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl

This complex result implies a non-zero value with both real and imaginary components, indicating
that the operations performed on these vectors and matrices have led to a result that's not purely
real.

Part (e)
1 begin
2
3 v1 = eigenvectors[:, 1] # assuming v1 is the first eigenvector obtained
4
5 #extarcting eigenvectors
6 vn = eigenvectors[:, 2:end]
7
8 g = randn(size(vn, 2))
9
10 # calculating the weighted sum
11 weighted_sum = vn * g
12
13
14 dotprod = dot(v1, weighted_sum)
15
16 # checking if the dot product is approximately zero
17 if isapprox(dotprod, 0.0)
Selection
18 deleted
println("v1 is linearly dependent on the other eigenvectors.")
19 else
20 println("v1 is linearly independent on the other eigenvectors.")
21 end
22
23 end

v1 is linearly independent on the other eigenvectors.

Part (f)
The linear independence of all eigenvectors is a crucial property in determining the dimension of the
vector space spanned by these eigenvectors. In this case, if all the eigenvectors v1, v2 ...v3 are linearly
independent, the dimension of the vector space they span will be equal to the number of linearly
independent eigenvectors.

localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 5/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl

Part (g)
The 3 vectors are :

These vectors will form a basis of if and only if they are linearly independent. This means that
the only solution to:

is .

Reference: https://medium.com/swlh/how-to-understand-linear-independence-linear-algebra-
8bab1d918509

In matrix form;
Selection deleted

The determinant of the matrix is:

Simplifying;

Double angle formula;

Using the formula in equation 1;

The three vectors will form basisof if the determinant is non-zero. This would imply that the
vectors are linearly independent.

localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 6/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl

The determinant will be zero if . This means the value of must not be an odd multiple
of since

Question 2

Part (a)
The overuse and factory faults are given by;

The probability of CPT surviving the first 100 months without a fault can be expressed as;

Solving the above equation yields;


Selection deleted
1 begin
2 answer = remain_prob()
3 println("P(S): ", answer)
4 end

P(S): 0.5591545797410881

remain_prob (generic function with 1 method)


1 function remain_prob()
2 p_overuse = [0.0001 * t^2 / (1 + t) for t in 1:100]
3 p_factory = [0.01 * (1 + (1 - t) / (1 + t)) for t in 1:100]
4 p_survive = 1 .- p_overuse .- p_factory #element-wise subtraction
5 return prod(p_survive)
6 end

localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 7/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl

Part (b)
The overuse and factory faults are given by;

The plot below shows simulated results from the function factory_simulation . The function
calculates faults based on the probability formulas and , removes the faulty CPTs each
month, and stores the remaining functioning units in the vector .

Selection deleted

localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 8/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl

1 begin
2 function factory_simulation(n0)
3 n = n0 #number of functioning cpts
4 v = Vector{Int64}(undef, 100)
5
Selection deleted
6 for t in 1:100
7 p_overuse = 0.0001 * (t^2)/(1+t)
8 p_factory = 0.01 * (1 + (1-t)/(1+t))
9 faults = rand(Binomial(n, p_overuse + p_factory), 1)[1]
10
11 n = n - faults
12 v[t] = n
13 end
14 scatter(1:100, v, xlabel="Month", ylabel="Functioning CPTs", ylims=(0,n0),
label=false)
15 end
16
17 factory_simulation(300)
18 end

localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 9/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl

Part (c)
The overuse and factory faults are given by;

After investment, the probabilitiy of the above faults becomes,

Below is the Code block for function profit(x,y) that calculates the expected profit for 100 items if
are invested in reducing factory faults, and are invested in reducing overuse faults.

profit (generic function with 1 method)


1 begin
Selection
2 deleted
3 function profit(x, y)
4
5 po_i(t) = max(1 - 20y, 0) * 0.0001 * t^2 / (1 + t)
6 pf_i(t) = max(1 - 20x, 0) * 0.01 * (1+(1-t)/(1+t))
7
8 C = 10 # cost per fault
9 R = 150 # revenue per item
10
11 revenue = 100 * R
12 cost(t) = (pf_i(t) + po_i(t)) * C * 100
13
14 expected_profit = revenue - cost(100)
15
16 return expected_profit
17 end
18 end

localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 10/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl

Part (d)
The maximization the profit function while adhering to the constraint of investing exactly
£10 per CPT in fault reduction can be expressed as;

Total investment per CPT as 10p or £0.1:

Ensuring non-negative investments constraint:

where and are the investments in reducing factory faults and overuse faults respectivey.

To maximize the proit function , the aim is to locate the values and where the
gradient/Jacobian

This condition signifies a stationary point where altering investments in any direction does not
further enhance profit.

Selection deleted

localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 11/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl

Question 3

Game 1
Part (a)
The outcome space consists of the possible values for the two uncertain events:

The box containing the money, which can take values { , , } with equal probability:
The chosen box, which can also take values { , , } with equal probability:

So the full outcome space is all combinations of values for and .

Part (b)
To calculate the expected reward and variance :

Let be the amount of money in the box.


The reward depends on whether the chosen box matches the box with the money :
If
Selection deleted , then (we find the money)
If , then (we don't find the money)
Since each box is chosen with probability ,

Therefore,

For

For

The expected reward is and the variance is .

localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 12/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl

Game 2
Part (c)
With the stick strategy:

Probability of initially choosing the box with money (event 1) is


Probability of initially choosing an empty box (event 2) is
If event 1 occurs, reward i.e we stick with correct initial choice.
If event 2 occurs, reward i.e we stick with incorrect initial choice.
Therefore:

With the swap strategy:

Probability of initially choosing the box with money (event 1) is


Probability of initially choosing an empty box (event 2) is
If event
Selection 1 occurs, reward
deleted i.e we swap from correct to incorrect box.
If event 2 occurs, reward i.e we swap from incorrect to correct box
Therefore:

Part (d)
With K boxes containing money out of N total:

Probability of initially choosing box with money is


Probability of initially choosing incorrect box is

With swap strategy:

If event 1 occurs, reward i.e we swap from correct to incorrect box.


If event 2 occurs, reward i.e we swap from incorrect to correct box
Therefore,

localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 13/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl

The variance will be;

Solving the above equation yields:

Question 4
data = 1001×3 Matrix{Float64}:
0.0 0.825371 0.820219
0.01 1.25126 0.880475
0.02 1.07447 1.19519
0.03 1.14595 1.36702
0.04 0.74069 0.820193
0.05 0.803285 0.802094
0.06 1.04234 0.996427

9.95 0.960251 2.89815
9.96 0.958667 2.57985
9.97 1.14899 2.78071
Selection deleted
9.98 1.09621 3.08052
9.99 0.635545 2.79623
10.0 0.857159 2.38937

parameterise_basic_model (generic function with 1 method)


1 function parameterise_basic_model(p)
2 a,b,c,d = p
3 function model(x,t)
4 N, P = x
5 return[ a*x[1] - b*prod(x);
6 c*prod(x) - d*x[2]
7 ]
8 end
9 return model
10 end

1 basic_model = parameterise_basic_model([1,4,1,4]);

localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 14/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl

Part (a)
To find the maximum predator population for which prey births still outstrip deaths, we need to set
the prey population growth rate equal to zero and solve for the predator population.

Setting and solving for , we get:

Where;

a is the prey birth rate


b is the prey death rate, or in other words; predation rate
Selection deleted
Ratio a/b represents the ratio of prey births to predation

Therefore, the maximum predator population for which prey births still exceed deaths is
.

Part (b)
The predator population is given by:

For the predator population to be shrinking, let .

Rearranging the predator equation:

Where;

c is predator birth rate


d is predator death rate
localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 15/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl

The predator population is shrinking when the predator death rate is greater than the predator birth
rate. In the given model, this happens when .

Part (c)
In the absence of predators ( ), the dynamics of the prey population over time are
governed by the equation:

Solving the first-order diff eq;

Selection deleted

Since this is an exponential function of time, the solution exhibits exponential growth. The rate of
growth is dictated by the parameter . The prey population increases exponentially over time. This is
reasonable in the absence of predators, as prey experience unlimited growth when there are no
predators to control their population.

Part (d)

Setting to find fixed points:

Here;

1.

2.
localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 16/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl

Therefore, the two fixed points are:

1.

2.

The parameter can be interpreted as the maximum prey population size that can exist in the
absence of predators. It is also to be noted that the differential equation yield a solution with no 'a'
parameter, which indicates that the prey growth rate does not increase. This may indicate a state of
equilibrium or stability.

Part (e)
The original model is:

Selection deleted

From the question;

Where and are the number of prey and predators as individual animals.

Using the chain rule:

Now, substitute these into the original equations:

The prey model becomes;

Taking as common on both sides, the equation becomes;

localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 17/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl

The predator model becomes;

Simplifying, by taking as common on both sides;

Therefore, in terms of the new variables and , the updated basic model becomes:

Part (f)
Selection deleted

localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 18/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl

(1001, 2)
1 begin
2
3 function simulation(p)
4
5 preybirth_r,predation_r,predatorbirth_r,predatordeath = p
6
7 function predpreyrelation(du,u,parameter,t)
8 x, y = u
9 du[1] = preybirth_r*x - predation_r*x*y
10 du[2] = predatorbirth_r*x*y - predatordeath*y
11 end
12
13 trange = (0.0,10.0)
14 init = [1,1] #initialising population
15
16 t = range(trange[1],stop=trange[2],length=1001)
17
18 prob = ODEProblem(predpreyrelation,init,trange,p)
19
20 solution = solve(prob)
21
22 predpreyrelation= hcat(solution(trange[1]:0.01:trange[2])...)
23 #populations = hcat(sol(t)...)' #Reference
https://discourse.julialang.org/t/hcat-with-matrices-as-elements/59817
24 return predpreyrelation'
25 end
Selection deleted
26
27 p = [1,2,3,4]
28 population_size = simulation(p)
29
30 @show size(population_size)
31
32 end

size(population_size) = (1001, 2)

population = 1001×2 adjoint(::Matrix{Float64}) with eltype Float64:


1.0 1.0
0.99015 0.989903
0.980596 0.979622
0.971336 0.969175
0.962366 0.958577
0.953682 0.947844
0.94528 0.936991

0.934403 0.927114
0.926558 0.915976
0.918985 0.904763
0.911678 0.893488
0.904634 0.882163
0.897848 0.8708
1 population= simulation(p)

Part (g)
localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 19/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl
data_convert = 1001×2 Matrix{Float64}:
0.825371 0.820219
1.25126 0.880475
1.07447 1.19519
1.14595 1.36702
0.74069 0.820193
0.803285 0.802094
1.04234 0.996427

0.960251 2.89815
0.958667 2.57985
1.14899 2.78071
1.09621 3.08052
0.635545 2.79623
0.857159 2.38937
1 data_convert= data[:, 2:3]
2 #extracting only 2nd and 3rd column of the original data set, so that the arrays
can be broadcast to a common size.

1 begin
2 function mse(p)
3
4 simulated_data = simulation(p)
5
6 mse_val= sum((data_convert .- population).^2)/size(data_convert,1)
7
8 return mse_val
9 end
10
Selection
11 deleted
parameters = [1, 2, 3, 4]
12 error = mse(parameters)
13
14 println("Mean Squared Error: $error")
15
16 end

Mean Squared Error: 4.506726209415832

Part (h)

localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 20/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl

1 begin
2
3 function gradient(f::Function, x::Vector)
4 n = length(x)
5
Selection deltax = 0.01
deleted
6
7 function diffx(i::Integer)
8 z = zeros(n)
9 z[i] = deltax
10 return z
11 end
12
13 dfdx = zeros(n)
14 for i in 1:n
15 dfdx[i] = (f(x + diffx(i)) - f(x))/deltax
16 end
17 return dfdx
18 end
19
20 function gradient_descent(f, initial_params, stepsize, max_iter)
21 params = initial_params
22 mse_values = Float64[]
23
24 for iter in 1:max_iter
25 grad = gradient(f, params)
26 params -= stepsize * grad
27
28
29 mse_value = f(params)
30 push!(mse_values, mse_value)
31
32
33 if mse_value < mse_values[1] / 3
34 break
35 end

localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 21/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl
36 end
37
38 return params, mse_values
39 end
40
41
42 initial_params = [1, 4, 1, 4]
43 stepsize = 0.01
44 max_iter = 1000
45
46 gradmse(params) = mse(params)
47
48
49 optimized_params, mse_values = gradient_descent(gradmse, initial_params,
stepsize, max_iter)
50
51 simulated_data_at_p0 = simulation(initial_params)
52 simulated_data_at_pend = simulation(optimized_params)
53 scatter_data = data
54
55 p1 = plot()
56 plot!(p1, simulated_data_at_p0[:, 1], label="Simulation at p0")
57 scatter!(p1, scatter_data, label="Data")
58 title!("Comparison at p0")
59
60 p2 = plot()
61 plot!(p2, simulated_data_at_pend[:, 1], label="Simulation at pend")
Selection
62 deleted
scatter!(p2, scatter_data, label="Data")
63 title!("Comparison at pend")
64
65
66 p3 = plot(mse_values, xlabel="Iterations", ylabel="Mean Squared Error",
legend=false)
67 title!("Mean Squared Error over Iterations")
68
69
70 plot(p1, p2, p3, layout=(3, 1))
71
72 d

Part (i)
There can be multiple sets of parameters that can perfectly fit the given data.

If MSE=0, it suggests that the chosen parameter values result in a model that exactly reproduces the
given data.

Other sets can be searched by exploring the parameter space. This can be done by optimisation
techniques.

localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 22/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl

Question 5

Part (a)
The equation is ;

The above equation can be expressed as;

Equating Eq.1 and Eq.2;

Taking to the right side of the equation;

The equivalent, nondimensionalised model is gievn by;

Comparing Eq.3 and Eq.4;

To simplify the above equation,We will employ the given relationships: , ,


,

Equation becomes;

Simplifying by cancelling the common terms

localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 23/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl

Rearranging the above eqaution in terms of ;

Biologically, ρ represents the growth rate of species 2. The factor being in the denominator
indicatesthe inhibitory effect of species 1 on species 2.

The factor controls the population growth rate of species 2. A higher means species 2 has a faster
replication rate and can grow more rapidly.

Part (b)

localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 24/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl

1 begin
2
3 function simulate(du,u,t,param)
4 du[1] = u[1]*(1 - u[1] - a12*u[2])
5 du[2] = rho*u[2]*(1 - u[2] - a21*u[1])
6 end
7
8 a12 = 0.9 # parameters
9 a21 = 1.1
10 rho = 1.6
11 u0 = [0.1, 0.1] #defining initial condition
12 tspan = (0,20)
13
14 diffeq = ODEProblem(simulate,u0,tspan,(a12,rho,a21))
15 sol = solve(diffeq)
16
17 plot(sol, xlabel="τ", ylabel="Population", label=["u1" "u2"],
18 title="Predator-Prey Relation")
19 end

localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 25/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl

Part (c)
If the growth rate is held constant, the species with the lower numerical value for its competition
coefficient or seems to have an advantage and grows to a larger population over time.

For example:

If rho = 1.6 for both species, and = 0.9, = 1.1, then species 1 grow while species 2 declines
since a21 can be interpreted as suppresive effects of species 1 on species 2.

If rho is held at 1.6 again, but = 1.1, = 0.9, then species 2 grows while species 1 declines.

So in other words, all else being equal, the species that is suppressed LESS by its competitor tends to
grow more successfully, since it experiences less negative pressure.

The degree of suppression mediated by and seems to play a key role in the population
dynamics whereas the value of rho facilitates the growth of species 2 from the oberservations.
Therefore, the supressive effects are more important.

localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 26/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl

1 begin
2
3 function simulatec(du,u,t,param)
4 du[1] = u[1]*(1 - u[1] - a12c*u[2])
5 du[2] = rhoc*u[2]*(1 - u[2] - a21c*u[1])
6 end
7
8 a12c = 1.1 # parameters
9 a21c = 0.9
10 rhoc = 1.6
11 u0c = [0.1, 0.1] #defining initial condition
12 tspanc = (0,20)
13
14 diffeqc = ODEProblem(simulatec,u0c,tspanc,(a12c,rhoc,a21c))
15 solc = solve(diffeqc)
16
17 plot(solc,label=["u1" "u2"],legend=:bottomright)
18
19 end

localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 27/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl

Part (d)
Given the differential equations:

For fixed points,setting the derivatives equal to zero:

1. For :

Setting :

This implies either or

2. For :

Setting :

This implies either or

The conditions for the fixed points are:

Solving for the following cases:

Case 1:

If , eq 4 becomes, .

So, the fixed point is and . This means that species 2 survives while species 1 goes
extinct.

Case 2:

localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 28/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl

Eq 2 becomes , which leads to

So, the fixed point is and . This implies that species 1 survives while species 2 goes
extinct

Case 3: and

This represents extinction of both species

Case 4: and

Rearranging eq 2 gives;

Substituting this into Eq 4: :

Solving this equation for :

Rearranging terms:

So,

Therefore, the fixed point is and

localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 29/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl

Part (e)
Given system of differential equations:

Rewriting as;

The Jacobian matrix is of the form:

The partial derivatives are:

Therefore, the Jacobian Matrix can be wirtten as:

localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 30/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl

Part (f)
The Jacobian Matrix is given by:

To figure out the conditions on when the Jacobian matrix has appropriate eigenvalues, we will
calculate the trace and determinant of the jacobian matrix.

1-Trace:

2-Determinant:

Evaluating the Trace and Determinant using the fixed points:

To prove for stability:

The Trace of the Jacobian matrix should be negative for stability.

The determinant of the Jacobian matrix should be positive for stability.

localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 31/32
1/16/24, 2:42 PM 🎈 answerbook.jl — Pluto.jl

localhost:1234/edit?id=29e85990-b45f-11ee-244a-43965294723c# 32/32

You might also like