i have to create a script for this problem but i keep getting an error. Why?
%prompt the user to enter the fluid velocity
velocity = input('Enter the velocity of fluid in m/s: ');
%prompt the user to enter the kinematic viscosity
kinematic_viscosity = input('Enter the kinematic viscosity in m/s^2 : ');
%prompt the user to enter the conduit diameter
conduit_diameter = input('Enter the diameter of conduit in m: ');
%compute the Reynolds number
Re = (velocity*conduit_diameter)/kinematic_viscosity;
%display the Reynolds number
fprintf('The Reynolds number = %f\n',Re);
%if Reynolds number is less than 2000, then flow is laminar
if(Re < 2000)
disp('Laminar flow');
%if Reynolds number is greater than 4000, then flow is turbulent
elseif(Re > 4000)
disp('Turbulent');
%otherwise if the Reynolds number is between 2000 and 4000, flow is transitional range
else
disp('Transitional Range');
end

4 Kommentare

darova
darova am 5 Mär. 2020
Please show the error
John D'Errico
John D'Errico am 5 Mär. 2020
Show the COMPLETE error, that is, everything written in red. Otherwise, we cannot know where you are going wrong. Note that much of the time, a novice user simply does not even know how to save an m-file. If you tell us the complete error you got, then we can see where the problem lies.
Ankit
Ankit am 5 Mär. 2020
Based on your written code, you will get output for the above mentioned 3 cases. As mentioned by others please post the error you are facing
Srivardhan Gadila
Srivardhan Gadila am 9 Mär. 2020
@Liam Sullivan can you provide the error you are getting?

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Simscape Fluids finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 4 Mär. 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by