SlideShare a Scribd company logo
1 of 1
Download to read offline
M-File for finding Friction factor using equation
rough = input('Enter Relative Roughness ');
re = input ('Enter Reynolds number ');
fst = 0;
f = 0.008;
while f ~= fst
disp (' Assumed value for trial and error ')
disp (f)
fst = f;
int1 = 2 * log10(1 / rough);
int2 = (9.3 /(re * rough * sqrt(fst)));
int3 = 2 * log10(1 + int2);
int4 = 1.14 + int1 - int3;
f = (1 / int4)^2;
end
disp (' Final value of friction factor ')
f
Programmed by:
Danial Sohail
Mechanical Engineering Department
NED University of Engineering and Technology

More Related Content

More from Danial Sohail

Maintenance Strategy and Activites of Textile Industry (Spinning Mill)
Maintenance Strategy and Activites of Textile Industry (Spinning Mill)Maintenance Strategy and Activites of Textile Industry (Spinning Mill)
Maintenance Strategy and Activites of Textile Industry (Spinning Mill)Danial Sohail
 
Maintenance of Fans, Blowers and Fluidizers
Maintenance of Fans, Blowers and FluidizersMaintenance of Fans, Blowers and Fluidizers
Maintenance of Fans, Blowers and FluidizersDanial Sohail
 
PAKISTAN STEEL MILLS THERMAL POWER PLANT - Technical poster
PAKISTAN STEEL MILLS THERMAL POWER PLANT - Technical posterPAKISTAN STEEL MILLS THERMAL POWER PLANT - Technical poster
PAKISTAN STEEL MILLS THERMAL POWER PLANT - Technical posterDanial Sohail
 
Water cooled minichannel heat sinks for microprocessor cooling: Effect of fin...
Water cooled minichannel heat sinks for microprocessor cooling: Effect of fin...Water cooled minichannel heat sinks for microprocessor cooling: Effect of fin...
Water cooled minichannel heat sinks for microprocessor cooling: Effect of fin...Danial Sohail
 
Graphical Plotting of Psychrometric Chart
Graphical Plotting of Psychrometric ChartGraphical Plotting of Psychrometric Chart
Graphical Plotting of Psychrometric ChartDanial Sohail
 
Analysis of Power Generation Plant at Pakistan Steel Mills
Analysis of Power Generation Plant at Pakistan Steel MillsAnalysis of Power Generation Plant at Pakistan Steel Mills
Analysis of Power Generation Plant at Pakistan Steel MillsDanial Sohail
 
Bearings, their types and application
Bearings, their types and applicationBearings, their types and application
Bearings, their types and applicationDanial Sohail
 
Summer Internship Report (National Engineering Services Pakistan)-2014
Summer Internship Report (National Engineering Services Pakistan)-2014Summer Internship Report (National Engineering Services Pakistan)-2014
Summer Internship Report (National Engineering Services Pakistan)-2014Danial Sohail
 
Why you should quit smoking
Why you should quit smokingWhy you should quit smoking
Why you should quit smokingDanial Sohail
 
Two to four wheeler transformable bike
Two to four wheeler transformable bikeTwo to four wheeler transformable bike
Two to four wheeler transformable bikeDanial Sohail
 

More from Danial Sohail (10)

Maintenance Strategy and Activites of Textile Industry (Spinning Mill)
Maintenance Strategy and Activites of Textile Industry (Spinning Mill)Maintenance Strategy and Activites of Textile Industry (Spinning Mill)
Maintenance Strategy and Activites of Textile Industry (Spinning Mill)
 
Maintenance of Fans, Blowers and Fluidizers
Maintenance of Fans, Blowers and FluidizersMaintenance of Fans, Blowers and Fluidizers
Maintenance of Fans, Blowers and Fluidizers
 
PAKISTAN STEEL MILLS THERMAL POWER PLANT - Technical poster
PAKISTAN STEEL MILLS THERMAL POWER PLANT - Technical posterPAKISTAN STEEL MILLS THERMAL POWER PLANT - Technical poster
PAKISTAN STEEL MILLS THERMAL POWER PLANT - Technical poster
 
Water cooled minichannel heat sinks for microprocessor cooling: Effect of fin...
Water cooled minichannel heat sinks for microprocessor cooling: Effect of fin...Water cooled minichannel heat sinks for microprocessor cooling: Effect of fin...
Water cooled minichannel heat sinks for microprocessor cooling: Effect of fin...
 
Graphical Plotting of Psychrometric Chart
Graphical Plotting of Psychrometric ChartGraphical Plotting of Psychrometric Chart
Graphical Plotting of Psychrometric Chart
 
Analysis of Power Generation Plant at Pakistan Steel Mills
Analysis of Power Generation Plant at Pakistan Steel MillsAnalysis of Power Generation Plant at Pakistan Steel Mills
Analysis of Power Generation Plant at Pakistan Steel Mills
 
Bearings, their types and application
Bearings, their types and applicationBearings, their types and application
Bearings, their types and application
 
Summer Internship Report (National Engineering Services Pakistan)-2014
Summer Internship Report (National Engineering Services Pakistan)-2014Summer Internship Report (National Engineering Services Pakistan)-2014
Summer Internship Report (National Engineering Services Pakistan)-2014
 
Why you should quit smoking
Why you should quit smokingWhy you should quit smoking
Why you should quit smoking
 
Two to four wheeler transformable bike
Two to four wheeler transformable bikeTwo to four wheeler transformable bike
Two to four wheeler transformable bike
 

Recently uploaded

