1
$\begingroup$

I'm trying to solve for Mach number based on the given Prandtl-Meyer function, however I keep getting odd error.

Here is my code:

g = 1.4

v2 = 54

Solve[v2 == (Sqrt[(g + 1)/(g - 1)]*
        ArcTan[Sqrt[(g - 1) (M2^2 - 1)/(g + 1)]] - 
       ArcTan[Sqrt[M2^2 - 1]])/Pi*180, {M2}];

This is the website that has the function I'm trying to solve.

Any help would be greatly appreciated.

UPDATED:

g = 1.4

v2 = 54.76

M2 := FindRoot[
  v2 == (Sqrt[(g + 1)/(g - 1)]*
        ArcTan[Sqrt[(g - 1) (x^2 - 1)/(g + 1)]] - 
       ArcTan[Sqrt[x^2 - 1]])/Pi*180, {x, 3}]
M2
$\endgroup$
  • $\begingroup$ Looks like you might have use FindRoot to get a numerical solution (M2 -> 3.22983). $\endgroup$ – wxffles May 11 '13 at 5:04
  • $\begingroup$ Thanks! So i've managed to get appropriate answer but how can I save it as a value in a variable to use in next equations? $\endgroup$ – user6850 May 11 '13 at 5:21
  • $\begingroup$ Have you seen this? $\endgroup$ – J. M. will be back soon May 11 '13 at 5:30
4
$\begingroup$

Here's a short routine for computing the Mach number from the Prandtl-Meyer equation:

prandtlMeyerMachNumber[γ_?InexactNumberQ, ν_?InexactNumberQ] := 
    Module[{prec = Precision[{γ, ν}], β, η, λ, m},
           λ = Sqrt[SetPrecision[(γ - 1)/(γ + 1), ∞]];
           η = ν + π (1 - 1/λ)/2;
           m = ((3 + γ) η^2/12 + 2/(1 - γ))/η;
           Sqrt[β^2 + 1] /. First @ FindRoot[ν == ArcTan[λ β]/λ - ArcTan[β],
                                             {β, Sqrt[m^2 - 1]}, WorkingPrecision -> prec]]

As noted in the comments, a transcendental equation such as the Prandtl-Meyer equation will often not admit an easy symbolic solution, and one thus has to resort to numerical techniques, as embodied in FindRoot[]. For this case, I derived the starting approximation that is subsequently polished by FindRoot[] using Padé approximation.

As an example:

N[prandtlMeyerMachNumber[7/5, 54 °], 20]
   3.2298336339590326897

Note the use of the degree sign, as the function expects radian arguments.

For the case of $\gamma=7/5$ (which seems to be the common case), the routine will fail at exactly $\nu=\dfrac{\pi(\sqrt{6}-1)}{2}$ (the limiting value of $\nu$), but should otherwise be fine.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.