Program that uses fsolve() to find volumetric flow rate

Assignment Help Python Programming
Reference no: EM132813882

MAE 3403 Computer Methods in Analysis and Design - Oklahoma State University

You will be writing three different Python programs in three different files named hw5a.py, hw5b.py and hw5c.py. You will place your files in a folder named HW5 and then zip the folder and upload it to Canvas.

In this assignment, you must use variables, loops, if statements, your own function definitions and function calls. For now, you may not use any of the powerful functions available in python modules, with a few exceptions: You may import functions from the math, copy, matplotlib.plot, numpyand scipy.

a.) A pipe network problem: Write a program that uses FSOLVE() to find the volumetric flow rate (m3/s) of water in each segment of the pipe flow network given below.

Use the following properties:
waterdensity = 1000 kg/m3
waterviscosity = 0.00089 N⋅s/m2
pipe roughness = 0.00025 m.

Your program should print the flow in each segment of pipe, nicely formatted, similar to:
The flow in segment a-b is -0.0052 m3/s
The flow in segment a-c is 0.0272 m3/s
The flow in segment d-g is -0.0142 m3/s
etc.
Notes:
Pressure decreases in direction of flow (e.g.,ΔP_(a→b)={(<0 if flow a→b

                                                                            {>0 if flow b→a))

The head loss around a pipe loop is zero. (e.g.,ΔP_(a→b)+ΔP_(b→e)-ΔP_(d→e)-ΔP_(c→d)-ΔP_(a→c)=0)
Mass is conserved at each node. ∑_i(mi) ? =0
Pressure loss in a pipe is calculated with the Darcy-Weisbach equation: Δp=f L/D (ρV2)/2
Darcy friction factor is calculated by the Colebrook equation: 1/√f=-2.0log((e\/D)/3.7+2.51/(Re√f))

1459_figure.jpg

b. Write a program that uses FSOLVE() to solve the Rolling Wheel Dynamics - impending slip problem shown. You MUST use the "args" feature of Fsolve to communicate the wheel parameters. Use all of the wheel parameters posted, except for the static coefficient of friction and the ramp-angle θ. Generate a plot of ramp-angle vs coefficient of friction for impending slip, for friction values of 0.1, 0.15, 0.2, 0.25, up to 0.85.

2403_figure1.jpg

c) The following differential equations describe the behavior of a hydraulic valve system

609_figure2.jpg

The values for the constant parameters are:

590_figure3.jpg

NOTE: All units for the variables and the constants are consistent as given, and no unit conversions of any kind are necessary.

Required:
Use odeint() to solve the differential equations for the response to a constant input of y=0.002

The initial conditions are: x=0, x?=0, p1=pa, p2=pa

1. From that solution, plot x? as a function of time, with nice title and labels.
2. From that solution, plot p1 and p2 together as functions of time, on a new graph, with nice title and labels and legend.

Attachment:- Computer Methods in Analysis and Design.zip

Reference no: EM132813882

Questions Cloud

How measures are used to protect patient health records : Select 2 security measures that are needed to protect the patient health record (PHI), such as encryption, e-prescribing guidelines.
What is the weighted average delay for ct : What is the weighted average delay? The monthly amounts paid by these customers along with their respective collection delays are: $81,900 with 2 days, $47,300.
What are elliott and page reporting options : Nickerson sued television network defamation citing a loss of $15,000,000 for the value of their franchise rights. What are Elliott and Page reporting options
Find what will be the price of the stock tomorrow morning : The company has declared a dividend of $1 per share. The stock goes ex dividend tomorrow. What will be the price of the stock tomorrow morning?
Program that uses fsolve() to find volumetric flow rate : Write a program that uses FSOLVE() to find the volumetric flow rate (m3/s) of water in each segment of the pipe flow network
Has the course made you more interested in biochemistry : As we near the end of Introduction to Biochemistry, discuss how your perception of biochemistry and its contribution to human health has changed during.
What is the minimum level of earnings before interest : The restructuring is expected to increase the earnings per share. What is the minimum level of earnings before interest and taxes that the firm is expecting?
What amount would credited to appropriated retained earnings : Assuming that the Practice Inc. complies with the contractual requirements, what amount would be credited to Appropriated retained earnings
What is the role of public health : What is the role of public health in times of Population Crises and Emergencies? How does the National Response Framework relate to the role of public health?

Reviews

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd