fun putStrLn str = (TextIO.output (TextIO.stdOut, str); TextIO.output (TextIO.stdOut, "\n")) fun putStr str = (TextIO.output (TextIO.stdOut, str)) fun showReal n = let open StringCvt open Real in (if n < 0.0 then "-" else "") ^ (fmt (FIX (SOME 12)) (abs n)) end fun printstate ({t,h,v,w,Isyn,vk,vl,vca,gk,gl,gca,c,v1,v2,v3,v4,phi})= ( (showReal t) ^ " " ^ (showReal v) ^ " " ^ (showReal w) ) fun run (tmax,input as {t,h,v,w,Isyn,vk,vl,vca,gk,gl,gca,c,v1,v2,v3,v4,phi}) = let val nstate = Model.Morris_Lecar81 input in putStrLn (printstate nstate); if (#t nstate) > tmax then (putStrLn "# All done!"; nstate) else (run (tmax,nstate)) end val _ = (printstate Model.Morris_Lecar81_initial; run (1000.0,Model.Morris_Lecar81_initial))