HW3 program - END IF END DO WRITE (*,*) WRITE (*,*)...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
PROGRAM isenflow IMPLICIT NONE INTEGER :: choice REAL :: value, M, T, P, rho DO WRITE (*,*) 'This program solves for 3 other variables when given one of the 4' WRITE (*,*) 'in an isentropic flow. (Appendix A in Aerodynamics Book)' WRITE (*,*) 'What information do you have? (enter 1-4)' WRITE (*,*) '1. M' WRITE (*,*) '2. p0/p' WRITE (*,*) '3. rho0/rho' WRITE (*,*) '4. T0/T' READ (*,*) choice WRITE (*,*) 'Please enter the value.' READ (*,*) value IF (choice == 1) THEN M = value T = 1.0 + .2*M**2.0 P = (1.0 + .2*M**2.0)**3.5 rho = (1.0 + .2*M**2.0)**2.5 exit ELSE IF (choice == 2) THEN P = value M = sqrt (5.0*(P**(2.0/7.0) - 1.0)) T = P**(2.0/7.0) rho = P**(5.0/7.0) exit ELSE IF (choice == 3) THEN rho = value M = sqrt (5.0*(rho**(2.0/5.0) - 1.0)) T = rho**(2.0/5.0) P = rho**(7.0/5.0) exit ELSE IF (choice == 4) THEN T = value P = T**(7.0/2.0) rho = T**(5.0/2.0) M = sqrt (5.0*(T-1.0)) exit ELSE WRITE (*,*) WRITE (*,*) 'Please choose 1-4' WRITE (*,*)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: END IF END DO WRITE (*,*) WRITE (*,*) 'Solution:' WRITE (*,*) 'M =', M WRITE (*,*) 'p0/p =', P WRITE (*,*) 'rho0/rho =', rho WRITE (*,*) 'T0/T =', T STOP END PROGRAM isenflow-bash-3.1$ ./a.out This program solves for 3 other variables when given one of the 4 in an isentropic flow. (Appendix A in Aerodynamics Book) What information do you have? (enter 1-4) 1. M 2. p0/p 3. rho0/rho 4. T0/T 1 Please enter the value. .62 Solution: M = 0.6200000 p0/p = 1.295942 rho0/rho = 1.203423 T0/T = 1.076880 -bash-3.1$ ./a.out This program solves for 3 other variables when given one of the 4 in an isentropic flow. (Appendix A in Aerodynamics Book) What information do you have? (enter 1-4) 1. M 2. p0/p 3. rho0/rho 4. T0/T 3 Please enter the value. 10 Solution: M = 2.749442 p0/p = 25.11886 rho0/rho = 10.00000 T0/T = 2.511886...
View Full Document

Page1 / 2

HW3 program - END IF END DO WRITE (*,*) WRITE (*,*)...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online