Code: populationestimator.m
clc clear t0 = 1950; p0 = 2555; tEnd = 2000; h = 10; N = (tEnd - t0)/h; %% Initializing solution t = [t0:h:tEnd]'; p = zeros(N + 1, 1); p(1) = p0; %% Ploting given data pg = [2555 3040 3708 4454 5276 6079]; plot(t, pg, 'ko'); hold on %% Solving using Euler's Explicit Method for i = 1:N fi = funp(t(i), p(i)); p(i + 1) = p(i) + h*fi; end plot(t, p, 'r-'); legend('given data', 'simulation result');
Code: funp.m
function dp = funp(t, p)
kgm = 0.026;
pmax = 12000;
dp = kgm * (1 - p/pmax)*p;
end
Output:
Solve the following utilizing MATLAB code. must provide the inputs and outputs of the function. the function should be able to solve such problem using Eulers method, in which after solving must p...