How to do question B 2,3,4,5?
%%Matlab code for Heun's method
clear all
close all
dt=0.01;
tmax=20;
t=[0:dt:tmax];
N=length(t);
v=zeros(N,3);
v(1,:)=[0 5 -39];
A=[0 1 0;0 0 1;-12 -4 -3];
for i=2:N
K1=dt*A*(v(i-1,:))';
K2=dt*A*((v(i-1,:)+K1'))';
v(i,:)=v(i-1,:)+(K1'+K2')/2;
end
y=v(:,1);
plot(t,y,'Linewidth',2)
%Exact solution
yy=@(tt) -3*exp(-3*tt)+3*cos(2*tt)-2*sin(2*tt);
hold on
plot(t,yy(t),'--')
legend('Heun Method','Exact solution')
title('Solution of y(x) using Heun method')
xlabel('x')
ylabel('y(x)')
grid on
%%%%%%%%%%%%%%%%%% End of Code %%%%%%%%%%%%%%%%%
How to do question B 2,3,4,5? 3. a) Find the solution v ote ordinary diferetinl equation with the initial coditions: b)...
Would someone help me with the last 3 questions here, I got the previous ones but need help with the last 3 in red. Thank you Transcribed: Now that you nd a rst order system of ODEs, you can solve it using the Huens method ac- cording to the material you covered in computational module 2. A template of the code which will help you to get started is also available. Attach the complete code as a pdf page to...
3. a) Find the solution y(t) of the ordinary differential equation with the initial conditions: (Solve it only by hand and show your complete work. Do not use a calculator or any symbolic calu lations). [8 marks b) ) Recast our third order ODE into a system of irst order ODEs of the form A.v, where v' = dv/dr = f(v) and v = (y,y,,y")" . You should show all working to find the corresponding matrix A. Do not solve...
Question 1 QUESTION 2 Use the attached Matlab code as a basis to solve the following ordinary differential equation using Euler's method, with timestep of 0.1, from t-0to t-100. d)0) -0 - sin (5vt cos(у Plot y versus t from t=0 to t=100. How many local maxima are on this interval(do not include end points). Be careful to count them all! Answer should be an integer 1 w% Matlab code for the solution of Module 2 3 dt-9.1; %dt is...
Cosider the second order initial value problem y = y'exp(-3 y) - 2+y+12, 1€ [2,4), y(2) = 3, y' (2) = 1. (a) (1 mark] To convert this into a system of first order ODEs, we introduce *1 = y and *2 = y.Then we obtain the first order system * = 50.0) = (4920:09 where | 12(1,x) fit,x) = x2 f2(t, x) = (Hint: Your expressions should be in terms of t, x] and x2 and should not contain...
1. Solve the initial value problem for a damped mass-spring system acted upon by a sinusoidal force for some time interval f(t) = {10 sin 2t 0 0<t< y(0) 1, y'(0) -5 y"2y' 2y f(t), Tt zusor= 2. Consider two masses and three springs without no external force. The resulting force balance can be expressed as two second order ODES shown as below. mx=-(k k2)x1+ kzx2 m2x2 (k2k3)x2 + k2x1 15 If m 2,m2 ki = 1,k2 = 3, k3...
matlab INSTRUCTIONS Consider the spring-mass damper that can be used to model many dynamic systems Applying Newton's Second Law to a free-body diagram of the mass m yields the following ODE m습+8 +kx=F(t) (1) dt2 Where F() is a forcing function, Consider the case where the forcing function itself is a damped oscillation: Where F F(t)-Ae-Bt COS(wt) (2) For this activity we'll see how we can formulate this ODE for a solution using MATLAB that could be used to study...
Moodle Let B={V, V2, Vz) be a basis for Rin which we have: Question 2 Not yet answered Marked out of 12.00 V1 and vg = 0 - Flag question Also, let TR-R be the linear operator such that: 3 T(v.) T(v2) and T(v2) = X1 Part (a): Find a formula for T X2 X3 X Answer: 7 X2 -0 ag, 912 913 X2 where A=221 22 23 = ха 031 32 33 X2 15 Now let the vector w=...
In this question, you will need to find the general solution to the equation [i 25 0 2 3 8 -1 || *2 (1 4 9 1] | x4 in vector parametric form. The row reduced echelon form of the matrix [i 25 0 | 2 3 8 -1 | 1 4 9 1 -3 5 [1 0 1 0 1 2 | 0 0 0 0 0 1 2 -2 1 The general solution is X= y + xw,...
Problem Set A Problem 6. (20%) A ordinary differential equation for a mass-damper-spring system is following. The mass m 1, damping coetfic e initial position y(o) O, and the initial velocity i constant k 3 and force 10, all are in appropriate units. Th 1, spring zero, within the time range of O to 20 unit of time, use Matlab find the solution of function y(t)? Hint: you need to convert the 2nd order ODE into two 1st order ODEs....
Problem 4. The higher order differential equation and initial conditions are shown as follows: = dy dy +y?, y(0) = 1, y'(0) = -1, "(0) = 2 dt3 dt (a) [5pts. Transform the above initial value problem into an equivalent first order differential system, including initial conditions. (b) [2pts.] Express the system and the initial condition in (a) in vector form. (c) [4pts.] Using the second order Runge Kutta method as follows Ū* = Ūi + hĚ(ti, Ūi) h =...