Hi guys,
I couldn't run the code and I followed the youtube video to write this code out.
Here's the link for the video:
Please help.
function dydW = pbr(W,y)
dydW = zeros (2,1);
%dydW = [X]
% [y]
% y(1) = X
% y(2) = y
eps = -0.15;
kprime = 0.0266;
Fao = 1.08;
alpha = 0.0166;
raprime = kprime*((1-y(1))/(1+eps*y(1)))*y(2);
dydW(1) = raprime/Fao;
dydW(2) = (-alpha/(2*y(2)))*(1+eps*y(1));
end
(W,y) = ode45('pbr',[0,60],[0,1]);
eps = -0.15;
kprime = 0.0266;
raprime = -kprime*(1-y(:,1))/(1+eps*y(:,1))*y(:,2);
f = (1 + eps*y(:,1))/ y(:,2);
rate = -raprime;
subplot(1,2,1)
plot(W, y(:,1),'b',W,y(:,2),'k',W,f,'r')
xlabel('W (kg)');
ylabel('f,x,y');
subplot(1,2,2)
plot(W, rate*100)
xlabel('W (kg)');
ylabel('Rate');
Edited by Rachel Tee, 24 February 2021 - 11:21 AM.