# Generated Code

The following is f77 code generated by the CellML API from this CellML file. (Back to language selection)

The raw code is available.

C C There are a total of 3 entries in the algebraic variable array. C There are a total of 1 entries in each of the rate and state variable arrays. C There are a total of 6 entries in the constant variable array. C C C VOI is x in component main (dimensionless). C ALGBRC(1) is sin1 in component main (dimensionless). C STATES(1) is sin2 in component main (dimensionless). C ALGBRC(3) is sin3 in component main (dimensionless). C CONSTS(2) is k2_oPi in component main (dimensionless). C CONSTS(3) is k2Pi in component main (dimensionless). C CONSTS(4) is kPi_2 in component main (dimensionless). C CONSTS(5) is kPi in component main (dimensionless). C CONSTS(6) is kPi_32 in component main (dimensionless). C ALGBRC(2) is z in component main (dimensionless). C CONSTS(1) is C in component main (dimensionless). C RATES(1) is d/dt sin2 in component main (dimensionless). C SUBROUTINE initConsts(CONSTS, RATES, STATES) REAL CONSTS(*), RATES(*), STATES(*) STATES(1) = 0 CONSTS(1) = 0.75 CONSTS(2) = 2.00000/ 3.14159265358979 CONSTS(3) = 2.00000* 3.14159265358979 CONSTS(4) = 3.14159265358979/2.00000 CONSTS(5) = 3.14159265358979 CONSTS(6) = ( 3.00000* 3.14159265358979)/2.00000 RETURN END SUBROUTINE computeRates(VOI, CONSTS, RATES, STATES, ALGBRC) REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*) RATES(1) = cos(VOI) RETURN END SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC) REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*) ALGBRC(1) = sin(VOI) ALGBRC(2) = TERNRY(VOI.LT.CONSTS(4), VOI*CONSTS(2) - 0.500000, TERNRY(VOI.LT.CONSTS(5), ( 3.14159265358979 - VOI)*CONSTS(2) - 0.500000, TERNRY(VOI.LT.CONSTS(6), (VOI - 3.14159265358979)*CONSTS(2) - 0.500000, (CONSTS(3) - VOI)*CONSTS(2) - 0.500000) ALGBRC(3) = TERNRY(VOI.LT.CONSTS(4), - ( ALGBRC(2)*ALGBRC(2))+CONSTS(1)+ALGBRC(2), TERNRY(VOI.LT.CONSTS(5), - ( ALGBRC(2)*ALGBRC(2))+CONSTS(1)+ALGBRC(2), TERNRY(VOI.LT.CONSTS(6), ( ALGBRC(2)*ALGBRC(2) - CONSTS(1)) - ALGBRC(2), ( ALGBRC(2)*ALGBRC(2) - CONSTS(1)) - ALGBRC(2)) RETURN END REAL FUNCTION TERNRY(TEST, VALA, VALB) LOGICAL TEST REAL VALA, VALB IF (TEST) THEN TERNRY = VALA ELSE TERNRY = VALB ENDIF RETURN END