Professional Documents
Culture Documents
Experiment:6: % Initial Temperature at T 0 % Temperature After T 20 Minutes % Room/ Ambient Temperature
Experiment:6: % Initial Temperature at T 0 % Temperature After T 20 Minutes % Room/ Ambient Temperature
plot(t,T,'--b')
xlabel('Time t');
ylabel('Body Temperature T(t)');
grid on
function Tprime=Newton_Starbucks(t,T)
T0=80;
T20=60;
TR=40;
1
k=(1/20)*log((T0-TR)/(T20-TR));
T_ambient=TR;
Tprime=-k*(T-T_ambient);
end
2
2.
clear all
clc
syms x(t)
ode=diff(x,t)==2000*exp(2*t/5);
cond=x(0)==5200;
xsol(t)=dsolve(ode,cond);
n=7;
Population_Size=subs(xsol(t), t,n)
Population_Size =
1
3.
f = [-3; -4;]
f = 2×1
-3
-4
A = [ 1 2
3 2];
b = [8; 12;];
lb = zeros(2,1);
%Next, call a linear programming routine.
options = optimset('Display', 'iter');
[x,fval] = linprog(f,A,b,[],[],lb,[],[],options)
LP preprocessing removed 0 inequalities, 0 equalities,
0 variables, and added 0 non-zero elements.
2
3