MATLAB HELP 3. (a) In one window, graph four different solutions to y 00 + 10y 0 + y = sin t by using different initial conditions. (Be sure that all four graphs are clearly visible in the window.) (b) Describe the apparent behavior of the solutions as t → ∞.
4. (a) Graph solutions to y 00 + a y = sin 3t, y(0) = 1, y 0 (0) = 1 for each of the values a = 9.5, 9.25, 9.125, and 9. (b) Which equation (if any) shows resonance? (Hint: You may need to change the range for x to see the full behavior of each solution.)
%%Matlab code for solving ode
clear all
close all
%Answering question 3
%1st Initial conditions for ode
y0=[1;0];
%minimum and maximum
time span
tspan=[0 50];
%Solution of ODEs using
ode45 matlab function
sol= ode45(@(t,y)
odefcn(t,y), tspan, y0);
%Equally splitting
time
t1 =
linspace(tspan(1),tspan(end),1001);
%x is the corresponding
value for x(1) and x(2)
yy1 =
deval(sol,t1);
%plotting y1(t) vs t for
initial condition
%y(0)=1;
dy(0)/dt=0;
figure(1)
hold on
plot(t1,yy1(1,:),'Linewidth',2)
title('Plot for x(t) vs.
t')
xlabel('time')
ylabel('y(t)')
box on
%2nd Initial conditions for ode
y0=[0;1];
%minimum and maximum
time span
tspan=[0 50];
%Solution of ODEs using
ode45 matlab function
sol= ode45(@(t,y)
odefcn(t,y), tspan, y0);
%Equally splitting
time
t1 =
linspace(tspan(1),tspan(end),1001);
%x is the corresponding
value for x(1) and x(2)
yy1 =
deval(sol,t1);
%plotting y1(t) vs t for
initial condition
%y(0)=0;
dy(0)/dt=1;
plot(t1,yy1(1,:),'Linewidth',2)
title('Plot for x(t) vs.
t')
xlabel('time')
ylabel('y(t)')
box on
%3rd Initial conditions for ode
y0=[0.5;0.5];
%minimum and maximum
time span
tspan=[0 50];
%Solution of ODEs using
ode45 matlab function
sol= ode45(@(t,y)
odefcn(t,y), tspan, y0);
%Equally splitting
time
t1 =
linspace(tspan(1),tspan(end),1001);
%x is the corresponding
value for x(1) and x(2)
yy1 =
deval(sol,t1);
%plotting y1(t) vs t for
initial condition
%y(0)=0.5;
dy(0)/dt=0.5;
plot(t1,yy1(1,:),'Linewidth',2)
title('Plot for y(t) vs.
t for question 3.')
xlabel('time')
ylabel('y(t)')
box on
%4th Initial conditions for ode
y0=[-1;-1];
%minimum and maximum
time span
tspan=[0 50];
%Solution of ODEs using
ode45 matlab function
sol= ode45(@(t,y)
odefcn(t,y), tspan, y0);
%Equally splitting
time
t1 =
linspace(tspan(1),tspan(end),1001);
%x is the corresponding
value for x(1) and x(2)
yy1 =
deval(sol,t1);
%plotting y1(t) vs t for
initial condition
%y(0)=0.5;
dy(0)/dt=0.5;
plot(t1,yy1(1,:),'Linewidth',2)
title('Plot for y(t) vs.
t for question 3.')
xlabel('time')
ylabel('y(t)')
box
on
legend('y(0)=1;
dy(0)/dt=0','y(0)=0; dy(0)/dt=1',...
'y(0)=0.5; dy(0)/dt=0.5','y(0)=-1; dy(0)/dt=-1')
fprintf('For Question
3.\n')
fprintf('At t tends to
infinity it will be oscillating with as sin(t).\n')
%Answering question 4.
%1st Initial conditions for ode
y0=[1;1];
a=[9.5 9.25 9.125 9];
for ii=1:length(a)
%minimum and maximum
time span
tspan=[0 150];
%Solution of ODEs using
ode45 matlab function
sol= ode45(@(t,y)
odefunc(t,y,a(ii)), tspan, y0);
%Equally splitting
time
t1 =
linspace(tspan(1),tspan(end),1001);
%x is the corresponding
value for x(1) and x(2)
yy1 =
deval(sol,t1);
%plotting y1(t) vs t for
initial condition
%y(0)=1;
dy(0)/dt=0;
figure(ii+1)
plot(t1,yy1(1,:),'Linewidth',2)
title(sprintf('Plot for
y(t) vs. t for a=%2.2f',a(ii)))
xlabel('time')
ylabel('y(t)')
box on
end
fprintf('\tFor question 4. a=9 shows resonance.\n')
%-----------------------------------------------------------------%
%Function for evaluating the ODE for question 3.
function dydt = odefcn(t,y)
eq1 = y(2);
eq2 = -y(1)-10*y(2)+sin(t);
%Evaluate the ODE for our present problem
dydt = [eq1;eq2];
end
%-----------------------------------------------------------------%
%-----------------------------------------------------------------%
%Function for evaluating the ODE for question 4.
function dydt = odefunc(t,y,a)
eq1 = y(2);
eq2 = -a*y(1)+sin(3*t);
%Evaluate the ODE for our present problem
dydt = [eq1;eq2];
end
%-----------------------------------------------------------------%
MATLAB HELP 3. (a) In one window, graph four different solutions to y 00 + 10y 0 + y = sin t by using different initial...
MATLAB HELP (a) Use the command dsolve to find general solutions to the differential equations below. i. y 00 + 3y = 0 ii. y 00 + 4y 0 + 29y = 0 iii. y 00 − y/36 = 0 iv. y 00 + 2y 0 + y = 0 v. y 00 + 6y 0 + 5y = 0 (b) Graph each of the solutions in (a) in the same window with 0 ≤ t ≤ 10, using the...
solve in matlab please Draw the phase line for ay-ay(y2-1)(2+y), α > 0 and then using Matlab Problem 1 : graph the solution for different initial conditions. Once you complete that, double the value of α and see what happens. Draw the phase line for ay-ay(y2-1)(2+y), α > 0 and then using Matlab Problem 1 : graph the solution for different initial conditions. Once you complete that, double the value of α and see what happens.
Need some help on these 4. 1 is a fill-in the blank, pictures 2&3 are for the same problem- I need help finding the max. y-value. Pic 4 I need help choosing the correct statements that describe that graphs function as well as the last one. How can the unit circle be used to construct the graph of f(t) - sin(t)? if you think of t as an angle measure in the unit circle then fit) will be the y-coordinate...
Conductivity of Solutions For Che 2A at RCC Introduction Electrolytes are compounds which conduct electricity when dissolved in water. Strong electrolytes consist of ionic compounds which dissociate completely when dissolved in water, AND molecular compounds which completely ionize when dissolved in water. The reactions below illustrate the dissociation reaction of strong electrolytes: Na (aq) + Cl(aq) но NaCl(s) H30 CaBra(s) HO HCl(e) Ca(aq) + 2Br (aa) H*(aq) + C'(aq) Conductivity is a measure of the ability of water to pass...
just one example/demonstration! Data needed to be calculated is in highlighted in green boxes. And I highlighted in red an equation (not sure if thats what you use to calculate it) And ignore the lab instructions on completeing a graph!! I already know how to do that in excel, just curious how Ln (relative rate) and 1/T in K^-1 is calculated by hand* here is the rest of that lab leading up to the question as I know its typically...