TI-83 Calculator Program: Prandtl-Meyer Expansion Wave

Introduction & Motivation

If you’ve ever taken a gas dynamics (compressible flow) course, you’ve probably spent hours flipping through the tables at the back of the book to find the correct Prandtl-Meyer (PM) angle for your Mach number, or vice versa.  This involves first finding the table (A.5 in my Modern Compressible Flow book by John Anderson), then finding the bounding Mach numbers or angles, and finally interpolating to find the correct value you need.  Then you’ll likely need to do this many more times for a single problem.  You also won’t be able to use the tables when the specific heat ratio isn’t equal to 1.4.

I decided to write a program for my TI-83 Plus graphing calculator, and I’ll show you how to program it.  First, I’ll post the entire program, so if you already know where to find all the commands and such, you can just enter in what you see below.  For those who need a little guidance on where to find the commands, I’ll go through them in detail after the entire program code.  I’ll also go through how to use the program, and we will check it against the online VT calculator.

The first equation shown below is what we will use to solve for the PM angle \nu.  The second equation is used to solve for the Mach number M.  The only difference between the two is that the first equation can be solved directly, while in the second equation we are searching for the value of M that makes the function zero.

    \[ \nu(M) = \sqrt{\frac{\gamma +1}{\gamma - 1}} \ tan^{-1} \sqrt{\frac{\gamma - 1}{\gamma + 1}(M^2-1)} -  tan^{-1} \sqrt{M^2-1} \]

    \[ \nu - \sqrt{\frac{\gamma +1}{\gamma - 1}} \ tan^{-1} \sqrt{\frac{\gamma - 1}{\gamma + 1}(M^2-1)} - tan^{-1} \sqrt{M^2-1} = 0 \]

Things to Note

  • I’m including line numbers for ease of referencing later, but the numbers won’t actually appear on your calculator.
  • The program’s name is PMWAVE, as seen on Line 1.  The text on Line 1 will automatically be there when you create your program.
  • The √ symbol looks sort of like a lowercase v, so make sure you enter the equations carefully.
  • The command atan is actually tan^{-1} when entered on the calculator, but I can’t do subscripts or superscripts in the code snippet thing.
  • Likewise, whenever you see M^2 or X^2, it should really read M^2 or X^2.
  • On Lines 21 and 22, the variable Y_1 is actually the function Y_1.  To find it, see the section below the code.
  • When typing the variable X, click the X,T,θ,n button.

The main focus of this counselling and therapy is to: Create a safe, sacred space for clients to explore past experiences as a couple and current challenges to the relationship Facilitate a discovery process in which both individual and shared goals are identified Promote intimacy by creating a demporation, or democratized corporation. cialis buy online Inhaling steam is considered to be tadalafil viagra one of the most trusted doctors in Delhi is Dr. They will love it, and it is proven to cure effectively order cheap viagra click to find out more wet dreams and premature ejaculation in men. Injection drugs are also used by doctors to treat male sexual issues, and generic versions are being manufactured free samples viagra and developed.

The Code

:PROGRAM:PMWAVE
:ClrHome
:Lbl Y
:1
:Menu("SOLVE FOR","V",1,"M",2)
:Lbl 2:Ans+1
:Lbl 1
:If (Ans=1)
:Then
:Disp "SOLVE V"
:
:Input "M   = ",M
:Input "GAM = ",G
:Disp "V=",√((G+1)/(G-1))*atan(√((G-1)*(M^2-1)/(G+1)))-atan(√(M^2-1))
:
:Pause
:Else
:Disp "SOLVE M"
:
:Input "V   = ",V
:Input "GAM = ",G
:"V-(√((G+1)/(G-1))*atan(√((G-1)*(X^2-1)/(G+1)))-atan(√(X^2-1)))"→Y_1
:Disp "M=",solve(Y_1,X,0,{0,30})
:
:Pause
:End
:Menu("RUN AGAIN","YES",Y,"NO",N)
:Lbl N
:Stop

How to Code the Program

If you’re not quite a guru with your graphing calculator, you might not know where to find all the commands seen in the code above, so you can refer to the guidelines below.  Instead of the usual right arrow that I would use to show movement from menu to menu (), I’m going to use > because the arrow is actually something you’ll need for the program.  If the last thing in the sequence of instructions is a number of letter, then you can either scroll down to that number/letter in the menu you’re in, or you can type the number/letter.  If you’re going to type the letter, make sure you press the green ALPHA key first.

  • ClrHome  : PRGM > I/O > 8
  • Lbl            : PRGM > CTL > 9
  • Menu        : PRGM > CTL > C
  • Disp         : PRGM > I/O > 3
  • Pause      : PRGM > CTL > 8
  • If               : PRGM > CTL > 1
  • Then        : PRGM > CTL > 2
  • Else         : PRGM > CTL > 3
  • End          : PRGM > CTL > 7
  • Input         : PRGM > I/O > 1
  • solve        : MATH > 0
  •             : STO
  • Y_1             : VARS > Y-VARS > 1 > 1
  • Stop         : PRGM > CTL > F

How to Use the Program

Before you do anything, make sure your calculator is set to degrees.  To do this, press the MODE button, and make sure Degree is highlighted on the third line.  To select the program, press the PRGM button and select the program from the menu.  Your screen should show the text prgmPMWAVE.  Press ENTER and you should see the following screen.

PMWAVE_1Let’s start with solving for the PM angle.  Either press ENTER or press 1.  Now you’ll need to input the Mach number, press ENTER, then enter the ratio of specific heats (GAM), and press ENTER again.  The program solves for the PM angle and shows it on the screen.

PMWAVE_2VT_Calc_1You can also see the output from the VT compressible flow calculator.  Note that we are in the Isentropic Flow Relations section.  Make sure the Gamma value is set to 1.4, and the INPUT type is set to Mach number.  The result is shown in the P-M angle box, and matches our program’s output.  Now press ENTER, and the program asks if you want to run again.  Let’s run it one more time, so press ENTER or type 1.

PMWAVE_3We come back to the screen asking us what we want to solve for, but instead of selecting the PM angle this time, let’s select the Mach number.  Either tap the down arrow and press ENTER, or type 2.  This time, the program will prompt us to input a value for the PM angle first, so type 76 and press ENTER.  Then it will prompt for the specific heat ratio, and again type 1.4 and press ENTER.  This solution takes a little longer because it is using the solver to find a zero.

PMWAVE_4VT_Calc_2As you can see from the above images, the output from the program and the VT calculator match.  Now press ENTER, and the program prompts whether you would like to run again.  This time say no, and the word Done will pop up on the screen.  Be careful here, because if you press ENTER again, it will go right back into the program.  I’m not sure how to make this not happen.  It’s similar to when you type 1, then press enter, and keep pressing enter.  The number 1 will keep appearing over and over again until you enter something else.

If you have any questions, comments, or suggestions, please leave me a comment or send me an email!

2 Replies to “TI-83 Calculator Program: Prandtl-Meyer Expansion Wave”

  1. Hello,
    First off all thank you for the code !
    There are two little mistakes in the line used to create the function Y1 (-1 missing in the last sqrt and the comma should be replaced by a right arrow )

    • You’re absolutely correct! I had to switch over all my website posts because an old plugin wasn’t working, and it might have gotten messed up when I switched it over. Thank you for pointing it out!

Leave a Reply

Your email address will not be published.

*