Changeset 25492 in project
 Timestamp:
 11/11/11 09:18:02 (8 years ago)
 Location:
 release/4/signaldiagram/trunk
 Files:

 3 edited
Legend:
 Unmodified
 Added
 Removed

release/4/signaldiagram/trunk/examples/Izhikevich03.scm
r23951 r25492 172 172 (name (car name.model)) 173 173 (model (cdr name.model))) 174 (codegen name model language: 'octave pre: pre solver: 'rkbs)174 (codegen name model language: 'octave pre: pre solver: #f) 175 175 (recur (cdr models) #f) 176 176 ))) 
release/4/signaldiagram/trunk/signaldiagram.scm
r25238 r25492 1180 1180 1181 1181 1182 (define (codegen/Octave name f #!key (initial #f) (pre #t) (solver 'rk4b))1182 (define (codegen/Octave name f #!key (initial #f) (pre #t) (solver #f)) 1183 1183 1184 1184 (if (and solver (not (member solver '(rkfe rk3 rk4a rk4b rkhe rkbs rkf45)))) … … 1193 1193 (fcodegen ((sfarrowcodegen f) input fenv dfe )) 1194 1194 (relationsexpr (relationscodegen f input)) 1195 (events (let recur ((f f) (ax '())) 1196 (let ((sig (sfarrowsig f))) 1197 (case (car sig) 1198 ((RTRANSITION) 1199 (let ((ef (fourth sig)) (eg (fifth sig))) 1200 (let* ((ax1 (cons ef ax)) 1201 (ax2 (if (symbol? eg) (cons eg ax1) ax1))) 1202 (fold recur ax2 (cdr (sfarrowchildren f))) 1203 ))) 1204 ((TRANSIENT) 1205 (let ((e (fourth sig))) 1206 (let* ((ax1 (cons e ax))) 1207 (fold recur ax1 (cdr (sfarrowchildren f))) 1208 ))) 1209 (else ax) 1210 )) 1211 )) 1195 1212 (globals (filtermap 1196 1213 (lambda (x) … … 1217 1234 "end" nl)) 1218 1235 1236 (if (pair? events) 1237 (let ((eventvector (map (lambda (x) (value>Octave (V:Op ' (list (V:Sel x (V:Var 'input)) (V:C 1.))))) events))) 1238 (printfragments 1239 (list 1240 "function " (name/Octave "retval") " = " (name/Octave (stringappend (>string name) "_event")) " (input)" nl 1241 "retval = [" (intersperse eventvector ",") "];" nl 1242 "end" nl)))) 1243 1244 1219 1245 (if initial 1220 1246 (printfragments 
release/4/signaldiagram/trunk/signaldiagram.setup
r25236 r25492 6 6 (requiredextensionversion 'flsim 1.7) 7 7 8 (define version 2. 0)8 (define version 2.1) 9 9 10 10 (make (
Note: See TracChangeset
for help on using the changeset viewer.