Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Need help with a program that finds the roots of an equation when provided infor

ID: 3532360 • Letter: N

Question

Need help with a program that finds the roots of an equation when provided information by the user. The equation is as follows:

A is cross sectional area of flow

A* is critical area for Mach 1 and maximum mass flow rate

M is Mach number

Gamma is the specific heat ratio Cp/Cv for air, nominally Gamma = 1.4


Tasks:


- In order to better understand the function. You are first to output the function A/A* in an excel chart with the Mach number ranging from 0.01 to 6.5 (Not necessary for the answer to this question I just need the program)


- You then need to create a root finding algorithm which will determine the associated Mach numbers related to a user given A/A* ratio.

[hints] The graph helps you compare your root findings with the actual curve to see if it makes sense. The derivative of A/A* is zero at M=1 ***


The output should look like this:


A/A*=

M1=

M2=

(where M1<M2)



Explanation / Answer

#include #include #include //for math functions //main entry point for the program void main() { clrscr(); float a,b,c,d,r,r1; // read the values for the a,b and c couta>>b>>c; if(a==0) { // if a is 0, the equation is invalid cout