ADDED mttroot/mtt/bin/trans/p/mtt_euler.p Index: mttroot/mtt/bin/trans/p/mtt_euler.p ================================================================== --- /dev/null +++ mttroot/mtt/bin/trans/p/mtt_euler.p @@ -0,0 +1,16 @@ +PROCEDURE mtt_euler(VAR x_out, x,dx : StateVector; + dt : REAL; + Nx : INTEGER; + Open : StateVector); + +VAR i : INTEGER; + +BEGIN{mtt_euler} + FOR i := 1 TO Nx DO + BEGIN + IF Open[i]>0.5 THEN{Open switch} + x_out[i] := 0.0 + ELSE + x_out[i] := x[i] + dx[i]*dt; + END; +END;{mtt_euler} ADDED mttroot/mtt/bin/trans/p/zero_matrix.p Index: mttroot/mtt/bin/trans/p/zero_matrix.p ================================================================== --- /dev/null +++ mttroot/mtt/bin/trans/p/zero_matrix.p @@ -0,0 +1,11 @@ +PROCEDURE zero_matrix(VAR A : StateMatrix; + N : INTEGER); +VAR i,j : INTEGER; + +BEGIN + FOR i:=1 TO N DO + FOR j:=1 TO N DO + A[i,j] := 0.0; +END; + +