Computer Graphics Introduction, Open GL, Line and Circle drawing algorithm
Computer Graphics Introduction, Open GL, Line and Circle drawing algorithmComputer Graphics Introduction, Open GL, Line and Circle drawing algorithm
Computer Graphics Introduction, Open GL, Line and Circle drawing algorithmDeepika Walanjkar
 
Prach: A Feature-Rich Platform Empowering the Autism Community
Prach: A Feature-Rich Platform Empowering the Autism CommunityPrach: A Feature-Rich Platform Empowering the Autism Community
Prach: A Feature-Rich Platform Empowering the Autism Communityprachaibot
 
multiple access in wireless communication
multiple access in wireless communicationmultiple access in wireless communication
multiple access in wireless communicationpanditadesh123
 
Research Methodology for Engineering pdf
Research Methodology for Engineering pdfResearch Methodology for Engineering pdf
Research Methodology for Engineering pdfCaalaaAbdulkerim
 
DEVICE DRIVERS AND INTERRUPTS SERVICE MECHANISM.pdf
DEVICE DRIVERS AND INTERRUPTS  SERVICE MECHANISM.pdfDEVICE DRIVERS AND INTERRUPTS  SERVICE MECHANISM.pdf
DEVICE DRIVERS AND INTERRUPTS SERVICE MECHANISM.pdfAkritiPradhan2
 
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...Stork Webinar | APM Transformational planning, Tool Selection & Performance T...
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...Stork
 
Artificial Intelligence in Power System overview
Artificial Intelligence in Power System overviewArtificial Intelligence in Power System overview
Artificial Intelligence in Power System overviewsandhya757531
 
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENTFUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENTSneha Padhiar
 
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Sumanth A
 
System Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingSystem Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingBootNeck1
 
CME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTES
CME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTESCME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTES
CME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTESkarthi keyan
 
Engineering Drawing section of solid
Engineering Drawing     section of solidEngineering Drawing     section of solid
Engineering Drawing section of solidnamansinghjarodiya
 
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.pptROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.pptJohnWilliam111370
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxRomil Mishra
 
Module-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdfModule-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdfManish Kumar
 
OOP concepts -in-Python programming language
OOP concepts -in-Python programming languageOOP concepts -in-Python programming language
OOP concepts -in-Python programming languageSmritiSharma901052
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONjhunlian
 
Robotics Group 10 (Control Schemes) cse.pdf
Robotics Group 10  (Control Schemes) cse.pdfRobotics Group 10  (Control Schemes) cse.pdf
Robotics Group 10 (Control Schemes) cse.pdfsahilsajad201
 
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Erbil Polytechnic University
 

Recently uploaded (20)

Computer Graphics Introduction, Open GL, Line and Circle drawing algorithm
Computer Graphics Introduction, Open GL, Line and Circle drawing algorithmComputer Graphics Introduction, Open GL, Line and Circle drawing algorithm
Computer Graphics Introduction, Open GL, Line and Circle drawing algorithm
 
Prach: A Feature-Rich Platform Empowering the Autism Community
Prach: A Feature-Rich Platform Empowering the Autism CommunityPrach: A Feature-Rich Platform Empowering the Autism Community
Prach: A Feature-Rich Platform Empowering the Autism Community
 
multiple access in wireless communication
multiple access in wireless communicationmultiple access in wireless communication
multiple access in wireless communication
 
Research Methodology for Engineering pdf
Research Methodology for Engineering pdfResearch Methodology for Engineering pdf
Research Methodology for Engineering pdf
 
DEVICE DRIVERS AND INTERRUPTS SERVICE MECHANISM.pdf
DEVICE DRIVERS AND INTERRUPTS  SERVICE MECHANISM.pdfDEVICE DRIVERS AND INTERRUPTS  SERVICE MECHANISM.pdf
DEVICE DRIVERS AND INTERRUPTS SERVICE MECHANISM.pdf
 
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...Stork Webinar | APM Transformational planning, Tool Selection & Performance T...
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...
 
Artificial Intelligence in Power System overview
Artificial Intelligence in Power System overviewArtificial Intelligence in Power System overview
Artificial Intelligence in Power System overview
 
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENTFUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
 
Designing pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptxDesigning pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptx
 
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
 
System Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingSystem Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event Scheduling
 
CME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTES
CME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTESCME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTES
CME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTES
 
Engineering Drawing section of solid
Engineering Drawing     section of solidEngineering Drawing     section of solid
Engineering Drawing section of solid
 
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.pptROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptx
 
Module-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdfModule-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdf
 
OOP concepts -in-Python programming language
OOP concepts -in-Python programming languageOOP concepts -in-Python programming language
OOP concepts -in-Python programming language
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
 
Robotics Group 10 (Control Schemes) cse.pdf
Robotics Group 10  (Control Schemes) cse.pdfRobotics Group 10  (Control Schemes) cse.pdf
Robotics Group 10 (Control Schemes) cse.pdf
 
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
 

Moody chart, M-File for finding Friction factor using equation

  • 1. M-File for finding Friction factor using equation rough = input('Enter Relative Roughness '); re = input ('Enter Reynolds number '); fst = 0; f = 0.008; while f ~= fst disp (' Assumed value for trial and error ') disp (f) fst = f; int1 = 2 * log10(1 / rough); int2 = (9.3 /(re * rough * sqrt(fst))); int3 = 2 * log10(1 + int2); int4 = 1.14 + int1 - int3; f = (1 / int4)^2; end disp (' Final value of friction factor ') f Programmed by: Danial Sohail Mechanical Engineering Department NED University of Engineering and Technology