Artifact a811a17ceff8e5da58f66d09a1cadb32d04b8ec104298546b1e0ca9fbe1289c3:
- Executable file mttroot/mtt/bin/trans/m/mtt_euler.m — part of check-in [c3a30997f5] at 2000-08-01 11:14:36 on branch origin/master — Initial revision (user: gawthrop@users.sourceforge.net, size: 321) [annotate] [blame] [check-ins using]
function [x] = mtt_euler(x,dx,dt,stepfactor,Nx,open) # Euler update I_open = nozeros(open.*[1:Nx]'); # Indices of open switches x(I_open) = 0.0; # Open switches have zero state I = nozeros(!open.*[1:Nx]'); # Indices of states to update x(I) = x(I) + dx(I)*dt; # Update states except open switches. endfunction;