-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontrol_theory1.py
More file actions
2218 lines (1743 loc) · 83.3 KB
/
control_theory1.py
File metadata and controls
2218 lines (1743 loc) · 83.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import pyirk as p
# noinspection PyUnresolvedReferences
from ipydex import IPS, activate_ips_on_exception # noqa
ma = p.irkloader.load_mod_from_path("./math1.py", prefix="ma")
ag = ma.ag
# todo: rename .scope("context") to .scope("setting")
__URI__ = "irk:/ocse/0.2/control_theory"
keymanager = p.KeyManager()
p.register_mod(__URI__, keymanager)
p.start_mod(__URI__)
I5948 = p.create_item(
R1__has_label="dynamical system",
R2__has_description="system with the capability to change over time, optionally with explicit input and/or output",
R4__is_instance_of=p.I2["Metaclass"], # this means: this Item is an ordinary class
)
I7641 = p.create_item(
R1__has_label="general system model",
R2__has_description="model of a dynamical system",
R4__is_instance_of=p.I2["Metaclass"],
)
R7641 = p.create_relation(
R1__has_label="has approximation",
R2__has_description="object or class which is an approximation of a dynamical system",
R8__has_domain_of_argument_1=I5948["dynamical system"],
R11__has_range_of_result=I7641["general system model"],
)
I4466 = p.create_item(
R1__has_label="Systems Theory",
R2__has_description="academic field; might be regarded as part of applied mathematics",
R4__is_instance_of=p.I3["Field of science"],
R5__is_part_of=[p.I4["Mathematics"], p.I5["Engineering"]],
)
R1001 = p.create_relation(
R1__has_label="studies", R2__has_description="object or class which an academic field studies"
)
I4466["Systems Theory"].set_relation(R1001["studies"], I5948["dynamical system"])
R4347 = p.create_relation(
R1__has_label="has context",
R2__has_description="establishes the context of a statement",
# R8__has_domain_of_argument_1=I7723("general mathematical proposition"),
# R11__has_range_of_result=<!! container of definition-items>
)
R4348 = p.create_relation(
R1__has_label="has premise",
R2__has_description="establishes the premise (if-part) of an implication",
R8__has_domain_of_argument_1=p.I15["implication proposition"],
# R11__has_range_of_result=<!! container of statements>
)
R4349 = p.create_relation(
R1__has_label="has assertion",
R2__has_description="establishes the assertion (then-part) of an implication",
R8__has_domain_of_argument_1=p.I15["implication proposition"],
# R11__has_range_of_result=<!! container of statements>
)
R9125 = p.create_relation(
R1__has_label="has input dimension",
R8__has_domain_of_argument_1=I7641["general system model"],
R11__has_range_of_result=p.I38["non-negative integer"],
R22__is_functional=True,
)
R8978 = p.create_relation(
R1__has_label="has output dimension",
R8__has_domain_of_argument_1=I7641["general system model"],
R11__has_range_of_result=p.I38["non-negative integer"],
R22__is_functional=True,
)
I1793 = p.create_item(
R1__has_label="general model representation property",
R2__has_description="general property of the representation of a model of a dynamical system \
(not an intrinsic system property)",
R4__is_instance_of=p.I54["mathematical property"],
)
I2928 = p.create_item(
R1__has_label="general model representation",
R2__has_description="general (mathematical) representation of a model of a dynamical system",
R3__is_subclass_of=p.I12["mathematical object"],
)
R2928 = p.create_relation(
R1__has_label="has model representation",
R2__has_description="system model has a mathematical representation",
R8__has_domain_of_argument_1=I7641["general system model"],
R11__has_range_of_result=I2928["general model representation"],
)
R5100 = p.create_relation(
R1__has_label="has model representation property",
R2__has_description="model representation has mathematical property",
R8__has_domain_of_argument_1=I2928["general model representation"],
R11__has_range_of_result=I1793["general model representation property"],
)
R2279 = p.create_relation(
R1__has_label="does not have model representation property",
R2__has_description="model representation does not have mathematical property",
R8__has_domain_of_argument_1=I2928["general model representation"],
R11__has_range_of_result=I1793["general model representation property"],
)
I6886 = p.create_item(
R1__has_label="general ode state space representation",
R2__has_description="explicit ODE system description of a dynamical system",
R3__is_subclass_of=I2928["general model representation"],
# TODO: this has to use create_equation (to be implemented)
R6__has_defining_mathematical_relation=p.create_expression(r"$\dot x = f(x, u)$"),
)
R2112 = p.create_relation(
R1__has_label="has state dimension",
R2__has_description="number of components of the state vector",
R8__has_domain_of_argument_1=I6886["general ode state space representation"],
R11__has_range_of_result=p.I38["non-negative integer"],
)
I6850 = p.create_item(
R1__has_label="state space model representation",
R2__has_description="explicit state space model of a dynamical system",
R3__is_subclass_of=I6886["general ode state space representation"],
# TODO: this has to use create_equation (to be implemented)
R6__has_defining_mathematical_relation=p.create_expression(r"$\dot x = Ax + Bu$"),
# TODO: Rule, system order = 1
)
R7178 = p.create_relation(
R1__has_label="has number of degrees of freedom",
R2__has_description=(
"number of independent parameters that define its configuration in space; applicable to mechanical systems"
),
R8__has_domain_of_argument_1=I7641["general system model"],
R11__has_range_of_result=p.I38["non-negative integer"],
R33__has_corresponding_wikidata_entity="https://www.wikidata.org/entity/Q2480745"
# TODO: add formal comment to clarify the conflicting usages of language:
# "degree of freedom" vs. "number of degrees of freedom"
)
I5356 = p.create_item(
R1__has_label="general system property",
R2__has_description="general property of a model of a dynamical system (not of its representation)",
R4__is_instance_of=p.I2["Metaclass"],
)
R8303 = p.create_relation(
R1__has_label="has general system property",
R2__has_description="model has mathematical property",
R8__has_domain_of_argument_1=I7641["general system model"],
R11__has_range_of_result=I5356["general system property"],
)
R6458 = p.create_relation(
R1__has_label="does not have general system property",
R2__has_description="model does not have mathematical property",
R8__has_domain_of_argument_1=I7641["general system model"],
R11__has_range_of_result=I5356["general system property"],
)
I5357 = p.create_item(
R1__has_label="differential flatness",
R4__is_instance_of=I5356["general system property"],
R2__has_description="differential flatness",
)
I5358 = p.create_item(
R1__has_label="exact input-to-state linearizability",
R4__is_instance_of=I5356["general system property"],
# TODO: it might be necessary to restrict this to ode-state-space-systems
R2__has_description="exact input-to-state linearizability (via static state feedback)",
)
I7178 = p.create_item(
R1__has_label="local strong accessibility",
R4__is_instance_of=I5356["general system property"],
R2__has_description="local strong accessibility",
# TODO: put this in relation to controllability
)
"""
def create_I5847():
R1__has_label = "Equivalence of flat systems and exact input-to-state linearizable systems"
R4__is_instance_of = c.I15["implication proposition"]
R2__has_description = (
"Establishes that differentially flat systems and exact input-to-state linearizable systems "
"are equivalent in the SISO case"
)
def R4347__has_context():
ctx = c.Context()
ctx.sys = c.generic_instance(I6886["general_ode_state_space_representation"])
c.set_restriction(ctx.sys, R9125["has input dimension"], 1)
return ctx
def R4348__has_premise(ctx: c.Context):
ctx.sys.R
def R4349__has_assertion():
pass
return c.create_item_from_namespace()
I5847 = create_I5847()
"""
# attempt without writing code
I2640 = p.create_item(
R1__has_label="transfer function representation",
R2__has_description="...",
R4__is_instance_of=p.I2["Metaclass"],
)
p.R37["has definition"].set_relation(p.R8["has domain of argument 1"], p.I12["mathematical object"])
R5323 = p.create_relation(
R1__has_label="has denominator",
R2__has_description="...",
R8__has_domain_of_argument_1=ma.I4237["monovariate rational function"],
R11__has_range_of_result=ma.I4239["abstract monovariate polynomial"],
)
R5334 = p.create_relation(
R1__has_label="has representation",
R2__has_description="relates an entity with an abstract mathematical representation",
# R8__has_domain_of_argument_1= ...
R11__has_range_of_result=p.I12["mathematical object"],
)
I8181 = p.create_item(
R1__has_label="properness",
R2__has_description=(
"applicable to monovariate rational functions; "
"satisfied if degree of denominator is not smaller than degree of numerator"
),
R4__is_instance_of=p.I54["mathematical property"],
)
I8182 = p.create_item(
R1__has_label="strict properness",
R2__has_description="satisfied if degree of denominator is greater than degree of numerator",
R17__is_subproperty_of=I8181["properness"],
)
# I7206 = p.create_item(
# R1__has_label="system-dynamical property",
# R2__has_description="base class for all system-dynamical properties",
# R3__is_subclass_of=p.I54["mathematical property"],
# )
I7207 = p.create_item(
R1__has_label="stability",
R2__has_description="tendency to stay close to some distinguished trajectory (e.g. equilibrium)",
R4__is_instance_of=p.I54["mathematical property"],
)
I7599 = p.create_item(
R1__has_label="instability",
R2__has_description="tendency to not stay close to some distinguished trajectory (e.g. equilibrium)",
# TODO: description not ideal
R4__is_instance_of=p.I54["mathematical property"],
R43__is_opposite_of=I7207["stability"],
)
# todo: this entity should be made more precise whether it is global or local
I7208 = p.create_item(
R1__has_label="BIBO stability",
R2__has_description=(
"'bounded-input bounded-output stability'; "
"satisfied if the system responds to every bounded input signal with a bounded output signal"
),
R17__is_subproperty_of=I7207["stability"],
)
I4975 = p.create_item(
R1__has_label="general algebraic equation",
R2__has_description="explicit algebraic equation",
R3__is_subclass_of=p.I18["mathematical expression"],
# TODO: this has to use create_equation (to be implemented)
R6__has_defining_mathematical_relation=p.create_expression(r"$0 = f(x)$"),
)
I2865 = p.create_item(
R1__has_label="differential algebraic system of equation",
R2__has_description="system of differential algebraic equations representing a dynamical system",
R3__is_subclass_of=I2928["general model representation"],
R6__has_defining_mathematical_relation=p.create_expression(r"$0 = f(\dot{x}, x, t)$"),
# TODO make connection to ode and algebraic equation
)
I2562 = p.create_item(
R1__has_label="general property of pde",
R2__has_description="general property of partial differential equations",
R3__is_subclass_of=I1793["general model representation property"],
)
I8063 = p.create_item(
R1__has_label="partial differential equation",
R2__has_description="explicit partial differential equation",
R3__is_subclass_of=I2928["general model representation"],
)
R5718 = p.create_relation(
R1__has_label="has general pde property",
R2__has_description="pde has mathematical property",
R8__has_domain_of_argument_1=I8063["partial differential equation"],
R11__has_range_of_result=I2562["general property of pde"],
)
I9964 = p.create_item(
R1__has_label="strict nonlinearity",
R2__has_description="states that the pde",
R17__is_subproperty_of=I2562["general property of pde"],
)
I2557 = p.create_item(
R1__has_label="quasilinearity",
R2__has_description="states that in a pde the highest order derivatives appear linearly, with their coefficients \
being functions of the independent variables and their (lower order) derivatives",
R17__is_subproperty_of=I2562["general property of pde"],
)
I3114 = p.create_item(
R1__has_label="semilinearity",
R2__has_description="states that in a pde the highest order derivatives appear linearly, with their coefficients \
being functions of only the independent variables",
R17__is_subproperty_of=I2557["quasilinearity"],
)
I3863 = p.create_item(
R1__has_label="linearity",
R2__has_description="states that in a pde the unknown function and all its derivatives appear linearly, with their coefficients \
being functions of only the independent variables",
R17__is_subproperty_of=I3114["semilinearity"],
)
I5325 = p.create_item(
R1__has_label="Hurwitz polynomial",
R2__has_description="monovariate polynomial of quadratic matrices",
R3__is_subclass_of=ma.I4239["abstract monovariate polynomial"],
)
# <definition>
I4455 = p.create_item(
R1__has_label="definition of Hurwitz polynomial",
R2__has_description="the defining statement of what a Hurwitz polynomial is",
R4__is_instance_of=p.I20["mathematical definition"],
)
with I4455.scope("setting") as cm:
cm.new_var(P=p.uq_instance_of(ma.I4239["abstract monovariate polynomial"]))
cm.new_var(set_of_roots=p.instance_of(ma.I5484["finite set of complex numbers"]))
cm.new_rel(cm.P, ma.R1757["has set of roots"], cm.set_of_roots)
with I4455.scope("premise") as cm:
cm.new_rel(cm.set_of_roots, p.R14["is subset of"], ma.I2739["open left half plane"])
with I4455.scope("assertion") as cm:
# TODO: this should be something like p.R000["is instances of by definition"]
cm.new_rel(cm.P, p.R30["is secondary instance of"], I5325["Hurwitz polynomial"])
I5325["Hurwitz polynomial"].set_relation(p.R37["has definition"], I4455["definition of Hurwitz polynomial"])
# </definition>
# TODO: open question should I3007["stability theorem for a rational transfer function"] be constructed by using I5325["Hurwitz polynomial"]
# con: BIBO-stability might be meaningful also for transfer functions with non-polynomial denominators
# <theorem>
# todo this should be an equivalence instead of an implication
I3007 = p.create_item(
R1__has_label="stability theorem for a rational transfer function",
R2__has_description="establishes the relation between BIBO-Stability and the poles of the transfer function",
R4__is_instance_of=p.I15["implication proposition"],
)
with I3007.scope("setting") as cm:
cm.new_var(sys=p.uq_instance_of(I7641["general system model"]))
cm.new_var(tf_rep=p.instance_of(I2640["transfer function representation"]))
cm.new_var(denom=p.instance_of(ma.I4239["abstract monovariate polynomial"]))
cm.new_var(set_of_poles=p.instance_of(ma.I5484["finite set of complex numbers"]))
cm.new_rel(cm.sys, R5334["has representation"], cm.tf_rep)
cm.new_rel(cm.tf_rep, R5323["has denominator"], cm.denom)
cm.new_rel(cm.denom, ma.R1757["has set of roots"], cm.set_of_poles)
with I3007.scope("premise") as cm:
cm.new_rel(cm.set_of_poles, p.R14["is subset of"], ma.I2739["open left half plane"])
cm.new_rel(cm.tf_rep, p.R16["has property"], I8181["properness"])
with I3007.scope("assertion") as cm:
cm.new_rel(cm.sys, p.R16["has property"], I7208["BIBO stability"])
# </theorem>
# todo: find the context of this and reformulate as IntegerRangeSequence
# p.Sequence("y", p._I000["time derivative of order i"], link_op=p._I000["listing"], start=0, stop="k")
# → it would be nice if one could interactively execute/write out such a sequence for given variable values
I4349 = p.create_item(
R1__has_label="equivalence of flatness and input-state-linearizability for SISO systems",
R2__has_description="establishes the equivalence of flatness and input-state-linearizability for SISO systems",
R4__is_instance_of=p.I15["implication proposition"],
)
# </theorem>
# <statement preparation>
I2277 = p.create_item(
R1__has_label="statement",
R2__has_description=(
"models an 'ordinary statement' e.g. of a publication which is not distinguished as a formal theorem"
),
R3__is_subclass_of=p.I15["implication proposition"],
)
# </statement preparation>
# <statement>
# source: A software framework for embedded nonlinear model predictive control using a gradient‐based augmented Lagrangian approach (GRAMPC)
# source doi: https://doi.org/10.1007/s11081-018-9417-2
# this is still unfinished work in progress:
I4216 = p.create_item(
R1__has_label="statement about MPC for linear systems and the reducibility to quadratic problems",
R2__has_description=(
"for linear systems, the MPC problem can be reduced to a quadratic problem, for which the optimal control"
"over the admissible polyhedral set can be precomputed."
),
R4__is_instance_of=I2277["statement"],
)
with I4216.scope("setting") as cm:
cm.new_var(sys=p.instance_of(I5948["dynamical system"]))
cm.new_var(state_space_sys=p.instance_of(I6886["general ode state space representation"]))
cm.new_var(mpc_problem=p.instance_of(I5948["dynamical system"]))
cm.new_var(quadratic_problem=p.instance_of(I5948["dynamical system"]))
cm.new_var(mathematical_solution=p.instance_of(I5948["dynamical system"]))
cm.new_var(optimal_control_law=p.instance_of(I5948["dynamical system"]))
cm.new_rel(cm.mpc_problem, p.R000["refers to"], cm.sys)
with I4216.scope("premise") as cm:
cm.new_rel(cm.sys, p.R000["refers to"], cm.sys)
with I4216.scope("assertion") as cm:
cm.new_rel(cm.mpc_problem, p.R000["can be reduced to"], cm.quadratic_problem)
"""
Particularly for linear systems, the MPC problem can be reduced to a quadratic
problem, for which the optimal control over the admissible polyhedral set can be
precomputed.
"""
# </statement>
# defined in math because positive definiteness etc depends on it
assert ma.R5405["has associated state space"]
assert ma.I1168["point in state space"]
I9273 = p.create_item(
R1__has_label="explicit first order ODE system",
R2__has_description="system of explicit first order ordinary differential equations",
R3__is_subclass_of=p.I12["mathematical object"],
R41__has_required_instance_relation=ma.R5405["has associated state space"]
# TODO: make explicit the relation to I6886["general ode state space representation"]
)
R4122 = p.create_relation(
R1__has_label="has associated drift vector field",
R2__has_description=(
"specifies the associated drift vector field of the subject "
"(e.g. a I9273__explicit...ode_system)"
),
R8__has_domain_of_argument_1=I9273["explicit first order ODE system"],
R11__has_range_of_result=ma.I9841["vector field"],
R22__is_functional=True,
)
# add this relation to the required relations
I9273["explicit first order ODE system"].set_relation(
p.R41["has required instance relation"], R4122["has associated drift vector field"]
)
I2753 = p.create_item(
R1__has_label="flow of a vector field",
R2__has_description="operator yielding the solution of the associated I9273__explicit_first_order_ODE_system",
# this is an instance and not a subclass because there is only one flow operator
R4__is_instance_of=ma.I4895["mathematical operator"],
R8__has_domain_of_argument_1=ma.I1168["point in state space"],
R9__has_domain_of_argument_2=p.I35["real number"],
R10__has_domain_of_argument_3=I9273["explicit first order ODE system"],
R11__has_range_of_result=ma.I1168["point in state space"],
# TODO: display and evaluate this notation
# (\cdot_i) means: the i-th argument
R13__has_canonical_symbol=r"$\varphi_{(\cdot_2)}^{(\cdot_3)}(\cdot_1)$",
)
# TODO: find a way to assign labels to the arguments: "initial value x", "time t", "vector field f"
I4122 = p.create_item(
R1__has_label="independent variable",
R2__has_description="type for an independent variable",
R3__is_subclass_of=p.I18["mathematical expression"],
)
I3513 = p.create_item(
R1__has_label="derivative w.r.t. scalar parameter",
R2__has_description="operator yielding the derivative of an expression w.r.t. a parameter",
R4__is_instance_of=ma.I4895["mathematical operator"],
R8__has_domain_of_argument_1=p.I18["mathematical expression"],
R9__has_domain_of_argument_2=I4122["independent variable"],
R11__has_range_of_result=p.I18["mathematical expression"],
R13__has_canonical_symbol=r"$\frac{d}{d(\cdot_2}) (\cdot_1)$",
)
I2075 = p.create_item(
R1__has_label="substitution",
R2__has_description=(
"operator yielding an new expression where in expression arg1 the subexpression arg2 is replaced by arg3"
),
R4__is_instance_of=ma.I4895["mathematical operator"],
R8__has_domain_of_argument_1=p.I18["mathematical expression"],
R9__has_domain_of_argument_2=p.I18["mathematical expression"],
R10__has_domain_of_argument_3=p.I18["mathematical expression"],
R11__has_range_of_result=p.I18["mathematical expression"],
R13__has_canonical_symbol=r"$\left.(\cdot_1)\left|_{(\cdot_2)=(\cdot_3)}$",
)
I1347 = p.create_item(
R1__has_label="Lie derivative of scalar field",
R2__has_description=(
"mathematical operation wich maps a scalar field h_1 to a new scalar field h_2, depending on a vector field f; "
"h2 can be interpreted as the time derivative of h_1 along the solution of the ode associated with f; "
"in other words: along the flow of f"
),
R4__is_instance_of=ma.I4895["mathematical operator"],
R8__has_domain_of_argument_1=ma.I9923["scalar field"],
R9__has_domain_of_argument_2=ma.I9841["vector field"],
# R10__has_domain_of_argument_3=ma.I1168["point in state space"],# todo remove argument
R11__has_range_of_result=ma.I9923["scalar field"],
R13__has_canonical_symbol=r"$L$",
# TODO: complete defining equation
ag__R6876__is_named_after=ag.I4853["Sophus Lie"],
)
# <definition>
I6229 = p.create_item(
R1__has_label="definition of Lie derivative of scalar field",
R2__has_description="the defining statement of a Lie derivative of a scalar field",
R4__is_instance_of=p.I20["mathematical definition"],
)
with I6229["definition of Lie derivative of scalar field"].scope("setting") as cm:
h = cm.new_var(h=p.uq_instance_of(ma.I9923["scalar field"]))
M = cm.new_var(M=p.instance_of(ma.I5167["state space"]))
n = cm.new_var(n=p.instance_of(p.I39["positive integer"]))
cm.new_rel(cm.M, ma.R3326["has dimension"], cm.n)
cm.new_rel(cm.h, ma.R5405["has associated state space"], cm.M)
# TODO: this should be more specific (related to cm.M)
# h.R8__has_domain_of_argument_1 = ma.I1168["point in state space"]
# TODO: __automate_typing__
# h.R11__has_range_of_result = p.I35["real number"]
ode_sys = cm.new_var(ode_sys=p.instance_of(I9273["explicit first order ODE system"]))
cm.new_rel(cm.ode_sys, ma.R5405["has associated state space"], cm.M)
f = cm.new_var(f=p.instance_of(ma.I9841["vector field"]))
cm.new_rel(cm.ode_sys, R4122["has associated drift vector field"], cm.f)
x = cm.new_var(x=p.instance_of(ma.I1168["point in state space"]))
# TODO: check
cm.new_rel(cm.x, p.R15["is element of"], M)
t = cm.new_var(t=p.instance_of(I4122["independent variable"]))
# TODO: __automate_typing__
t.R30__is_secondary_instance_of = p.I35["real number"]
# evaluate the mappings
phi = I2753["flow of a vector field"](x, t, ode_sys)
h_evaluated = h(phi)
# TODO: __automate_typing__
h_evaluated.R30__is_secondary_instance_of = ma.p.I18["mathematical expression"]
# perform the derivative
deriv_evaluated = I3513["derivative w.r.t. scalar parameter"](h_evaluated, t)
# some auxiliary expressions are stored as attributes of the parent item of the cm
cm.item.subs = I2075["substitution"](deriv_evaluated, t, ma.I5000["scalar zero"])
cm.item.L_evaluated = I1347["Lie derivative of scalar field"](h, f)
with I6229.scope("assertion") as cm:
# TODO: encode the directional character of this equation (lhs := rhs)
cm.new_equation(lhs=cm.L_evaluated(x), rhs=cm.subs)
I1347["Lie derivative of scalar field"].set_relation(
p.R37["has definition"], I6229["definition of Lie derivative of scalar field"]
)
# </definition>
I1371 = p.create_item(
R1__has_label="iterated Lie derivative of scalar field",
R2__has_description="iterated version of I1347__Lie_derivative_of_scalar_field",
R3__is_subclass_of=ma.I4895["mathematical operator"],
R8__has_domain_of_argument_1=ma.I9923["scalar field"],
R9__has_domain_of_argument_2=ma.I9841["vector field"],
R10__has_domain_of_argument_3=p.I38["non-negative integer"],
R11__has_range_of_result=ma.I9923["scalar field"],
# TODO: add defining equation
)
# <definition>
I8302 = p.create_item(
R1__has_label="definition of iterated Lie derivative of scalar field",
R2__has_description=("the defining statement of " "I1371['iterated Lie derivative of scalar field']"),
R4__is_instance_of=p.I20["mathematical definition"],
)
with I8302["definition of iterated Lie derivative of scalar field"].scope("setting") as cm:
n = cm.new_var(n=p.uq_instance_of(p.I39["positive integer"]))
M = cm.new_var(M=p.uq_instance_of(ma.I5167["state space"]))
h = cm.new_var(h=p.uq_instance_of(ma.I9923["scalar field"]))
f = cm.new_var(f=p.uq_instance_of(ma.I9841["vector field"]))
# TODO: complete definition
# </definition>
# < Model Properties>
# reminder of already existing entities
assert I5356["general system property"]
assert I5357["differential flatness"]
assert I5358["exact input-to-state linearizability"]
assert p.R17["is subproperty of"]
I4101 = p.create_item(
R1__has_label="general time variance",
R2__has_description="states that the model of a dynamical system (i.e. its parameters) might change over time",
R4__is_instance_of=I5356["general system property"],
)
I7733 = p.create_item(
R1__has_label="time invariance",
R2__has_description="states that the model of a dynamical system (i.e. its parameters) does not change over time",
R4__is_instance_of=I5356["general system property"],
R17__is_subproperty_of=I4101["general time variance"],
R77__has_alternative_label="autonomy",
)
I9030 = p.create_item(
R1__has_label="strict time variance",
R2__has_description="states that the model of a dynamical system (i.e. its parameters) do change over time",
R4__is_instance_of=I5356["general system property"],
R17__is_subproperty_of=I4101["general time variance"],
R43__is_opposite_of=I7733["time invariance"],
)
I9210 = p.create_item(
R1__has_label="stabilizability",
R2__has_description="states that for the model of a dynamical system there exists a state feedback such that the \
system is stable",
R4__is_instance_of=I5356["general system property"],
)
I7864 = p.create_item(
R1__has_label="controllability",
R2__has_description="states that the state of the model of a dynamical system can be changed from any arbitrary \
starting state to any desired state in a finite amount of time using an external input",
R4__is_instance_of=I5356["general system property"],
R17__is_subproperty_of=I9210["stabilizability"],
)
I9853 = p.create_item(
R1__has_label="detectability",
R2__has_description="states that all unobservable state components of the model of a dynamical system are \
stable",
R4__is_instance_of=I5356["general system property"],
)
I3227 = p.create_item(
R1__has_label="observability",
R2__has_description="states that all state components of the model of a dynamical system can be reconstructed using\
only information of the system outputs",
R4__is_instance_of=I5356["general system property"],
R17__is_subproperty_of=I9853["detectability"],
)
I3321 = p.create_item(
R1__has_label="minimum phase",
R2__has_description="states that the model of a dynamical system has stable zero dynamics",
R4__is_instance_of=I5356["general system property"],
)
I2827 = p.create_item(
R1__has_label="general nonlinearity",
R2__has_description="states that the system model equations might not be linear",
R4__is_instance_of=I1793["general model representation property"],
)
I6091 = p.create_item(
R1__has_label="control affine",
R2__has_description="states that in the system model equations the input only appears linearly",
R4__is_instance_of=I1793["general model representation property"],
R6__has_defining_mathematical_relation=p.create_expression(r"$\dot{x}=f(x)+g(x)u$"),
R17__is_subproperty_of=I2827["general nonlinearity"],
)
I5247 = p.create_item(
R1__has_label="polynomial",
R2__has_description="states that the system model equations are polynomial w.r.t. the state components",
R4__is_instance_of=I1793["general model representation property"],
R17__is_subproperty_of=I6091["control affine"],
)
I4761 = p.create_item(
R1__has_label="linearity",
R2__has_description="states that the system model equations are linear",
R4__is_instance_of=I1793["general model representation property"],
R17__is_subproperty_of=I5247["polynomial"],
)
I1898 = p.create_item(
R1__has_label="lti",
R2__has_description="states that the system model is linear and time-invariant",
R4__is_instance_of=I5356["general system property"],
R17__is_subproperty_of=[I4761["linearity"], I7733["time invariance"]],
)
I4478 = p.create_item(
R1__has_label="strict nonlinearity",
R2__has_description="states that the system model equations are not linear",
R4__is_instance_of=I1793["general model representation property"],
R17__is_subproperty_of=I2827["general nonlinearity"],
R43__is_opposite_of=I4761["linearity"],
)
I8978 = p.create_item(
R1__has_label="time continuity",
R2__has_description="states that the system is modeled continuously",
R4__is_instance_of=I1793["general model representation property"],
)
I5031 = p.create_item(
R1__has_label="time discreteness",
R2__has_description="states that the system is modeled discretely",
R4__is_instance_of=I1793["general model representation property"],
R43__is_opposite_of=I8978["time continuity"],
)
I5718 = p.create_item(
R1__has_label="autonomy",
R2__has_description="states that the model of a dynamical system is autonomous",
R4__is_instance_of=I5356["general system property"],
# TODO rule with R9125["has input dimension"] 0
)
I5236 = p.create_item(
R1__has_label="general trajectory property",
R2__has_description="general property of a trajectory",
R4__is_instance_of=p.I54["mathematical property"],
)
I7062 = p.create_item(
R1__has_label="trajectory",
R2__has_description="solution to a differential equation",
R3__is_subclass_of=p.I12["mathematical object"],
)
R7062 = p.create_relation(
R1__has_label="has general trajectory property",
R2__has_description="trajectory has mathematical property",
R8__has_domain_of_argument_1=I7062["trajectory"],
R11__has_range_of_result=I5236["general trajectory property"],
)
R5031 = p.create_relation(
R1__has_label="has trajectory",
R2__has_description="object or class has a trajectory",
R8__has_domain_of_argument_1=I7641["general system model"],
R11__has_range_of_result=I7062["trajectory"],
)
I9820 = p.create_item(
R1__has_label="equilibrium point",
R2__has_description="constant solution to a differential equation",
R3__is_subclass_of=I7062["trajectory"],
)
I1664 = p.create_item(
R1__has_label="limit cycle",
R2__has_description="closed trajectory which other trajectories spiral into or out of",
R3__is_subclass_of=I7062["trajectory"],
)
R3898 = p.create_relation(
R1__has_label="has system order",
R2__has_description="highest time derivative present in the system equations",
R8__has_domain_of_argument_1=I2928["general model representation"],
R11__has_range_of_result=p.I38["non-negative integer"],
R22__is_functional=True,
)
R6134 = p.create_relation(
R1__has_label="has highest time derivative",
R2__has_description="the highest time derivative occurring in the model equations",
R8__has_domain_of_argument_1=I7641["general system model"],
R11__has_range_of_result=p.I38["non-negative integer"],
R22__is_functional=True,
)
# Lyapunov stability
I5082 = p.create_item(
R1__has_label="local attractiveness",
R2__has_description="states that all trajectories that start close enough to the trajectory in consideration will \
converge to it",
R4__is_instance_of=I5236["general trajectory property"],
)
I8059 = p.create_item(
R1__has_label="global attractiveness",
R2__has_description="states that all trajectories will converge to the trajectory in consideration",
R4__is_instance_of=I5236["general trajectory property"],
R17__is_subproperty_of=I5082["local attractiveness"],
)
I2931 = p.create_item(
R1__has_label="local Lyapunov stability",
R2__has_description="states that all trajectories that start close enough to the equilibrium will not leave a \
certain neighborhood",
R4__is_instance_of=I5236["general trajectory property"],
R17__is_subproperty_of=I7207["stability"],
ag__R6876__is_named_after=ag.I2151["Aleksandr Lyapunov"],
)
I8744 = p.create_item(
R1__has_label="global Lyapunov stability",
R2__has_description="states that all trajectories will not leave a certain neighborhood around the equilibrium",
R4__is_instance_of=I5236["general trajectory property"],
R17__is_subproperty_of=I2931["local Lyapunov stability"],
ag__R6876__is_named_after=ag.I2151["Aleksandr Lyapunov"],
)
I4900 = p.create_item(
R1__has_label="local asymptotic stability",
R2__has_description="states that all trajectories that start close enough to the equilibrium remain close enough \
and will converge to it",
R4__is_instance_of=I5236["general trajectory property"],
R17__is_subproperty_of=[I2931["local Lyapunov stability"], I5082["local attractiveness"]],
)
I5677 = p.create_item(
R1__has_label="global asymptotic stability",
R2__has_description="states that all trajectories remain close enough to the equilibrium and will converge to it",
R4__is_instance_of=I5236["general trajectory property"],
R17__is_subproperty_of=[
I8744["global Lyapunov stability"],
I8059["global attractiveness"],
I4900["local asymptotic stability"],
],
)
I9642 = p.create_item(
R1__has_label="local exponential stability",
R2__has_description="states that an equilibrium is locally asymptotically stable and all trajectories converge at \
least exponentially fast",
R4__is_instance_of=I5236["general trajectory property"],
R17__is_subproperty_of=I4900["local asymptotic stability"],
)
I5100 = p.create_item(
R1__has_label="global exponential stability",
R2__has_description="states that an equilibrium is globally asymptotically stable and all trajectories converge at \
least exponentially fast",
R4__is_instance_of=I5236["general trajectory property"],
R17__is_subproperty_of=[I5677["global asymptotic stability"], I9642["local exponential stability"]],
)
I8303 = p.create_item(
R1__has_label="strict Lyapunov instability",
R2__has_description="states that some trajectories that start close enough to the equilibrium will still leave a \
certain neighborhood",
R4__is_instance_of=I5236["general trajectory property"],
R43__is_opposite_of=I2931["local Lyapunov stability"],
ag__R6876__is_named_after=ag.I2151["Aleksandr Lyapunov"],
)
I9304 = p.create_item(
R1__has_label="knot",
R2__has_description="states that the phase portrait forms a knot near the equilibrium point",
R4__is_instance_of=I5236["general trajectory property"],
# rule system order=2,
)
I6467 = p.create_item(
R1__has_label="saddle",
R2__has_description="states that the phase portrait forms a saddle near the equilibrium point",
R4__is_instance_of=I5236["general trajectory property"],
# rule system order=2,
# TODO: Implement rule that saddle is always unstable
)
I4610 = p.create_item(
R1__has_label="spiral",
R2__has_description="states that the phase portrait forms a spiral near the equilibrium point",
R4__is_instance_of=I5236["general trajectory property"],
# rule system order=2,
)
I3241 = p.create_item(
R1__has_label="chaotic behavior",
R2__has_description="states that small deviations in the initial conditions result in qualitative changes in the \
trajectory",
R4__is_instance_of=I5236["general trajectory property"],
)
I1779 = p.create_item(
R1__has_label="driftlessness",
R2__has_description="states that the drift term of an input affine system is always 0",
R4__is_instance_of=I1793["general model representation property"],
R17__is_subproperty_of=I6091["control affine"],
)
I4131 = p.create_item(
R1__has_label="domain",
R2__has_description="area of research",
R4__is_instance_of=p.I2["Metaclass"],
)
R8316 = p.create_relation(
R1__has_label="belongs to domain",
R2__has_description="states that the model of a dynamical system belongs to a specific domain",
R8__has_domain_of_argument_1=I7641["general system model"],
R11__has_range_of_result=I4131["domain"],
)
I4498 = p.create_item(
R1__has_label="artificial domain",
R2__has_description="domain containing research on the topic of artificial systems",
R4__is_instance_of=I4131["domain"],
)
I7667 = p.create_item(
R1__has_label="thermal domain",
R2__has_description="domain containing research on the topic of thermodynamics",