Changeset 25511 in project
 Timestamp:
 11/16/11 15:28:28 (10 years ago)
 Location:
 release/4
 Files:

 2 added
 4 edited
Legend:
 Unmodified
 Added
 Removed

release/4/flsim/trunk/flsim.scm
r25237 r25511 470 470 471 471 472 (define (prelude/Octave #!key (solver ' rk4b))472 (define (prelude/Octave #!key (solver 'lsode)) 473 473 `( 474 474 #<<EOF … … 556 556 ) 557 557 ("global " ,solver #\; ,nl) 558 (,solver = #\@ ,(case solver ((rk3) 'ode23) ((rk4b rk4a) 'ode45) ((rkf45) 'ode54) (else 'lsode)) #\; ,nl) 559 560 ,(if (member solver '(rk3 rk4b rk4a rkf45)) 561 `( 558 (,solver = #\@ ,(case solver 559 ((rk3) 'ode23) ((rk4b rk4a) 'ode45) ((rkf45) 'ode54) 560 (else 'lsode)) #\; ,nl) 561 562 ,(cond 563 564 ((member solver '(rk3 rk4b rk4a rkf45)) 565 566 `( 562 567 #<<EOF 563 568 global reltol abstol dt; … … 574 579 " [t,y] = " ,solver "(f,[x,x+h],y,P); " ,nl 575 580 " res = y(2);" ,nl end ,nl 576 ) 577 578 `( 581 )) 582 (else 583 584 `( 579 585 #<<EOF 580 586 lsode_options("relative tolerance",1e1); 581 587 lsode_options("absolute tolerance",1e2); 582 lsode_options("initial step size",1e3); 588 583 589 584 590 EOF 585 "function res = integrate1d (f,x,y ,h)" ,nl591 "function res = integrate1d (f,x,y0,h)" ,nl 586 592 " global " ,solver ";" ,nl 587 " y = " ,solver "(@( t,yvec)(f(yvec,t)),y,[x,x+h]); " ,nl593 " y = " ,solver "(@(yvec,t) f(t,yvec),y0,[x,x+h]); " ,nl 588 594 " res = y(2);" ,nl end ,nl 589 )590 ) 595 ) 596 )) 591 597 )) 592 598 )) 593 599 594 595 600 596 601 
release/4/flsim/trunk/flsim.setup
r25235 r25511 4 4 (makepathname #f fn ##sys#loaddynamicextension)) 5 5 6 (define version 2. 0)6 (define version 2.1) 7 7 8 8 (make ( … … 77 77 (copyfiletoflsimdir "smllib/rk/rk.mlb") 78 78 79 (copyfiletoflsimdir "octavelib/ode15s.m") 79 80 81 82 
release/4/signaldiagram/trunk/examples/Izhikevich03.scm
r25492 r25511 172 172 (name (car name.model)) 173 173 (model (cdr name.model))) 174 (codegen name model language: 'octave pre: pre solver: #f)174 (codegen name model language: 'octave pre: pre solver: 'lsode) 175 175 (recur (cdr models) #f) 176 176 ))) 
release/4/signaldiagram/trunk/signaldiagram.scm
r25510 r25511 1182 1182 (define (codegen/Octave name f #!key (initial #f) (pre #t) (solver #f)) 1183 1183 1184 (if (and solver (not (member solver '( rkfe rk3 rk4a rk4b rkhe rkbs rkf45))))1184 (if (and solver (not (member solver '(lsode rkfe rk3 rk4a rk4b rkhe rkbs rkf45)))) 1185 1185 (error 'codegen/Octave "unknown solver" solver)) 1186 1186 … … 1261 1261 (define (codegen/scheme name f #!key (initial #f) (pre #t) (solver 'rk4b)) 1262 1262 1263 (if (and solver (not (member solver '( rkfe rk3 rk4a rk4b rkhe rkbs rkf45 ode15s))))1263 (if (and solver (not (member solver '(lsode rkfe rk3 rk4a rk4b rkhe rkbs rkf45)))) 1264 1264 (error 'codegen/scheme "unknown solver" solver)) 1265 1265
Note: See TracChangeset
for help on using the changeset viewer.