logo

MA209 Mathematics Homework Assignment

   

Added on  2022-08-19

11 Pages1197 Words14 Views
 | 
 | 
 | 
Running head: MA209 HOMEWORK 2
MA209 HOMEWORK 2
Name of the Student
Name of the University
Author Note
MA209 Mathematics Homework Assignment_1

MA209 HOMEWORK 21
Question 1:
a) dy/dt = (y-2)(y-5), y(0) = 0
=> dy/((y-2)(y-5)) = dt
=> (1/3)((y-2)-(y-5))dy/((y-2)(y-5)) = dt
=> 1
3 ( ( y2 ) ( y5 ) ) dy
( y2 ) ( y5 ) =dt
=> 1
3 1
y5 d ( y5 ) 1
3 d ( y 2 )
y2 = dt
=> (1/3)ln(y-5) – (1/3)ln(y-2) = t + ln(c)
=> (1/3)ln((y-5)/c(y-2)) = t
=> y 5
c ( y 2 ) =exp ( 3 t )
Now, putting initial value y(0) = 0
-5/(c*(-2)) = 1
c = 5/2
Hence, the solution is
y5
( 5
2 ) ( y2 )
=exp ( 3 t )
y-5 = ( 5 y
2 )exp (3 t )5 exp (3 t)
y(1-(5/2)exp ( 3 t )) = 5 - 5 exp ( 3t )
y = 10 ( 1exp ( 3 t ) )
25 exp ( 3 t ) = 10 ( exp (3 t )1 )
2exp (3 t)5 = 10 ( 1exp (3 t ) )
52 exp (3 t)
MA209 Mathematics Homework Assignment_2

MA209 HOMEWORK 22
Hence, option (iii) is correct.
b)
The generalized Heun’s algorithm is implemented in MATLAB as given below.
MATLAB code:
function [t,y] = q1_1805342(T,N)
func = @(t,y) (y-2)*(y-5);
t = linspace(0,T,N+1);
h = t(2) - t(1);
y(1) = 0;
for i=1:length(t)-1
y(i+1) = y(i) + (h/2)*(func(t(i),y(i)) + func(t(i+1),y(i) + h*func(t(i),y(i)))); % Modified
Euler's method or Heun's Algorithm with alpha = 1/2
end
end
c)
Now, for finding the N a MATLAB function is written where error tolerance is taken as input
and the minimum N for reaching below that tolerance and the step size is displayed.
i)
[N,h] = q1c(1e-2)
N =
MA209 Mathematics Homework Assignment_3

MA209 HOMEWORK 23
188
h =
0.0535
Hence, the value of N = 188.
ii)
[N,h] = q1c(1e-4)
N =
1734
h =
0.0058
iii)
Now, when h = 0.0535 then err <~ 0.02
h^3 = 1.5313e-04
err = K*1.5313e-4
K = 130.608
when h = 0.0058 then err <~ 1e-4.
h^3 = 1.9511e-07
err = K*1.9511e-07
K = 512.5314
Hence, as K < 1000 hence, modifier Euler is O(h^3) accurate.
MA209 Mathematics Homework Assignment_4

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Numerical Methods for Differential Equations
|36
|2092
|215

MENG 438 Engineering Analysis
|18
|1459
|84

Engineering and Computing
|19
|2788
|110