@@ -37,7 +37,7 @@ See [IdealDiode](../lib/index.html#IdealDiode) and
37
37
[ Limiter] ( ../lib/index.html#Limiter ) in the standard library.
38
38
39
39
40
- [ Sims/src/main.jl:1167 ] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L1167 )
40
+ [ Sims/src/main.jl:1163 ] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L1163 )
41
41
42
42
43
43
@@ -89,7 +89,7 @@ function Resistor(n1::ElectricalNode, n2::ElectricalNode, R::Signal)
89
89
end
90
90
```
91
91
92
- [ Sims/src/main.jl:766 ] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L766 )
92
+ [ Sims/src/main.jl:760 ] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L760 )
93
93
94
94
95
95
130
130
y = sim (test_BoolEventHook ())
131
131
```
132
132
133
- [ Sims/src/main.jl:998 ] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L998 )
133
+ [ Sims/src/main.jl:992 ] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L992 )
134
134
135
135
136
136
@@ -168,7 +168,7 @@ b = Unknown([1., 0.])
168
168
y = Unknown (compatible_values (a,b)) # Initialized to [0.0, 0.0].
169
169
```
170
170
171
- [ Sims/src/main.jl:639 ] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L639 )
171
+ [ Sims/src/main.jl:633 ] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L633 )
172
172
173
173
174
174
@@ -193,7 +193,7 @@ delay(x::Unknown, val)
193
193
* ` ::MExpr ` : a delayed Unknown
194
194
195
195
196
- [ Sims/src/main.jl:877 ] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L877 )
196
+ [ Sims/src/main.jl:871 ] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L871 )
197
197
198
198
199
199
@@ -218,7 +218,7 @@ a = Unknown()
218
218
der (a) + 1
219
219
```
220
220
221
- [ Sims/src/main.jl:294 ] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L294 )
221
+ [ Sims/src/main.jl:287 ] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L287 )
222
222
223
223
224
224
@@ -251,15 +251,15 @@ See [DeadZone](../lib/index.html#DeadZone) and
251
251
[ Limiter] ( ../lib/index.html#Limiter ) in the standard library.
252
252
253
253
254
- [ Sims/src/main.jl:1210 ] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L1210 )
254
+ [ Sims/src/main.jl:1206 ] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L1206 )
255
255
256
256
257
257
258
258
## is_unknown
259
259
260
260
Is the object an UnknownVariable?
261
261
262
- [ Sims/src/main.jl:245 ] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L245 )
262
+ [ Sims/src/main.jl:237 ] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L237 )
263
263
264
264
265
265
@@ -293,7 +293,7 @@ typeof(d)
293
293
myfun (x) = mexpr (:call , :myfun , x)
294
294
```
295
295
296
- [ Sims/src/main.jl:354 ] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L354 )
296
+ [ Sims/src/main.jl:347 ] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L347 )
297
297
298
298
299
299
@@ -321,7 +321,7 @@ a = Unknown("var1")
321
321
name (a)
322
322
```
323
323
324
- [ Sims/src/main.jl:599 ] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L599 )
324
+ [ Sims/src/main.jl:593 ] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L593 )
325
325
326
326
327
327
@@ -344,7 +344,7 @@ pre(x::DiscreteVar)
344
344
* A value stored just prior to an event.
345
345
346
346
347
- [ Sims/src/main.jl:1024 ] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L1024 )
347
+ [ Sims/src/main.jl:1018 ] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L1018 )
348
348
349
349
350
350
387
387
See also [ IdealThyristor] ( ../lib/index.html#IdealThyristor ) in the standard library.
388
388
389
389
390
- [ Sims/src/main.jl:1118 ] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L1118 )
390
+ [ Sims/src/main.jl:1112 ] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L1112 )
391
391
392
392
393
393
@@ -416,7 +416,7 @@ expressions, except to grab an immediate value.
416
416
v = Voltage (value (n1) - value (n2))
417
417
```
418
418
419
- [ Sims/src/main.jl:563 ] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L563 )
419
+ [ Sims/src/main.jl:557 ] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L557 )
420
420
421
421
422
422
@@ -442,15 +442,15 @@ end
442
442
dump ( Vanderpol () )
443
443
```
444
444
445
- [ Sims/src/main.jl:489 ] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L489 )
445
+ [ Sims/src/main.jl:483 ] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L483 )
446
446
447
447
448
448
449
449
## MTime
450
450
451
451
The model time - a special unknown variable.
452
452
453
- [ Sims/src/main.jl:654 ] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L654 )
453
+ [ Sims/src/main.jl:648 ] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L648 )
454
454
455
455
456
456
@@ -476,7 +476,7 @@ dump( Vanderpol() )
476
476
x = sim (Vanderpol (), 50.0 )
477
477
```
478
478
479
- [ Sims/src/main.jl:513 ] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L513 )
479
+ [ Sims/src/main.jl:507 ] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L507 )
480
480
481
481
482
482
@@ -522,15 +522,15 @@ function Vanderpol2()
522
522
end
523
523
```
524
524
525
- [ Sims/src/main.jl:1383 ] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L1383 )
525
+ [ Sims/src/main.jl:1382 ] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L1382 )
526
526
527
527
528
528
529
529
## DefaultUnknown
530
530
531
531
The default UnknownCategory.
532
532
533
- [ Sims/src/main.jl:152] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L152 )
533
+ [ Sims/src/main.jl:152] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L152 )
534
534
535
535
536
536
@@ -552,7 +552,7 @@ der(a) + 1
552
552
typeof (der (a))
553
553
```
554
554
555
- [ Sims/src/main.jl:264 ] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L264 )
555
+ [ Sims/src/main.jl:257 ] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L257 )
556
556
557
557
558
558
@@ -589,15 +589,15 @@ programming). The package
589
589
[ Reactive.jl] ( https://github.com/JuliaLang/Reactive.jl ) may help here.
590
590
591
591
592
- [ Sims/src/main.jl:921 ] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L921 )
592
+ [ Sims/src/main.jl:915 ] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L915 )
593
593
594
594
595
595
596
596
## DiscreteVar
597
597
598
598
A helper type used inside of the residual function.
599
599
600
- [ Sims/src/main.jl:954 ] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L954 )
600
+ [ Sims/src/main.jl:948 ] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L948 )
601
601
602
602
603
603
@@ -627,7 +627,7 @@ Event(condition::ModelType, pos_response, neg_response)
627
627
See [ IdealThyristor] ( ../lib/index.html#IdealThyristor ) in the standard library.
628
628
629
629
630
- [ Sims/src/main.jl:1052 ] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L1052 )
630
+ [ Sims/src/main.jl:1046 ] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L1046 )
631
631
632
632
633
633
@@ -638,16 +638,17 @@ and may be broken. There are no tests. The idea is that the equations
638
638
provided will only be used during the initial solution.
639
639
640
640
``` julia
641
- InitialEquation (egs )
641
+ InitialEquation (eqs )
642
642
```
643
643
644
644
### Arguments
645
645
646
+ * ` x::Unknown ` : the quantity to be initialized
646
647
* ` eqs::Array{Equation} ` : a vector of equations, each to be equated
647
648
to zero during the initial equation solution.
648
649
649
650
650
- [ Sims/src/main.jl:795 ] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L795 )
651
+ [ Sims/src/main.jl:790 ] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L790 )
651
652
652
653
653
654
@@ -656,7 +657,7 @@ InitialEquation(egs)
656
657
A helper type needed to mark unknowns as left-side variables in
657
658
assignments during event responses.
658
659
659
- [ Sims/src/main.jl:1076 ] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L1076 )
660
+ [ Sims/src/main.jl:1070 ] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L1070 )
660
661
661
662
662
663
@@ -681,15 +682,15 @@ d = a + sin(b)
681
682
typeof (d)
682
683
```
683
684
684
- [ Sims/src/main.jl:321 ] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L321 )
685
+ [ Sims/src/main.jl:314 ] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L314 )
685
686
686
687
687
688
688
689
## ModelType
689
690
690
691
The main overall abstract type in Sims.
691
692
692
- [ Sims/src/main.jl:136] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L136 )
693
+ [ Sims/src/main.jl:136] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L136 )
693
694
694
695
695
696
@@ -712,7 +713,7 @@ Parameter(value, label::String)
712
713
* ` label::String ` : labeling string, defaults to ""
713
714
714
715
715
- [ Sims/src/main.jl:375 ] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L375 )
716
+ [ Sims/src/main.jl:368 ] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L368 )
716
717
717
718
718
719
@@ -728,7 +729,7 @@ PassedUnknown(ref::UnknownVariable)
728
729
729
730
* ` ref::UnknownVariable ` : an Unknown
730
731
731
- [ Sims/src/main.jl:821 ] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L821 )
732
+ [ Sims/src/main.jl:815 ] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L815 )
732
733
733
734
734
735
@@ -789,15 +790,15 @@ function SignalCurrent(n1::ElectricalNode, n2::ElectricalNode, I::Signal)
789
790
end
790
791
```
791
792
792
- [ Sims/src/main.jl:713 ] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L713 )
793
+ [ Sims/src/main.jl:707 ] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L707 )
793
794
794
795
795
796
796
797
## RefDiscrete
797
798
798
799
A helper type for Discretes used in Arrays.
799
800
800
- [ Sims/src/main.jl:945 ] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L945 )
801
+ [ Sims/src/main.jl:939 ] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L939 )
801
802
802
803
803
804
@@ -812,7 +813,7 @@ with `getindex`. Defined methods include:
812
813
* hcat
813
814
* vcat
814
815
815
- [ Sims/src/main.jl:528 ] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L528 )
816
+ [ Sims/src/main.jl:522 ] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L522 )
816
817
817
818
818
819
@@ -824,7 +825,8 @@ When the event is triggered, the model is re-flattened after replacing
824
825
` default ` with ` new_relation ` in the model.
825
826
826
827
``` julia
827
- StructuralEvent (condition:: MExpr , default, new_relation:: Function )
828
+ StructuralEvent (condition:: MExpr , default, new_relation:: Function ,
829
+ pos_response, neg_response)
828
830
```
829
831
830
832
### Arguments
@@ -834,6 +836,11 @@ StructuralEvent(condition::MExpr, default, new_relation::Function)
834
836
* ` default ` : the default Model used
835
837
* ` new_relation ` : a function that returns a model that will replace
836
838
the default model when the condition triggers the event.
839
+ * ` pos_response ` : an expression indicating what to do when the
840
+ condition crosses zero positively. Defaults to Equation[ ] .
841
+ * ` neg_response::Model ` : an expression indicating what to do when the
842
+ condition crosses zero in the negative direction. Defaults to
843
+ Equation[ ] .
837
844
838
845
### Examples
839
846
@@ -879,15 +886,15 @@ end
879
886
p_y = sim (BreakingPendulum (), 6.0 )
880
887
```
881
888
882
- [ Sims/src/main.jl:1289 ] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L1289 )
889
+ [ Sims/src/main.jl:1291 ] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L1291 )
883
890
884
891
885
892
886
893
## UnknownCategory
887
894
888
895
Categories of Unknown types; used to subtype Unknowns.
889
896
890
- [ Sims/src/main.jl:147] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L147 )
897
+ [ Sims/src/main.jl:147] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L147 )
891
898
892
899
893
900
@@ -896,7 +903,7 @@ Categories of Unknown types; used to subtype Unknowns.
896
903
An abstract type for variables to be solved. Examples include Unknown,
897
904
DerUnknown, and Parameter.
898
905
899
- [ Sims/src/main.jl:142] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L142 )
906
+ [ Sims/src/main.jl:142] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L142 )
900
907
901
908
902
909
@@ -956,5 +963,5 @@ Unknown{T}(s::Symbol, x)
956
963
a * b + b^ 2
957
964
```
958
965
959
- [ Sims/src/main.jl:210] ( https://github.com/tshort/Sims.jl/tree/d39a15c1969c6fad87a4a7ab7f25088963690512 /src/main.jl#L210 )
966
+ [ Sims/src/main.jl:210] ( https://github.com/tshort/Sims.jl/tree/558b12477832ec70e2baee9b22bfbfb2b68aae57 /src/main.jl#L210 )
960
967
0 commit comments