10-15-2005 11:06 PM
10-16-2005 12:51 AM
@cspeed wrote:
In an attempt to learn how to code in LV, I'm attempting to program the Mach tables into, and I'm having a little trouble. One of the problems that I have run into is raising a number (other than 10, 2 and e) to a power (uaually a decimal number).
Could you provide more details?
@cspeed wrote:
I was wondering is anyone had programmed up a numeric solver that didn't require a string as an input. I've got two variables, one which is given (Cp0/Cv0) and of course A/A*.
10-16-2005 09:39 AM
10-16-2005 05:25 PM
CS,
OK, your formula has some mismatched parenthesis and other unclear points. I have implemented it as follows:
A/A*=(1/M) [(2/(g+1)) (1+((g-1)/2)) M^2]^[(g+1)/(2(g-1))]
Is this correct? It could also be:
A/A*=(1/M) [(2/(g+1)) (1+((g-1)/2) M^2)]^[(g+1)/(2(g-1))]
Could you clarify which one is right? Is it also correct to assume the last two blue ones or is the exponent only (g+1)? Is there a website describing this formula?
A very simple Newton-Raphson implementation with numerical derivatives finds the correct M for any A/A* within less than 50 iterations, typically less than 10. (I tried between A/A*=0.0001 to 100000). with a tolerance of 1e-8).
(It works equally well with the second formula with the limitation that it produces two possible solutions, depending on input)
Attached is a simple Newton-Raphson implementation to solve M as a function of A/A* (with a given g) using formula 1 above. (LabVIEW 7.1. Note: There could be bugs please verify formula. There should also be a limit on the total iteration if a solution cannot be found).
10-17-2005 08:28 PM
@altenbach wrote:
CS,
OK, your formula has some mismatched parenthesis and other unclear points. I have implemented it as follows:
A/A*=(1/M) [(2/(g+1)) (1+((g-1)/2)) M^2]^[(g+1)/(2(g-1))]
Is this correct? It could also be:
A/A*=(1/M) [(2/(g+1)) (1+((g-1)/2) M^2)]^[(g+1)/(2(g-1))]
Could you clarify which one is right? Is it also correct to assume the last two blue ones or is the exponent only (g+1)? Is there a website describing this formula?
The second one is the correct one, sorry about the abiguity. This is touched on briefly at a http://me.lsu.edu/~meniki/me4621/manual/Lab%20Manual_v4.pdf on page 23. Sorry about the .pdf, I had a hard time finding the equations.
A very simple Newton-Raphson implementation with numerical derivatives finds the correct M for any A/A* within less than 50 iterations, typically less than 10. (I tried between A/A*=0.0001 to 100000). with a tolerance of 1e-8).
(It works equally well with the second formula with the limitation that it produces two possible solutions, depending on input)
This sounds about right, one is the subsonic solution (M<1) the other is the supersonic solution (M>1,of course). The subsonic solution ideally happens on the way into a converginig-diverging nozzle, while the supersonic solution happens on the way out. Either way, there sould be two answers, both positive. One number is between 0 and 1, the other is bigger than 1. The only time this isn't true is when A/A*=1 (since A* represents the cross-sectional area needed to accelerate the flow to Mach 1).
Attached is a simple Newton-Raphson implementation to solve M as a function of A/A* (with a given g) using formula 1 above. (LabVIEW 7.1. Note: There could be bugs please verify formula. There should also be a limit on the total iteration if a solution cannot be found).
Thank you very much. I will use it to figure out where I have gone wrong. I often make a sign error when I am using the Newton- Raphson method. I always try to add instead of subtract.Thanks again.--CS