impdes Translation Listing



 FORTRAN CALCULUS (VERSION 2.0) ------------------------- 04/18/2008   14:01:14
 ####  LABEL ---+---------+---------+---------+---------+---------+---------+--
~
    1        PROBLEM IMPDES  ! Implicit Differential Equations
            !------------------------------------------------------------|
            ! This is an example of nesting the solution of simultaneous |
            ! implicit equations inside a system integration process to  |
            ! configure the solution of simultaneouse differential equa- |
            ! tions. The problem is characteristic of liquid bi-         |
            ! propellent rocket engines, like the Apollo service module  |
            ! propulsion system, from which this example is taken.       |
            !------------------------------------------------------------|
    2          COMMON XDOT,X,YDOT,Y,T
    4>         X=14000 : Y=7000       ! Initial Conditions
    6>         XDOT=-50 : YDOT=-25    ! Initial Rate Guesses
    9>         T=0 : DT=.25 : TP=.5
   10          @TERMINAL(11)
   11          @STREAM(’CONSOLE’)
   12          @AXES(’PLOT’)
              !----------------------------------------------------------|
              ! Meta Calculus statement to initiate integration of the   |
              ! implicit flow rate eqauations for XDOT and YDOT,         |
              ! representing the fuel and oxidizer flow rates            |
              !----------------------------------------------------------|
   13          INITIATE JANUS; FOR IDEQ; EQUATIONS
           *    XDOT/X, YDOT/Y; OF T; STEP DT; TO TF;
              !----------------------------------------------------------|
              ! Time-serial output to CONSOLE stream for continuity      |
              !----------------------------------------------------------|
   14          PRINT *,’        TIME           XDOT           X   ’
           *         ,’        YDOT              Y’
   15          TF=TP
   16          DO WHILE (TF.LE.50)
   17            INTEGRATE IDEQ; BY JANUS
   18            PRINT 1,T,XDOT,X,YDOT,Y
   19      1     FORMAT(5E15.6)
   20*           @CURVES(’PLOT’)
   21            TF=TF+TP
   22          END DO
   23          @SHOW(’PLOT’,’Implicit Differential Equations Solution’)
   24        END
~
      
   25        MODEL IDEQ   ! Implicit Differential Equations
   26          COMMON XDOT,X,YDOT,Y,T
              !--------------------------------------------------------------|
              ! Meta Calculus statement to solve for the implicit flow rates |
              ! by matching the equality constraints. Nested within a numer- |
              ! integration (simulation) process, this iterative correlation |
              ! process occurs four times for each integration step during   |
              ! the 4th order Runge-Kutta-Adams-Moulton predictor-corrector  |
              ! integration process.                                         |
              !--------------------------------------------------------------|
   27          FIND XDOT,YDOT; IN IRATE(GX,GY); BY AJAX(ACON); TO MATCH GX,GY
   28        END
~
      
   29        MODEL IRATE(GX,GY)  ! Implicit Rate Equations
   30          COMMON XDOT,X,YDOT,Y,T
              !--------------------------------------------------------------|
              ! These are the implicit equations from the flow rates XDOT    |
              ! and YDOT. We have added longitudinal (POGO) vibration terms  |
              ! to portray realistic effects of propellant sloshing.         |
              !--------------------------------------------------------------|
   31          GX=XDOT+3.2*SQRT(1-(XDOT+YDOT)*EXP(-T/50)
           &     *(1.15+57.5/(20000+X+Y)))*(1+.1*EXP(-T/10)*SIN(1.5708*T))
   32          GY=YDOT+1.59*SQRT(1-(XDOT+YDOT)*EXP(-T/50)
           &     *(1.15+36.2/(20000+X+Y)))*(1+.1*EXP(-T/10)*SIN(1.5708*T))
   33        END
~
      
   34        CONTROLLER ACON(AJAX)
   35          SUMOUT=1  ! Summary report to SUMMARY stream
   36          DETAIL=1  ! Detailed report for every iteration
   37          DETOUT=0  ! Detailed report to DETAIL stream
   38        END
~
      
   39        PROCEDURE AXES(GNAME)
            !-------------------------------------------------------------|
            !          Procedure to setup graphics output                 |
            !-------------------------------------------------------------|
   40          COMMON /PARAMS/P1,P2
   41          CHARACTER*(*) GNAME
   42          @GRAFIL(GNAME,’SUM’,’IMAGE’,0,0)
   43          @FONT(GNAME,’COMPLEX’,’STANDARD’,0,1)
   44          @AXNAME(GNAME,’X’,’TIME’,’CENT’,30,36,10)
   45          @AXNAME(GNAME,’Y’,’RATES and FLOW’,’CENT’,30,36,10)
   46          @XYPLOT(GNAME,’RECT’,0,50,0,10,0,1000,0,200,1,0,0,0,0)
   47          @SETUP(GNAME,’XD’,2,3,0,1) ! XDOT Curve (green-dashed)
   48          @SETUP(GNAME,’YD’,2,4,0,1) ! YDOT Curve (blue-dashed)
   49          @SETUP(GNAME,’X ’,7,7,0,1) ! X Curve (orange-dashl)
   50          @SETUP(GNAME,’Y ’,7,2,0,1) ! Y Curve (red-dashl)
   51          @MESSAGE(GNAME,’YDOT**2’,5,350,3)
   52          @MESSAGE(GNAME,’XDOT**2’,5,100,4)
   53          @MESSAGE(GNAME,’Y-6000’,5,875,2)
   54          @MESSAGE(GNAME,’X-13000’,5,975,7)
   55        END
~
      
   56        PROCEDURE CURVES(GNAME)  ! Generate points on integral curves
   57          COMMON XDOT,X,YDOT,Y,T
   58          CHARACTER*(*) GNAME
   59          @CURVE(GNAME,’XD’,T,XDOT*XDOT)
   60          @CURVE(GNAME,’YD’,T,YDOT*YDOT)
   61          @CURVE(GNAME,’X ’,T,X-13000)
   62          @CURVE(GNAME,’Y ’,T,Y-6000)
   63        END
~
      
      
   64