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

  Draw a flowchart that presents the steps of the algorithm

Perform some basic data analysis on a dataset obtained from Gapminder project. Gapminder collects authentic facts and statistics of all countries worldwide

  Write a python code for smart contract for blockchain

You need a Python code for " Smart contract" for Blockchain with Pyethereum , Pyethereum package in Python.

  Write a program using python to implement a password cracker

Write a program using Python to implement a password cracker for Linux. You should utilize a dictionary (small - English) to crack the password.

  Create an html web document that displays the results

Search for and download a photograph of a jackrabbit. Create an HTML Web document that displays the results and plays the blended WAV document that you created in Topic 5. Add a headline "Mythological Jackalope Discovered!"

  Define three types of programming errors

Define three types of programming errors and explain with examples

  Create functions and call those functions to display outputs

Create additional functions and call those functions to display outputs. Write code for each function calling functions from step one above to display outputs.

  Takes a list of integers as input and returns true

Write function arithmetic() that takes a list of integers as input and returns True if they form an arithmetic sequence.

  Compute a distribution over k topics

We need one Z which represents the probability that each word in the document has been generated from a particular topic, so for any document.

  Design a program that continuously accepts an authors name

Registration workers at a conference for authors of children's books have collected data about conference participants, including the number of books.

  Record a function that accepts as a parameter a string

In Python, record a function that accepts as a parameter a string of seven 0s and 1s. and returns an eight digit string in odd parity.

  Modify your code to ask the user for the id of a restaurant

Copy check1.py to check2.py and continue to work on check2.py. Modify your code to ask the user for the id of a restaurant between 1 and 155 (humans don't need to know about list ids starting at 0).

  Create an array that contains the days of the week

Create an array that contains the days of the week, and then Create a loop to print that content. Include explanations of each line of code and submit.

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