Index: mttroot/mtt/bin/trans/make_ode2odes ================================================================== --- mttroot/mtt/bin/trans/make_ode2odes +++ mttroot/mtt/bin/trans/make_ode2odes @@ -28,10 +28,11 @@ $1_simpar; # Read in simulation parameters $1_numpar; # Read in parameters iLast = round(LAST/DT); # Total number of steps +DDT = DT/STEPFACTOR; #Initialise t = 0.0; MTTx = $1_state; # Read in initial state MTTu = $1_input(MTTx,t); # Evaluate initial input @@ -38,20 +39,23 @@ MTTy = $1_odeo(MTTx,MTTu,t); # Evaluate initial output mtt_write(t,MTTx,MTTy,$Nx,$Ny); # And write them #Integration loop for it = 1:iLast - MTTu = $1_input(MTTx,t); - MTTdx = $1_ode(MTTx,MTTu,t); - for j = 1:$Nx - MTTx(j) = MTTx(j) + MTTdx(j)*DT; + for i = 1:STEPFACTOR + MTTu = $1_input(MTTx,t);# Input + MTTx = $1_switch(MTTx); # Switches + MTTdx = $1_ode(MTTx,MTTu,t); + for j = 1:$Nx + MTTx(j) = MTTx(j) + MTTdx(j)*DDT; + end; + MTTy = $1_odeo(MTTx,MTTu,t); + t = t + DDT; end; - MTTy = $1_odeo(MTTx,MTTu,t); - t = t + DT; mtt_write(t,MTTx,MTTy,$Nx,$Ny); end; EOF