Jump to content



Featured Articles

Check out the latest featured articles.

File Library

Check out the latest downloads available in the File Library.

New Article

Product Viscosity vs. Shear

Featured File

Vertical Tank Selection

New Blog Entry

Low Flow in Pipes- posted in Ankur's blog

0

Pbr Pressure Drop Matlab


No replies to this topic
Share this topic:
| More

#1 Rachel Tee

Rachel Tee

    Junior Member

  • Members
  • 11 posts

Posted 24 February 2021 - 11:20 AM

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.





Similar Topics