Question

In: Advanced Math

1) Use MATLAB to solve this differential equation. ??/?? = .25? (1 − ?/4 ) -...

1) Use MATLAB to solve this differential equation. ??/?? = .25? (1 − ?/4 ) - a

2) Use MATLAB to graph solution curves to this system with several different initial values. Be sure to show at least one solution curve for each of the scenarios found in ??/?? = .25? (1 − ?/4 ) - a ( let a = 0.16)

Solutions

Expert Solution

MATLAB Code:

close all
clear
clc

% Part 1
syms p(t)
a = 0.16;
Dp = diff(p, t); % dp/dt
ODE = Dp == 0.25*p*(1 - p/4) - a; % Given ODE
p_sol = dsolve(ODE); p_sol = p_sol(3); % ODE Solver
fprintf('General Solution, p(t) = '), disp(p_sol)

% Part 2
p_sol_1 = dsolve(ODE, p(0) == 1); % Solve with initial condition p(0) = 1
t = 0:0.01:50;
p_sol_1_vals = subs(p_sol_1, t); % Evaluate the solution at different time values
figure, hold on
xlabel('t'), ylabel('p(t)'), title('Solution of ODE using different initial values')
plot(t, p_sol_1_vals)

p_sol_2 = dsolve(ODE, p(0) == 2); % Initial condition p(0) = 2
p_sol_2_vals = subs(p_sol_2, t);
plot(t, p_sol_2_vals)

p_sol_3 = dsolve(ODE, p(0) == 10); % Initial condition p(0) = 10
p_sol_3_vals = subs(p_sol_3, t);
plot(t, p_sol_3_vals), hold off
legend('p(0) = 1', 'p(0) = 2', 'p(0) = 10')

Output:

General Solution, p(t) = (4*exp(60*C2 - (3*t)/20) - 16)/(5*(exp(60*C2 - (3*t)/20) - 1))

Plot:


Related Solutions

solve the differential equation a) ? ′′ − ? ′ = 1 1 + ? −?...
solve the differential equation a) ? ′′ − ? ′ = 1 1 + ? −? b) ? ′′ + 3? ′ + 2? = cos(?x ) c) 10) ? ′′ − 2? ′ + ? = exsqrtx
This is a Matlab Question Create MATLAB PROGRAM that can solve First Order Linear Differential Equation...
This is a Matlab Question Create MATLAB PROGRAM that can solve First Order Linear Differential Equation ( 1 example contains condition and the other does not have condition). 1. ty′ + 2y = t^2 − t + 1, y(1)=12 The correct answer is y(t) = 1/4 t^2 − 1/3 t + 1/2 + 1/12t^2 2. (x-1) dy/dx + 2y = (x+1)^2 The correct answer is y = (x(x+1) / x-1 ) + C(x+1) / x-1 The correct answer is
Use Laplace transforms, solve the differential equation y'' + 16y = 4 sin 4? , where...
Use Laplace transforms, solve the differential equation y'' + 16y = 4 sin 4? , where y(0)=2.    y′(0)=0.
Consider the differential equation x′=[2 4 -2 −2], with x(0)=[1 1] Solve the differential equation where...
Consider the differential equation x′=[2 4 -2 −2], with x(0)=[1 1] Solve the differential equation where x=[x(t)y(t)]. x(t)= y(t)= please be as clear as possible especially when solving for c1 and c2 that's the part i need help the most
Solve the differential equation by variation of parameters. y'' + 3y' + 2y = 1 4...
Solve the differential equation by variation of parameters. y'' + 3y' + 2y = 1 4 + ex y(x) =
Use the Euler method to solve the following differential equation for the domain [2,2.5]. Use the...
Use the Euler method to solve the following differential equation for the domain [2,2.5]. Use the step-size ℎ = 0.1. ?′=?ln?/? ;?(2)=?1 b) Use the third order Taylor series method to find ?(0.1) and ?(0.2), where ?′=1+2?? ;?(0)=0. Use the step-size ℎ=0.1. c) Solve the problem in part (ii) using the fourth order Runge – Kutta method. d) Solve the problem in part (ii) using the Predictor – Corrector method.
Solve the given differential equation by undetermined coefficients. y'' − y' + (1/4) y = 6...
Solve the given differential equation by undetermined coefficients. y'' − y' + (1/4) y = 6 + e^(x/2)
Solve this differential equation using Matlab yy' + xy2 =x , with y(0)=5 for x=0 to...
Solve this differential equation using Matlab yy' + xy2 =x , with y(0)=5 for x=0 to 2.5 with a step size 0.25 (a) Analytical (b) Euler (c) Heun d) 4th order R-K method Display all results on the same graph
Solve using the same approach as the solution using Matlab for this differential equation d^2y/dt^2 +...
Solve using the same approach as the solution using Matlab for this differential equation d^2y/dt^2 + 6dy/dt + 9y = cos(t) has initial conditions y(0)=1 y'(0)=2, Find Y(s) and without finding y(t), determine what function of time will appear in the solution %} clear, clc syms Y s t real rhs = laplace(cos(t),t,s) eqn1 = s^2*Y - s*2 - 1 + 6*s*Y -1 + 9*Y ==rhs myanss = solve(eqn1,Y) mypart = partfrac(myanss,'FactorMode','real') %{ mypart = (0.08*s + 0.06)/(s^2 + 1.0)...
convert differential equation to a matrix differential equation? can put an example and solve it.
convert differential equation to a matrix differential equation? can put an example and solve it.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT