logo

MENG 438 Engineering Analysis

   

Added on  2023-01-23

18 Pages1459 Words84 Views
Running head: MENG 438 Engineering Analysis
MENG 438 Engineering Analysis
Name of the Student
Name of the University
Author Note

1MENG 438 Engineering Analysis
1.
The regression equation of the logistic model is given by,
N(t) = N 0K
N 0+ ( KN 0 ) ert
N0 = Initial population = population at year 1900 = 3589
K = carrying capacity, r = growth parameter.
The logistic model is fitted to Bryan population data from 1900 to 2010 in 10 years interval.
The value of K and r of the best fitted model that is the model with minimum sum of square
error are calculated in MATLAB and then fitted as given below. The change in the objective
function or the logistic equation is below the default value of function tolerance which is
10^(-6) as given in MATLAB.
MATLAB code:
t = 0:10:110; % time t in years from 1900
p = [3589,4132,6307,7814,11842,18072,27542,33141,44337,55002,65660,76201]; %
population of Bryan
N0 = 3589; % specifying initial population N0
fun = @(param,t) (N0*param(1))./((N0 + (param(1) - N0).*exp(-param(2).*t))); % specifying
logistic model
param0 = [1,1]; % initial K and r values are assumed to be 1
lb = [0.01,0.01]; % specifying lower bound for K and r. K>0 and r>0
param_val = lsqcurvefit(fun,param0,t,p,lb,[]); % fitting non-linear logistic model

2MENG 438 Engineering Analysis
sprintf('The values of K = %.4f and r =%.4f which satisfies the least square
fit',param_val(1),param_val(2))
time = linspace(t(1),t(end));
plot(t,p,'ko',time,fun(param_val,time),'b-')
legend('Population','Fitted Logistic model','Location','best')
title('Original Population and Fitted logistic Curve')
xlabel('Time t in years from 1900')
ylabel('Population')
Output:
leastsqrfit
Local minimum possible.
lsqcurvefit stopped because the final change in the sum of squares relative to
its initial value is less than the default value of the function tolerance.
<stopping criteria details>
ans =
'The values of K = 124571.8858 and r =0.0362 which satisfies the least square fit'

3MENG 438 Engineering Analysis
0 20 40 60 80 100 120
Time t in years from 1900
0
1
2
3
4
5
6
7
8
Population
104 Original Population and Fitted logistic Curve
Population
Fitted Logistic model
Hence, the value of carrying capacity K = 124571.8858 and r =0.0362 as calculated above.
2.
Given, differential equation
dx
dt = xt
x2+ t2
Initial condition is x(0) = 1.
f(x,t) = xt
x2 +t2
Euler’s method iteration equation:
x(i+1) = x(i) + h*f(t(i),x(i))
Modified Euler Method iteration equation:

End of preview

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

Related Documents
MA209 Mathematics Homework Assignment
|11
|1197
|14

Engineering and Computing
|19
|2788
|110

MODELLING AND SIMULATION OF ENGINEERING
|10
|1536
|67

Stochastic Volatility Model and Option Pricing Methodology
|15
|3405
|413

Applied Statistics
|23
|3217
|47

Derivatives Coursework: Regression, Black-Scholes-Merton Formula, and Strategies
|32
|6924
|137