Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- ckpts/universal/global_step80/zero/16.mlp.dense_h_to_4h_swiglu.weight/exp_avg.pt +3 -0
- ckpts/universal/global_step80/zero/17.mlp.dense_h_to_4h_swiglu.weight/fp32.pt +3 -0
- ckpts/universal/global_step80/zero/22.mlp.dense_4h_to_h.weight/fp32.pt +3 -0
- ckpts/universal/global_step80/zero/6.input_layernorm.weight/exp_avg.pt +3 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/_antlr/__init__.py +5 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/_antlr/__pycache__/__init__.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/_antlr/__pycache__/autolevlexer.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/_antlr/__pycache__/autolevlistener.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/_antlr/__pycache__/autolevparser.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/_antlr/autolevlexer.py +253 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/_antlr/autolevlistener.py +421 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/_antlr/autolevparser.py +0 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/__pycache__/ruletest1.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/__pycache__/ruletest10.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/__pycache__/ruletest11.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/__pycache__/ruletest12.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/__pycache__/ruletest2.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/__pycache__/ruletest3.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/__pycache__/ruletest4.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/__pycache__/ruletest5.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/__pycache__/ruletest6.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/__pycache__/ruletest7.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/__pycache__/ruletest8.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/__pycache__/ruletest9.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/pydy-example-repo/__pycache__/chaos_pendulum.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/pydy-example-repo/__pycache__/double_pendulum.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/pydy-example-repo/__pycache__/mass_spring_damper.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/pydy-example-repo/__pycache__/non_min_pendulum.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/pydy-example-repo/chaos_pendulum.al +33 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/pydy-example-repo/chaos_pendulum.py +55 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/pydy-example-repo/double_pendulum.al +25 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/pydy-example-repo/double_pendulum.py +39 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/pydy-example-repo/mass_spring_damper.al +19 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/pydy-example-repo/mass_spring_damper.py +31 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/pydy-example-repo/non_min_pendulum.al +20 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/pydy-example-repo/non_min_pendulum.py +36 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/ruletest1.al +8 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/ruletest10.py +64 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/ruletest11.al +6 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/ruletest3.al +25 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/ruletest4.py +20 -0
- venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/ruletest9.al +54 -0
- venv/lib/python3.10/site-packages/sympy/parsing/tests/__init__.py +0 -0
- venv/lib/python3.10/site-packages/sympy/parsing/tests/__pycache__/__init__.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/parsing/tests/__pycache__/test_ast_parser.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/parsing/tests/__pycache__/test_autolev.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/parsing/tests/__pycache__/test_c_parser.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/parsing/tests/__pycache__/test_fortran_parser.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/parsing/tests/__pycache__/test_implicit_multiplication_application.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/parsing/tests/__pycache__/test_latex.cpython-310.pyc +0 -0
ckpts/universal/global_step80/zero/16.mlp.dense_h_to_4h_swiglu.weight/exp_avg.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9795e70767da9c3fcc8aae5278ff50957799a7dc2929b9530df8054d063e0a4c
|
3 |
+
size 33555612
|
ckpts/universal/global_step80/zero/17.mlp.dense_h_to_4h_swiglu.weight/fp32.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2b15e093b58549213dc7691ea1814c4ba947524222580b77fe566e311697b0b7
|
3 |
+
size 33555533
|
ckpts/universal/global_step80/zero/22.mlp.dense_4h_to_h.weight/fp32.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ec474ad4ac6bbf6d74e9f82bbf1013413a6fc405462b6f3b054eb8589872d113
|
3 |
+
size 33555533
|
ckpts/universal/global_step80/zero/6.input_layernorm.weight/exp_avg.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:810a525f37369ab3f3ebbcda1c9735572902eeef7d3a9cefdbef7f20b2078709
|
3 |
+
size 9372
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/_antlr/__init__.py
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# *** GENERATED BY `setup.py antlr`, DO NOT EDIT BY HAND ***
|
2 |
+
#
|
3 |
+
# Generated with antlr4
|
4 |
+
# antlr4 is licensed under the BSD-3-Clause License
|
5 |
+
# https://github.com/antlr/antlr4/blob/master/LICENSE.txt
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/_antlr/__pycache__/__init__.cpython-310.pyc
ADDED
Binary file (196 Bytes). View file
|
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/_antlr/__pycache__/autolevlexer.cpython-310.pyc
ADDED
Binary file (20.8 kB). View file
|
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/_antlr/__pycache__/autolevlistener.cpython-310.pyc
ADDED
Binary file (13.5 kB). View file
|
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/_antlr/__pycache__/autolevparser.cpython-310.pyc
ADDED
Binary file (94.5 kB). View file
|
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/_antlr/autolevlexer.py
ADDED
@@ -0,0 +1,253 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# *** GENERATED BY `setup.py antlr`, DO NOT EDIT BY HAND ***
|
2 |
+
#
|
3 |
+
# Generated with antlr4
|
4 |
+
# antlr4 is licensed under the BSD-3-Clause License
|
5 |
+
# https://github.com/antlr/antlr4/blob/master/LICENSE.txt
|
6 |
+
from antlr4 import *
|
7 |
+
from io import StringIO
|
8 |
+
import sys
|
9 |
+
if sys.version_info[1] > 5:
|
10 |
+
from typing import TextIO
|
11 |
+
else:
|
12 |
+
from typing.io import TextIO
|
13 |
+
|
14 |
+
|
15 |
+
def serializedATN():
|
16 |
+
return [
|
17 |
+
4,0,49,393,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,
|
18 |
+
2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,
|
19 |
+
13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,
|
20 |
+
19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,
|
21 |
+
26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,
|
22 |
+
32,2,33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38,2,
|
23 |
+
39,7,39,2,40,7,40,2,41,7,41,2,42,7,42,2,43,7,43,2,44,7,44,2,45,7,
|
24 |
+
45,2,46,7,46,2,47,7,47,2,48,7,48,2,49,7,49,2,50,7,50,1,0,1,0,1,1,
|
25 |
+
1,1,1,2,1,2,1,3,1,3,1,3,1,4,1,4,1,4,1,5,1,5,1,5,1,6,1,6,1,6,1,7,
|
26 |
+
1,7,1,7,1,8,1,8,1,8,1,9,1,9,1,10,1,10,1,11,1,11,1,12,1,12,1,13,1,
|
27 |
+
13,1,14,1,14,1,15,1,15,1,16,1,16,1,17,1,17,1,18,1,18,1,19,1,19,1,
|
28 |
+
20,1,20,1,21,1,21,1,21,1,22,1,22,1,22,1,22,1,23,1,23,1,24,1,24,1,
|
29 |
+
25,1,25,1,26,1,26,1,26,1,26,1,26,1,27,1,27,1,27,1,27,1,27,1,27,1,
|
30 |
+
27,1,27,1,28,1,28,1,28,1,28,1,28,1,28,3,28,184,8,28,1,29,1,29,1,
|
31 |
+
29,1,29,1,29,1,29,1,29,1,30,1,30,1,30,1,30,1,30,1,31,1,31,1,31,1,
|
32 |
+
31,1,31,1,31,1,31,1,31,1,31,1,31,1,31,1,32,1,32,1,32,1,32,1,32,1,
|
33 |
+
32,1,32,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,34,1,
|
34 |
+
34,1,34,1,34,1,34,1,34,3,34,232,8,34,1,35,1,35,1,35,1,35,1,35,1,
|
35 |
+
35,3,35,240,8,35,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,3,
|
36 |
+
36,251,8,36,1,37,1,37,1,37,1,37,1,37,1,37,3,37,259,8,37,1,38,1,38,
|
37 |
+
1,38,1,38,1,38,1,38,1,38,1,38,1,38,3,38,270,8,38,1,39,1,39,1,39,
|
38 |
+
1,39,1,39,1,39,1,39,1,39,1,39,1,39,3,39,282,8,39,1,40,1,40,1,40,
|
39 |
+
1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,41,1,41,1,41,1,41,1,41,1,41,
|
40 |
+
1,41,1,41,1,41,3,41,303,8,41,1,42,1,42,1,42,1,42,1,42,1,42,1,42,
|
41 |
+
1,42,1,42,1,42,1,42,1,42,1,42,1,42,1,42,3,42,320,8,42,1,43,5,43,
|
42 |
+
323,8,43,10,43,12,43,326,9,43,1,44,1,44,1,45,4,45,331,8,45,11,45,
|
43 |
+
12,45,332,1,46,4,46,336,8,46,11,46,12,46,337,1,46,1,46,5,46,342,
|
44 |
+
8,46,10,46,12,46,345,9,46,1,46,1,46,4,46,349,8,46,11,46,12,46,350,
|
45 |
+
3,46,353,8,46,1,47,1,47,1,47,1,47,1,47,1,47,1,47,1,47,1,47,3,47,
|
46 |
+
364,8,47,1,48,1,48,5,48,368,8,48,10,48,12,48,371,9,48,1,48,3,48,
|
47 |
+
374,8,48,1,48,1,48,1,48,1,48,1,49,1,49,5,49,382,8,49,10,49,12,49,
|
48 |
+
385,9,49,1,50,4,50,388,8,50,11,50,12,50,389,1,50,1,50,1,369,0,51,
|
49 |
+
1,1,3,2,5,3,7,4,9,5,11,6,13,7,15,8,17,9,19,10,21,11,23,12,25,13,
|
50 |
+
27,14,29,15,31,16,33,17,35,18,37,19,39,20,41,21,43,22,45,23,47,24,
|
51 |
+
49,25,51,26,53,27,55,28,57,29,59,30,61,31,63,32,65,33,67,34,69,35,
|
52 |
+
71,36,73,37,75,38,77,39,79,40,81,41,83,42,85,43,87,0,89,0,91,44,
|
53 |
+
93,45,95,46,97,47,99,48,101,49,1,0,24,2,0,77,77,109,109,2,0,65,65,
|
54 |
+
97,97,2,0,83,83,115,115,2,0,73,73,105,105,2,0,78,78,110,110,2,0,
|
55 |
+
69,69,101,101,2,0,82,82,114,114,2,0,84,84,116,116,2,0,80,80,112,
|
56 |
+
112,2,0,85,85,117,117,2,0,79,79,111,111,2,0,86,86,118,118,2,0,89,
|
57 |
+
89,121,121,2,0,67,67,99,99,2,0,68,68,100,100,2,0,87,87,119,119,2,
|
58 |
+
0,70,70,102,102,2,0,66,66,98,98,2,0,76,76,108,108,2,0,71,71,103,
|
59 |
+
103,1,0,48,57,2,0,65,90,97,122,4,0,48,57,65,90,95,95,97,122,4,0,
|
60 |
+
9,10,13,13,32,32,38,38,410,0,1,1,0,0,0,0,3,1,0,0,0,0,5,1,0,0,0,0,
|
61 |
+
7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,0,0,15,1,0,0,0,0,17,
|
62 |
+
1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,0,0,25,1,0,0,0,0,27,
|
63 |
+
1,0,0,0,0,29,1,0,0,0,0,31,1,0,0,0,0,33,1,0,0,0,0,35,1,0,0,0,0,37,
|
64 |
+
1,0,0,0,0,39,1,0,0,0,0,41,1,0,0,0,0,43,1,0,0,0,0,45,1,0,0,0,0,47,
|
65 |
+
1,0,0,0,0,49,1,0,0,0,0,51,1,0,0,0,0,53,1,0,0,0,0,55,1,0,0,0,0,57,
|
66 |
+
1,0,0,0,0,59,1,0,0,0,0,61,1,0,0,0,0,63,1,0,0,0,0,65,1,0,0,0,0,67,
|
67 |
+
1,0,0,0,0,69,1,0,0,0,0,71,1,0,0,0,0,73,1,0,0,0,0,75,1,0,0,0,0,77,
|
68 |
+
1,0,0,0,0,79,1,0,0,0,0,81,1,0,0,0,0,83,1,0,0,0,0,85,1,0,0,0,0,91,
|
69 |
+
1,0,0,0,0,93,1,0,0,0,0,95,1,0,0,0,0,97,1,0,0,0,0,99,1,0,0,0,0,101,
|
70 |
+
1,0,0,0,1,103,1,0,0,0,3,105,1,0,0,0,5,107,1,0,0,0,7,109,1,0,0,0,
|
71 |
+
9,112,1,0,0,0,11,115,1,0,0,0,13,118,1,0,0,0,15,121,1,0,0,0,17,124,
|
72 |
+
1,0,0,0,19,127,1,0,0,0,21,129,1,0,0,0,23,131,1,0,0,0,25,133,1,0,
|
73 |
+
0,0,27,135,1,0,0,0,29,137,1,0,0,0,31,139,1,0,0,0,33,141,1,0,0,0,
|
74 |
+
35,143,1,0,0,0,37,145,1,0,0,0,39,147,1,0,0,0,41,149,1,0,0,0,43,151,
|
75 |
+
1,0,0,0,45,154,1,0,0,0,47,158,1,0,0,0,49,160,1,0,0,0,51,162,1,0,
|
76 |
+
0,0,53,164,1,0,0,0,55,169,1,0,0,0,57,177,1,0,0,0,59,185,1,0,0,0,
|
77 |
+
61,192,1,0,0,0,63,197,1,0,0,0,65,208,1,0,0,0,67,215,1,0,0,0,69,225,
|
78 |
+
1,0,0,0,71,233,1,0,0,0,73,241,1,0,0,0,75,252,1,0,0,0,77,260,1,0,
|
79 |
+
0,0,79,271,1,0,0,0,81,283,1,0,0,0,83,293,1,0,0,0,85,304,1,0,0,0,
|
80 |
+
87,324,1,0,0,0,89,327,1,0,0,0,91,330,1,0,0,0,93,352,1,0,0,0,95,363,
|
81 |
+
1,0,0,0,97,365,1,0,0,0,99,379,1,0,0,0,101,387,1,0,0,0,103,104,5,
|
82 |
+
91,0,0,104,2,1,0,0,0,105,106,5,93,0,0,106,4,1,0,0,0,107,108,5,61,
|
83 |
+
0,0,108,6,1,0,0,0,109,110,5,43,0,0,110,111,5,61,0,0,111,8,1,0,0,
|
84 |
+
0,112,113,5,45,0,0,113,114,5,61,0,0,114,10,1,0,0,0,115,116,5,58,
|
85 |
+
0,0,116,117,5,61,0,0,117,12,1,0,0,0,118,119,5,42,0,0,119,120,5,61,
|
86 |
+
0,0,120,14,1,0,0,0,121,122,5,47,0,0,122,123,5,61,0,0,123,16,1,0,
|
87 |
+
0,0,124,125,5,94,0,0,125,126,5,61,0,0,126,18,1,0,0,0,127,128,5,44,
|
88 |
+
0,0,128,20,1,0,0,0,129,130,5,39,0,0,130,22,1,0,0,0,131,132,5,40,
|
89 |
+
0,0,132,24,1,0,0,0,133,134,5,41,0,0,134,26,1,0,0,0,135,136,5,123,
|
90 |
+
0,0,136,28,1,0,0,0,137,138,5,125,0,0,138,30,1,0,0,0,139,140,5,58,
|
91 |
+
0,0,140,32,1,0,0,0,141,142,5,43,0,0,142,34,1,0,0,0,143,144,5,45,
|
92 |
+
0,0,144,36,1,0,0,0,145,146,5,59,0,0,146,38,1,0,0,0,147,148,5,46,
|
93 |
+
0,0,148,40,1,0,0,0,149,150,5,62,0,0,150,42,1,0,0,0,151,152,5,48,
|
94 |
+
0,0,152,153,5,62,0,0,153,44,1,0,0,0,154,155,5,49,0,0,155,156,5,62,
|
95 |
+
0,0,156,157,5,62,0,0,157,46,1,0,0,0,158,159,5,94,0,0,159,48,1,0,
|
96 |
+
0,0,160,161,5,42,0,0,161,50,1,0,0,0,162,163,5,47,0,0,163,52,1,0,
|
97 |
+
0,0,164,165,7,0,0,0,165,166,7,1,0,0,166,167,7,2,0,0,167,168,7,2,
|
98 |
+
0,0,168,54,1,0,0,0,169,170,7,3,0,0,170,171,7,4,0,0,171,172,7,5,0,
|
99 |
+
0,172,173,7,6,0,0,173,174,7,7,0,0,174,175,7,3,0,0,175,176,7,1,0,
|
100 |
+
0,176,56,1,0,0,0,177,178,7,3,0,0,178,179,7,4,0,0,179,180,7,8,0,0,
|
101 |
+
180,181,7,9,0,0,181,183,7,7,0,0,182,184,7,2,0,0,183,182,1,0,0,0,
|
102 |
+
183,184,1,0,0,0,184,58,1,0,0,0,185,186,7,10,0,0,186,187,7,9,0,0,
|
103 |
+
187,188,7,7,0,0,188,189,7,8,0,0,189,190,7,9,0,0,190,191,7,7,0,0,
|
104 |
+
191,60,1,0,0,0,192,193,7,2,0,0,193,194,7,1,0,0,194,195,7,11,0,0,
|
105 |
+
195,196,7,5,0,0,196,62,1,0,0,0,197,198,7,9,0,0,198,199,7,4,0,0,199,
|
106 |
+
200,7,3,0,0,200,201,7,7,0,0,201,202,7,2,0,0,202,203,7,12,0,0,203,
|
107 |
+
204,7,2,0,0,204,205,7,7,0,0,205,206,7,5,0,0,206,207,7,0,0,0,207,
|
108 |
+
64,1,0,0,0,208,209,7,5,0,0,209,210,7,4,0,0,210,211,7,13,0,0,211,
|
109 |
+
212,7,10,0,0,212,213,7,14,0,0,213,214,7,5,0,0,214,66,1,0,0,0,215,
|
110 |
+
216,7,4,0,0,216,217,7,5,0,0,217,218,7,15,0,0,218,219,7,7,0,0,219,
|
111 |
+
220,7,10,0,0,220,221,7,4,0,0,221,222,7,3,0,0,222,223,7,1,0,0,223,
|
112 |
+
224,7,4,0,0,224,68,1,0,0,0,225,226,7,16,0,0,226,227,7,6,0,0,227,
|
113 |
+
228,7,1,0,0,228,229,7,0,0,0,229,231,7,5,0,0,230,232,7,2,0,0,231,
|
114 |
+
230,1,0,0,0,231,232,1,0,0,0,232,70,1,0,0,0,233,234,7,17,0,0,234,
|
115 |
+
235,7,10,0,0,235,236,7,14,0,0,236,237,7,3,0,0,237,239,7,5,0,0,238,
|
116 |
+
240,7,2,0,0,239,238,1,0,0,0,239,240,1,0,0,0,240,72,1,0,0,0,241,242,
|
117 |
+
7,8,0,0,242,243,7,1,0,0,243,244,7,6,0,0,244,245,7,7,0,0,245,246,
|
118 |
+
7,3,0,0,246,247,7,13,0,0,247,248,7,18,0,0,248,250,7,5,0,0,249,251,
|
119 |
+
7,2,0,0,250,249,1,0,0,0,250,251,1,0,0,0,251,74,1,0,0,0,252,253,7,
|
120 |
+
8,0,0,253,254,7,10,0,0,254,255,7,3,0,0,255,256,7,4,0,0,256,258,7,
|
121 |
+
7,0,0,257,259,7,2,0,0,258,257,1,0,0,0,258,259,1,0,0,0,259,76,1,0,
|
122 |
+
0,0,260,261,7,13,0,0,261,262,7,10,0,0,262,263,7,4,0,0,263,264,7,
|
123 |
+
2,0,0,264,265,7,7,0,0,265,266,7,1,0,0,266,267,7,4,0,0,267,269,7,
|
124 |
+
7,0,0,268,270,7,2,0,0,269,268,1,0,0,0,269,270,1,0,0,0,270,78,1,0,
|
125 |
+
0,0,271,272,7,2,0,0,272,273,7,8,0,0,273,274,7,5,0,0,274,275,7,13,
|
126 |
+
0,0,275,276,7,3,0,0,276,277,7,16,0,0,277,278,7,3,0,0,278,279,7,5,
|
127 |
+
0,0,279,281,7,14,0,0,280,282,7,2,0,0,281,280,1,0,0,0,281,282,1,0,
|
128 |
+
0,0,282,80,1,0,0,0,283,284,7,3,0,0,284,285,7,0,0,0,285,286,7,1,0,
|
129 |
+
0,286,287,7,19,0,0,287,288,7,3,0,0,288,289,7,4,0,0,289,290,7,1,0,
|
130 |
+
0,290,291,7,6,0,0,291,292,7,12,0,0,292,82,1,0,0,0,293,294,7,11,0,
|
131 |
+
0,294,295,7,1,0,0,295,296,7,6,0,0,296,297,7,3,0,0,297,298,7,1,0,
|
132 |
+
0,298,299,7,17,0,0,299,300,7,18,0,0,300,302,7,5,0,0,301,303,7,2,
|
133 |
+
0,0,302,301,1,0,0,0,302,303,1,0,0,0,303,84,1,0,0,0,304,305,7,0,0,
|
134 |
+
0,305,306,7,10,0,0,306,307,7,7,0,0,307,308,7,3,0,0,308,309,7,10,
|
135 |
+
0,0,309,310,7,4,0,0,310,311,7,11,0,0,311,312,7,1,0,0,312,313,7,6,
|
136 |
+
0,0,313,314,7,3,0,0,314,315,7,1,0,0,315,316,7,17,0,0,316,317,7,18,
|
137 |
+
0,0,317,319,7,5,0,0,318,320,7,2,0,0,319,318,1,0,0,0,319,320,1,0,
|
138 |
+
0,0,320,86,1,0,0,0,321,323,5,39,0,0,322,321,1,0,0,0,323,326,1,0,
|
139 |
+
0,0,324,322,1,0,0,0,324,325,1,0,0,0,325,88,1,0,0,0,326,324,1,0,0,
|
140 |
+
0,327,328,7,20,0,0,328,90,1,0,0,0,329,331,7,20,0,0,330,329,1,0,0,
|
141 |
+
0,331,332,1,0,0,0,332,330,1,0,0,0,332,333,1,0,0,0,333,92,1,0,0,0,
|
142 |
+
334,336,3,89,44,0,335,334,1,0,0,0,336,337,1,0,0,0,337,335,1,0,0,
|
143 |
+
0,337,338,1,0,0,0,338,339,1,0,0,0,339,343,5,46,0,0,340,342,3,89,
|
144 |
+
44,0,341,340,1,0,0,0,342,345,1,0,0,0,343,341,1,0,0,0,343,344,1,0,
|
145 |
+
0,0,344,353,1,0,0,0,345,343,1,0,0,0,346,348,5,46,0,0,347,349,3,89,
|
146 |
+
44,0,348,347,1,0,0,0,349,350,1,0,0,0,350,348,1,0,0,0,350,351,1,0,
|
147 |
+
0,0,351,353,1,0,0,0,352,335,1,0,0,0,352,346,1,0,0,0,353,94,1,0,0,
|
148 |
+
0,354,355,3,93,46,0,355,356,5,69,0,0,356,357,3,91,45,0,357,364,1,
|
149 |
+
0,0,0,358,359,3,93,46,0,359,360,5,69,0,0,360,361,5,45,0,0,361,362,
|
150 |
+
3,91,45,0,362,364,1,0,0,0,363,354,1,0,0,0,363,358,1,0,0,0,364,96,
|
151 |
+
1,0,0,0,365,369,5,37,0,0,366,368,9,0,0,0,367,366,1,0,0,0,368,371,
|
152 |
+
1,0,0,0,369,370,1,0,0,0,369,367,1,0,0,0,370,373,1,0,0,0,371,369,
|
153 |
+
1,0,0,0,372,374,5,13,0,0,373,372,1,0,0,0,373,374,1,0,0,0,374,375,
|
154 |
+
1,0,0,0,375,376,5,10,0,0,376,377,1,0,0,0,377,378,6,48,0,0,378,98,
|
155 |
+
1,0,0,0,379,383,7,21,0,0,380,382,7,22,0,0,381,380,1,0,0,0,382,385,
|
156 |
+
1,0,0,0,383,381,1,0,0,0,383,384,1,0,0,0,384,100,1,0,0,0,385,383,
|
157 |
+
1,0,0,0,386,388,7,23,0,0,387,386,1,0,0,0,388,389,1,0,0,0,389,387,
|
158 |
+
1,0,0,0,389,390,1,0,0,0,390,391,1,0,0,0,391,392,6,50,0,0,392,102,
|
159 |
+
1,0,0,0,21,0,183,231,239,250,258,269,281,302,319,324,332,337,343,
|
160 |
+
350,352,363,369,373,383,389,1,6,0,0
|
161 |
+
]
|
162 |
+
|
163 |
+
class AutolevLexer(Lexer):
|
164 |
+
|
165 |
+
atn = ATNDeserializer().deserialize(serializedATN())
|
166 |
+
|
167 |
+
decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ]
|
168 |
+
|
169 |
+
T__0 = 1
|
170 |
+
T__1 = 2
|
171 |
+
T__2 = 3
|
172 |
+
T__3 = 4
|
173 |
+
T__4 = 5
|
174 |
+
T__5 = 6
|
175 |
+
T__6 = 7
|
176 |
+
T__7 = 8
|
177 |
+
T__8 = 9
|
178 |
+
T__9 = 10
|
179 |
+
T__10 = 11
|
180 |
+
T__11 = 12
|
181 |
+
T__12 = 13
|
182 |
+
T__13 = 14
|
183 |
+
T__14 = 15
|
184 |
+
T__15 = 16
|
185 |
+
T__16 = 17
|
186 |
+
T__17 = 18
|
187 |
+
T__18 = 19
|
188 |
+
T__19 = 20
|
189 |
+
T__20 = 21
|
190 |
+
T__21 = 22
|
191 |
+
T__22 = 23
|
192 |
+
T__23 = 24
|
193 |
+
T__24 = 25
|
194 |
+
T__25 = 26
|
195 |
+
Mass = 27
|
196 |
+
Inertia = 28
|
197 |
+
Input = 29
|
198 |
+
Output = 30
|
199 |
+
Save = 31
|
200 |
+
UnitSystem = 32
|
201 |
+
Encode = 33
|
202 |
+
Newtonian = 34
|
203 |
+
Frames = 35
|
204 |
+
Bodies = 36
|
205 |
+
Particles = 37
|
206 |
+
Points = 38
|
207 |
+
Constants = 39
|
208 |
+
Specifieds = 40
|
209 |
+
Imaginary = 41
|
210 |
+
Variables = 42
|
211 |
+
MotionVariables = 43
|
212 |
+
INT = 44
|
213 |
+
FLOAT = 45
|
214 |
+
EXP = 46
|
215 |
+
LINE_COMMENT = 47
|
216 |
+
ID = 48
|
217 |
+
WS = 49
|
218 |
+
|
219 |
+
channelNames = [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ]
|
220 |
+
|
221 |
+
modeNames = [ "DEFAULT_MODE" ]
|
222 |
+
|
223 |
+
literalNames = [ "<INVALID>",
|
224 |
+
"'['", "']'", "'='", "'+='", "'-='", "':='", "'*='", "'/='",
|
225 |
+
"'^='", "','", "'''", "'('", "')'", "'{'", "'}'", "':'", "'+'",
|
226 |
+
"'-'", "';'", "'.'", "'>'", "'0>'", "'1>>'", "'^'", "'*'", "'/'" ]
|
227 |
+
|
228 |
+
symbolicNames = [ "<INVALID>",
|
229 |
+
"Mass", "Inertia", "Input", "Output", "Save", "UnitSystem",
|
230 |
+
"Encode", "Newtonian", "Frames", "Bodies", "Particles", "Points",
|
231 |
+
"Constants", "Specifieds", "Imaginary", "Variables", "MotionVariables",
|
232 |
+
"INT", "FLOAT", "EXP", "LINE_COMMENT", "ID", "WS" ]
|
233 |
+
|
234 |
+
ruleNames = [ "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6",
|
235 |
+
"T__7", "T__8", "T__9", "T__10", "T__11", "T__12", "T__13",
|
236 |
+
"T__14", "T__15", "T__16", "T__17", "T__18", "T__19",
|
237 |
+
"T__20", "T__21", "T__22", "T__23", "T__24", "T__25",
|
238 |
+
"Mass", "Inertia", "Input", "Output", "Save", "UnitSystem",
|
239 |
+
"Encode", "Newtonian", "Frames", "Bodies", "Particles",
|
240 |
+
"Points", "Constants", "Specifieds", "Imaginary", "Variables",
|
241 |
+
"MotionVariables", "DIFF", "DIGIT", "INT", "FLOAT", "EXP",
|
242 |
+
"LINE_COMMENT", "ID", "WS" ]
|
243 |
+
|
244 |
+
grammarFileName = "Autolev.g4"
|
245 |
+
|
246 |
+
def __init__(self, input=None, output:TextIO = sys.stdout):
|
247 |
+
super().__init__(input, output)
|
248 |
+
self.checkVersion("4.11.1")
|
249 |
+
self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache())
|
250 |
+
self._actions = None
|
251 |
+
self._predicates = None
|
252 |
+
|
253 |
+
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/_antlr/autolevlistener.py
ADDED
@@ -0,0 +1,421 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# *** GENERATED BY `setup.py antlr`, DO NOT EDIT BY HAND ***
|
2 |
+
#
|
3 |
+
# Generated with antlr4
|
4 |
+
# antlr4 is licensed under the BSD-3-Clause License
|
5 |
+
# https://github.com/antlr/antlr4/blob/master/LICENSE.txt
|
6 |
+
from antlr4 import *
|
7 |
+
if __name__ is not None and "." in __name__:
|
8 |
+
from .autolevparser import AutolevParser
|
9 |
+
else:
|
10 |
+
from autolevparser import AutolevParser
|
11 |
+
|
12 |
+
# This class defines a complete listener for a parse tree produced by AutolevParser.
|
13 |
+
class AutolevListener(ParseTreeListener):
|
14 |
+
|
15 |
+
# Enter a parse tree produced by AutolevParser#prog.
|
16 |
+
def enterProg(self, ctx:AutolevParser.ProgContext):
|
17 |
+
pass
|
18 |
+
|
19 |
+
# Exit a parse tree produced by AutolevParser#prog.
|
20 |
+
def exitProg(self, ctx:AutolevParser.ProgContext):
|
21 |
+
pass
|
22 |
+
|
23 |
+
|
24 |
+
# Enter a parse tree produced by AutolevParser#stat.
|
25 |
+
def enterStat(self, ctx:AutolevParser.StatContext):
|
26 |
+
pass
|
27 |
+
|
28 |
+
# Exit a parse tree produced by AutolevParser#stat.
|
29 |
+
def exitStat(self, ctx:AutolevParser.StatContext):
|
30 |
+
pass
|
31 |
+
|
32 |
+
|
33 |
+
# Enter a parse tree produced by AutolevParser#vecAssign.
|
34 |
+
def enterVecAssign(self, ctx:AutolevParser.VecAssignContext):
|
35 |
+
pass
|
36 |
+
|
37 |
+
# Exit a parse tree produced by AutolevParser#vecAssign.
|
38 |
+
def exitVecAssign(self, ctx:AutolevParser.VecAssignContext):
|
39 |
+
pass
|
40 |
+
|
41 |
+
|
42 |
+
# Enter a parse tree produced by AutolevParser#indexAssign.
|
43 |
+
def enterIndexAssign(self, ctx:AutolevParser.IndexAssignContext):
|
44 |
+
pass
|
45 |
+
|
46 |
+
# Exit a parse tree produced by AutolevParser#indexAssign.
|
47 |
+
def exitIndexAssign(self, ctx:AutolevParser.IndexAssignContext):
|
48 |
+
pass
|
49 |
+
|
50 |
+
|
51 |
+
# Enter a parse tree produced by AutolevParser#regularAssign.
|
52 |
+
def enterRegularAssign(self, ctx:AutolevParser.RegularAssignContext):
|
53 |
+
pass
|
54 |
+
|
55 |
+
# Exit a parse tree produced by AutolevParser#regularAssign.
|
56 |
+
def exitRegularAssign(self, ctx:AutolevParser.RegularAssignContext):
|
57 |
+
pass
|
58 |
+
|
59 |
+
|
60 |
+
# Enter a parse tree produced by AutolevParser#equals.
|
61 |
+
def enterEquals(self, ctx:AutolevParser.EqualsContext):
|
62 |
+
pass
|
63 |
+
|
64 |
+
# Exit a parse tree produced by AutolevParser#equals.
|
65 |
+
def exitEquals(self, ctx:AutolevParser.EqualsContext):
|
66 |
+
pass
|
67 |
+
|
68 |
+
|
69 |
+
# Enter a parse tree produced by AutolevParser#index.
|
70 |
+
def enterIndex(self, ctx:AutolevParser.IndexContext):
|
71 |
+
pass
|
72 |
+
|
73 |
+
# Exit a parse tree produced by AutolevParser#index.
|
74 |
+
def exitIndex(self, ctx:AutolevParser.IndexContext):
|
75 |
+
pass
|
76 |
+
|
77 |
+
|
78 |
+
# Enter a parse tree produced by AutolevParser#diff.
|
79 |
+
def enterDiff(self, ctx:AutolevParser.DiffContext):
|
80 |
+
pass
|
81 |
+
|
82 |
+
# Exit a parse tree produced by AutolevParser#diff.
|
83 |
+
def exitDiff(self, ctx:AutolevParser.DiffContext):
|
84 |
+
pass
|
85 |
+
|
86 |
+
|
87 |
+
# Enter a parse tree produced by AutolevParser#functionCall.
|
88 |
+
def enterFunctionCall(self, ctx:AutolevParser.FunctionCallContext):
|
89 |
+
pass
|
90 |
+
|
91 |
+
# Exit a parse tree produced by AutolevParser#functionCall.
|
92 |
+
def exitFunctionCall(self, ctx:AutolevParser.FunctionCallContext):
|
93 |
+
pass
|
94 |
+
|
95 |
+
|
96 |
+
# Enter a parse tree produced by AutolevParser#varDecl.
|
97 |
+
def enterVarDecl(self, ctx:AutolevParser.VarDeclContext):
|
98 |
+
pass
|
99 |
+
|
100 |
+
# Exit a parse tree produced by AutolevParser#varDecl.
|
101 |
+
def exitVarDecl(self, ctx:AutolevParser.VarDeclContext):
|
102 |
+
pass
|
103 |
+
|
104 |
+
|
105 |
+
# Enter a parse tree produced by AutolevParser#varType.
|
106 |
+
def enterVarType(self, ctx:AutolevParser.VarTypeContext):
|
107 |
+
pass
|
108 |
+
|
109 |
+
# Exit a parse tree produced by AutolevParser#varType.
|
110 |
+
def exitVarType(self, ctx:AutolevParser.VarTypeContext):
|
111 |
+
pass
|
112 |
+
|
113 |
+
|
114 |
+
# Enter a parse tree produced by AutolevParser#varDecl2.
|
115 |
+
def enterVarDecl2(self, ctx:AutolevParser.VarDecl2Context):
|
116 |
+
pass
|
117 |
+
|
118 |
+
# Exit a parse tree produced by AutolevParser#varDecl2.
|
119 |
+
def exitVarDecl2(self, ctx:AutolevParser.VarDecl2Context):
|
120 |
+
pass
|
121 |
+
|
122 |
+
|
123 |
+
# Enter a parse tree produced by AutolevParser#ranges.
|
124 |
+
def enterRanges(self, ctx:AutolevParser.RangesContext):
|
125 |
+
pass
|
126 |
+
|
127 |
+
# Exit a parse tree produced by AutolevParser#ranges.
|
128 |
+
def exitRanges(self, ctx:AutolevParser.RangesContext):
|
129 |
+
pass
|
130 |
+
|
131 |
+
|
132 |
+
# Enter a parse tree produced by AutolevParser#massDecl.
|
133 |
+
def enterMassDecl(self, ctx:AutolevParser.MassDeclContext):
|
134 |
+
pass
|
135 |
+
|
136 |
+
# Exit a parse tree produced by AutolevParser#massDecl.
|
137 |
+
def exitMassDecl(self, ctx:AutolevParser.MassDeclContext):
|
138 |
+
pass
|
139 |
+
|
140 |
+
|
141 |
+
# Enter a parse tree produced by AutolevParser#massDecl2.
|
142 |
+
def enterMassDecl2(self, ctx:AutolevParser.MassDecl2Context):
|
143 |
+
pass
|
144 |
+
|
145 |
+
# Exit a parse tree produced by AutolevParser#massDecl2.
|
146 |
+
def exitMassDecl2(self, ctx:AutolevParser.MassDecl2Context):
|
147 |
+
pass
|
148 |
+
|
149 |
+
|
150 |
+
# Enter a parse tree produced by AutolevParser#inertiaDecl.
|
151 |
+
def enterInertiaDecl(self, ctx:AutolevParser.InertiaDeclContext):
|
152 |
+
pass
|
153 |
+
|
154 |
+
# Exit a parse tree produced by AutolevParser#inertiaDecl.
|
155 |
+
def exitInertiaDecl(self, ctx:AutolevParser.InertiaDeclContext):
|
156 |
+
pass
|
157 |
+
|
158 |
+
|
159 |
+
# Enter a parse tree produced by AutolevParser#matrix.
|
160 |
+
def enterMatrix(self, ctx:AutolevParser.MatrixContext):
|
161 |
+
pass
|
162 |
+
|
163 |
+
# Exit a parse tree produced by AutolevParser#matrix.
|
164 |
+
def exitMatrix(self, ctx:AutolevParser.MatrixContext):
|
165 |
+
pass
|
166 |
+
|
167 |
+
|
168 |
+
# Enter a parse tree produced by AutolevParser#matrixInOutput.
|
169 |
+
def enterMatrixInOutput(self, ctx:AutolevParser.MatrixInOutputContext):
|
170 |
+
pass
|
171 |
+
|
172 |
+
# Exit a parse tree produced by AutolevParser#matrixInOutput.
|
173 |
+
def exitMatrixInOutput(self, ctx:AutolevParser.MatrixInOutputContext):
|
174 |
+
pass
|
175 |
+
|
176 |
+
|
177 |
+
# Enter a parse tree produced by AutolevParser#codeCommands.
|
178 |
+
def enterCodeCommands(self, ctx:AutolevParser.CodeCommandsContext):
|
179 |
+
pass
|
180 |
+
|
181 |
+
# Exit a parse tree produced by AutolevParser#codeCommands.
|
182 |
+
def exitCodeCommands(self, ctx:AutolevParser.CodeCommandsContext):
|
183 |
+
pass
|
184 |
+
|
185 |
+
|
186 |
+
# Enter a parse tree produced by AutolevParser#settings.
|
187 |
+
def enterSettings(self, ctx:AutolevParser.SettingsContext):
|
188 |
+
pass
|
189 |
+
|
190 |
+
# Exit a parse tree produced by AutolevParser#settings.
|
191 |
+
def exitSettings(self, ctx:AutolevParser.SettingsContext):
|
192 |
+
pass
|
193 |
+
|
194 |
+
|
195 |
+
# Enter a parse tree produced by AutolevParser#units.
|
196 |
+
def enterUnits(self, ctx:AutolevParser.UnitsContext):
|
197 |
+
pass
|
198 |
+
|
199 |
+
# Exit a parse tree produced by AutolevParser#units.
|
200 |
+
def exitUnits(self, ctx:AutolevParser.UnitsContext):
|
201 |
+
pass
|
202 |
+
|
203 |
+
|
204 |
+
# Enter a parse tree produced by AutolevParser#inputs.
|
205 |
+
def enterInputs(self, ctx:AutolevParser.InputsContext):
|
206 |
+
pass
|
207 |
+
|
208 |
+
# Exit a parse tree produced by AutolevParser#inputs.
|
209 |
+
def exitInputs(self, ctx:AutolevParser.InputsContext):
|
210 |
+
pass
|
211 |
+
|
212 |
+
|
213 |
+
# Enter a parse tree produced by AutolevParser#id_diff.
|
214 |
+
def enterId_diff(self, ctx:AutolevParser.Id_diffContext):
|
215 |
+
pass
|
216 |
+
|
217 |
+
# Exit a parse tree produced by AutolevParser#id_diff.
|
218 |
+
def exitId_diff(self, ctx:AutolevParser.Id_diffContext):
|
219 |
+
pass
|
220 |
+
|
221 |
+
|
222 |
+
# Enter a parse tree produced by AutolevParser#inputs2.
|
223 |
+
def enterInputs2(self, ctx:AutolevParser.Inputs2Context):
|
224 |
+
pass
|
225 |
+
|
226 |
+
# Exit a parse tree produced by AutolevParser#inputs2.
|
227 |
+
def exitInputs2(self, ctx:AutolevParser.Inputs2Context):
|
228 |
+
pass
|
229 |
+
|
230 |
+
|
231 |
+
# Enter a parse tree produced by AutolevParser#outputs.
|
232 |
+
def enterOutputs(self, ctx:AutolevParser.OutputsContext):
|
233 |
+
pass
|
234 |
+
|
235 |
+
# Exit a parse tree produced by AutolevParser#outputs.
|
236 |
+
def exitOutputs(self, ctx:AutolevParser.OutputsContext):
|
237 |
+
pass
|
238 |
+
|
239 |
+
|
240 |
+
# Enter a parse tree produced by AutolevParser#outputs2.
|
241 |
+
def enterOutputs2(self, ctx:AutolevParser.Outputs2Context):
|
242 |
+
pass
|
243 |
+
|
244 |
+
# Exit a parse tree produced by AutolevParser#outputs2.
|
245 |
+
def exitOutputs2(self, ctx:AutolevParser.Outputs2Context):
|
246 |
+
pass
|
247 |
+
|
248 |
+
|
249 |
+
# Enter a parse tree produced by AutolevParser#codegen.
|
250 |
+
def enterCodegen(self, ctx:AutolevParser.CodegenContext):
|
251 |
+
pass
|
252 |
+
|
253 |
+
# Exit a parse tree produced by AutolevParser#codegen.
|
254 |
+
def exitCodegen(self, ctx:AutolevParser.CodegenContext):
|
255 |
+
pass
|
256 |
+
|
257 |
+
|
258 |
+
# Enter a parse tree produced by AutolevParser#commands.
|
259 |
+
def enterCommands(self, ctx:AutolevParser.CommandsContext):
|
260 |
+
pass
|
261 |
+
|
262 |
+
# Exit a parse tree produced by AutolevParser#commands.
|
263 |
+
def exitCommands(self, ctx:AutolevParser.CommandsContext):
|
264 |
+
pass
|
265 |
+
|
266 |
+
|
267 |
+
# Enter a parse tree produced by AutolevParser#vec.
|
268 |
+
def enterVec(self, ctx:AutolevParser.VecContext):
|
269 |
+
pass
|
270 |
+
|
271 |
+
# Exit a parse tree produced by AutolevParser#vec.
|
272 |
+
def exitVec(self, ctx:AutolevParser.VecContext):
|
273 |
+
pass
|
274 |
+
|
275 |
+
|
276 |
+
# Enter a parse tree produced by AutolevParser#parens.
|
277 |
+
def enterParens(self, ctx:AutolevParser.ParensContext):
|
278 |
+
pass
|
279 |
+
|
280 |
+
# Exit a parse tree produced by AutolevParser#parens.
|
281 |
+
def exitParens(self, ctx:AutolevParser.ParensContext):
|
282 |
+
pass
|
283 |
+
|
284 |
+
|
285 |
+
# Enter a parse tree produced by AutolevParser#VectorOrDyadic.
|
286 |
+
def enterVectorOrDyadic(self, ctx:AutolevParser.VectorOrDyadicContext):
|
287 |
+
pass
|
288 |
+
|
289 |
+
# Exit a parse tree produced by AutolevParser#VectorOrDyadic.
|
290 |
+
def exitVectorOrDyadic(self, ctx:AutolevParser.VectorOrDyadicContext):
|
291 |
+
pass
|
292 |
+
|
293 |
+
|
294 |
+
# Enter a parse tree produced by AutolevParser#Exponent.
|
295 |
+
def enterExponent(self, ctx:AutolevParser.ExponentContext):
|
296 |
+
pass
|
297 |
+
|
298 |
+
# Exit a parse tree produced by AutolevParser#Exponent.
|
299 |
+
def exitExponent(self, ctx:AutolevParser.ExponentContext):
|
300 |
+
pass
|
301 |
+
|
302 |
+
|
303 |
+
# Enter a parse tree produced by AutolevParser#MulDiv.
|
304 |
+
def enterMulDiv(self, ctx:AutolevParser.MulDivContext):
|
305 |
+
pass
|
306 |
+
|
307 |
+
# Exit a parse tree produced by AutolevParser#MulDiv.
|
308 |
+
def exitMulDiv(self, ctx:AutolevParser.MulDivContext):
|
309 |
+
pass
|
310 |
+
|
311 |
+
|
312 |
+
# Enter a parse tree produced by AutolevParser#AddSub.
|
313 |
+
def enterAddSub(self, ctx:AutolevParser.AddSubContext):
|
314 |
+
pass
|
315 |
+
|
316 |
+
# Exit a parse tree produced by AutolevParser#AddSub.
|
317 |
+
def exitAddSub(self, ctx:AutolevParser.AddSubContext):
|
318 |
+
pass
|
319 |
+
|
320 |
+
|
321 |
+
# Enter a parse tree produced by AutolevParser#float.
|
322 |
+
def enterFloat(self, ctx:AutolevParser.FloatContext):
|
323 |
+
pass
|
324 |
+
|
325 |
+
# Exit a parse tree produced by AutolevParser#float.
|
326 |
+
def exitFloat(self, ctx:AutolevParser.FloatContext):
|
327 |
+
pass
|
328 |
+
|
329 |
+
|
330 |
+
# Enter a parse tree produced by AutolevParser#int.
|
331 |
+
def enterInt(self, ctx:AutolevParser.IntContext):
|
332 |
+
pass
|
333 |
+
|
334 |
+
# Exit a parse tree produced by AutolevParser#int.
|
335 |
+
def exitInt(self, ctx:AutolevParser.IntContext):
|
336 |
+
pass
|
337 |
+
|
338 |
+
|
339 |
+
# Enter a parse tree produced by AutolevParser#idEqualsExpr.
|
340 |
+
def enterIdEqualsExpr(self, ctx:AutolevParser.IdEqualsExprContext):
|
341 |
+
pass
|
342 |
+
|
343 |
+
# Exit a parse tree produced by AutolevParser#idEqualsExpr.
|
344 |
+
def exitIdEqualsExpr(self, ctx:AutolevParser.IdEqualsExprContext):
|
345 |
+
pass
|
346 |
+
|
347 |
+
|
348 |
+
# Enter a parse tree produced by AutolevParser#negativeOne.
|
349 |
+
def enterNegativeOne(self, ctx:AutolevParser.NegativeOneContext):
|
350 |
+
pass
|
351 |
+
|
352 |
+
# Exit a parse tree produced by AutolevParser#negativeOne.
|
353 |
+
def exitNegativeOne(self, ctx:AutolevParser.NegativeOneContext):
|
354 |
+
pass
|
355 |
+
|
356 |
+
|
357 |
+
# Enter a parse tree produced by AutolevParser#function.
|
358 |
+
def enterFunction(self, ctx:AutolevParser.FunctionContext):
|
359 |
+
pass
|
360 |
+
|
361 |
+
# Exit a parse tree produced by AutolevParser#function.
|
362 |
+
def exitFunction(self, ctx:AutolevParser.FunctionContext):
|
363 |
+
pass
|
364 |
+
|
365 |
+
|
366 |
+
# Enter a parse tree produced by AutolevParser#rangess.
|
367 |
+
def enterRangess(self, ctx:AutolevParser.RangessContext):
|
368 |
+
pass
|
369 |
+
|
370 |
+
# Exit a parse tree produced by AutolevParser#rangess.
|
371 |
+
def exitRangess(self, ctx:AutolevParser.RangessContext):
|
372 |
+
pass
|
373 |
+
|
374 |
+
|
375 |
+
# Enter a parse tree produced by AutolevParser#colon.
|
376 |
+
def enterColon(self, ctx:AutolevParser.ColonContext):
|
377 |
+
pass
|
378 |
+
|
379 |
+
# Exit a parse tree produced by AutolevParser#colon.
|
380 |
+
def exitColon(self, ctx:AutolevParser.ColonContext):
|
381 |
+
pass
|
382 |
+
|
383 |
+
|
384 |
+
# Enter a parse tree produced by AutolevParser#id.
|
385 |
+
def enterId(self, ctx:AutolevParser.IdContext):
|
386 |
+
pass
|
387 |
+
|
388 |
+
# Exit a parse tree produced by AutolevParser#id.
|
389 |
+
def exitId(self, ctx:AutolevParser.IdContext):
|
390 |
+
pass
|
391 |
+
|
392 |
+
|
393 |
+
# Enter a parse tree produced by AutolevParser#exp.
|
394 |
+
def enterExp(self, ctx:AutolevParser.ExpContext):
|
395 |
+
pass
|
396 |
+
|
397 |
+
# Exit a parse tree produced by AutolevParser#exp.
|
398 |
+
def exitExp(self, ctx:AutolevParser.ExpContext):
|
399 |
+
pass
|
400 |
+
|
401 |
+
|
402 |
+
# Enter a parse tree produced by AutolevParser#matrices.
|
403 |
+
def enterMatrices(self, ctx:AutolevParser.MatricesContext):
|
404 |
+
pass
|
405 |
+
|
406 |
+
# Exit a parse tree produced by AutolevParser#matrices.
|
407 |
+
def exitMatrices(self, ctx:AutolevParser.MatricesContext):
|
408 |
+
pass
|
409 |
+
|
410 |
+
|
411 |
+
# Enter a parse tree produced by AutolevParser#Indexing.
|
412 |
+
def enterIndexing(self, ctx:AutolevParser.IndexingContext):
|
413 |
+
pass
|
414 |
+
|
415 |
+
# Exit a parse tree produced by AutolevParser#Indexing.
|
416 |
+
def exitIndexing(self, ctx:AutolevParser.IndexingContext):
|
417 |
+
pass
|
418 |
+
|
419 |
+
|
420 |
+
|
421 |
+
del AutolevParser
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/_antlr/autolevparser.py
ADDED
The diff for this file is too large to render.
See raw diff
|
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/__pycache__/ruletest1.cpython-310.pyc
ADDED
Binary file (852 Bytes). View file
|
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/__pycache__/ruletest10.cpython-310.pyc
ADDED
Binary file (2.92 kB). View file
|
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/__pycache__/ruletest11.cpython-310.pyc
ADDED
Binary file (775 Bytes). View file
|
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/__pycache__/ruletest12.cpython-310.pyc
ADDED
Binary file (809 Bytes). View file
|
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/__pycache__/ruletest2.cpython-310.pyc
ADDED
Binary file (1.03 kB). View file
|
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/__pycache__/ruletest3.cpython-310.pyc
ADDED
Binary file (1.49 kB). View file
|
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/__pycache__/ruletest4.cpython-310.pyc
ADDED
Binary file (886 Bytes). View file
|
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/__pycache__/ruletest5.cpython-310.pyc
ADDED
Binary file (2.6 kB). View file
|
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/__pycache__/ruletest6.cpython-310.pyc
ADDED
Binary file (2.2 kB). View file
|
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/__pycache__/ruletest7.cpython-310.pyc
ADDED
Binary file (2.01 kB). View file
|
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/__pycache__/ruletest8.cpython-310.pyc
ADDED
Binary file (1.88 kB). View file
|
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/__pycache__/ruletest9.cpython-310.pyc
ADDED
Binary file (1.97 kB). View file
|
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/pydy-example-repo/__pycache__/chaos_pendulum.cpython-310.pyc
ADDED
Binary file (2.11 kB). View file
|
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/pydy-example-repo/__pycache__/double_pendulum.cpython-310.pyc
ADDED
Binary file (1.58 kB). View file
|
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/pydy-example-repo/__pycache__/mass_spring_damper.cpython-310.pyc
ADDED
Binary file (1.55 kB). View file
|
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/pydy-example-repo/__pycache__/non_min_pendulum.cpython-310.pyc
ADDED
Binary file (1.6 kB). View file
|
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/pydy-example-repo/chaos_pendulum.al
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
CONSTANTS G,LB,W,H
|
2 |
+
MOTIONVARIABLES' THETA'',PHI'',OMEGA',ALPHA'
|
3 |
+
NEWTONIAN N
|
4 |
+
BODIES A,B
|
5 |
+
SIMPROT(N,A,2,THETA)
|
6 |
+
SIMPROT(A,B,3,PHI)
|
7 |
+
POINT O
|
8 |
+
LA = (LB-H/2)/2
|
9 |
+
P_O_AO> = LA*A3>
|
10 |
+
P_O_BO> = LB*A3>
|
11 |
+
OMEGA = THETA'
|
12 |
+
ALPHA = PHI'
|
13 |
+
W_A_N> = OMEGA*N2>
|
14 |
+
W_B_A> = ALPHA*A3>
|
15 |
+
V_O_N> = 0>
|
16 |
+
V2PTS(N, A, O, AO)
|
17 |
+
V2PTS(N, A, O, BO)
|
18 |
+
MASS A=MA, B=MB
|
19 |
+
IAXX = 1/12*MA*(2*LA)^2
|
20 |
+
IAYY = IAXX
|
21 |
+
IAZZ = 0
|
22 |
+
IBXX = 1/12*MB*H^2
|
23 |
+
IBYY = 1/12*MB*(W^2+H^2)
|
24 |
+
IBZZ = 1/12*MB*W^2
|
25 |
+
INERTIA A, IAXX, IAYY, IAZZ
|
26 |
+
INERTIA B, IBXX, IBYY, IBZZ
|
27 |
+
GRAVITY(G*N3>)
|
28 |
+
ZERO = FR() + FRSTAR()
|
29 |
+
KANE()
|
30 |
+
INPUT LB=0.2,H=0.1,W=0.2,MA=0.01,MB=0.1,G=9.81
|
31 |
+
INPUT THETA = 90 DEG, PHI = 0.5 DEG, OMEGA=0, ALPHA=0
|
32 |
+
INPUT TFINAL=10, INTEGSTP=0.02
|
33 |
+
CODE DYNAMICS() some_filename.c
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/pydy-example-repo/chaos_pendulum.py
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import sympy.physics.mechanics as _me
|
2 |
+
import sympy as _sm
|
3 |
+
import math as m
|
4 |
+
import numpy as _np
|
5 |
+
|
6 |
+
g, lb, w, h = _sm.symbols('g lb w h', real=True)
|
7 |
+
theta, phi, omega, alpha = _me.dynamicsymbols('theta phi omega alpha')
|
8 |
+
theta_d, phi_d, omega_d, alpha_d = _me.dynamicsymbols('theta_ phi_ omega_ alpha_', 1)
|
9 |
+
theta_dd, phi_dd = _me.dynamicsymbols('theta_ phi_', 2)
|
10 |
+
frame_n = _me.ReferenceFrame('n')
|
11 |
+
body_a_cm = _me.Point('a_cm')
|
12 |
+
body_a_cm.set_vel(frame_n, 0)
|
13 |
+
body_a_f = _me.ReferenceFrame('a_f')
|
14 |
+
body_a = _me.RigidBody('a', body_a_cm, body_a_f, _sm.symbols('m'), (_me.outer(body_a_f.x,body_a_f.x),body_a_cm))
|
15 |
+
body_b_cm = _me.Point('b_cm')
|
16 |
+
body_b_cm.set_vel(frame_n, 0)
|
17 |
+
body_b_f = _me.ReferenceFrame('b_f')
|
18 |
+
body_b = _me.RigidBody('b', body_b_cm, body_b_f, _sm.symbols('m'), (_me.outer(body_b_f.x,body_b_f.x),body_b_cm))
|
19 |
+
body_a_f.orient(frame_n, 'Axis', [theta, frame_n.y])
|
20 |
+
body_b_f.orient(body_a_f, 'Axis', [phi, body_a_f.z])
|
21 |
+
point_o = _me.Point('o')
|
22 |
+
la = (lb-h/2)/2
|
23 |
+
body_a_cm.set_pos(point_o, la*body_a_f.z)
|
24 |
+
body_b_cm.set_pos(point_o, lb*body_a_f.z)
|
25 |
+
body_a_f.set_ang_vel(frame_n, omega*frame_n.y)
|
26 |
+
body_b_f.set_ang_vel(body_a_f, alpha*body_a_f.z)
|
27 |
+
point_o.set_vel(frame_n, 0)
|
28 |
+
body_a_cm.v2pt_theory(point_o,frame_n,body_a_f)
|
29 |
+
body_b_cm.v2pt_theory(point_o,frame_n,body_a_f)
|
30 |
+
ma = _sm.symbols('ma')
|
31 |
+
body_a.mass = ma
|
32 |
+
mb = _sm.symbols('mb')
|
33 |
+
body_b.mass = mb
|
34 |
+
iaxx = 1/12*ma*(2*la)**2
|
35 |
+
iayy = iaxx
|
36 |
+
iazz = 0
|
37 |
+
ibxx = 1/12*mb*h**2
|
38 |
+
ibyy = 1/12*mb*(w**2+h**2)
|
39 |
+
ibzz = 1/12*mb*w**2
|
40 |
+
body_a.inertia = (_me.inertia(body_a_f, iaxx, iayy, iazz, 0, 0, 0), body_a_cm)
|
41 |
+
body_b.inertia = (_me.inertia(body_b_f, ibxx, ibyy, ibzz, 0, 0, 0), body_b_cm)
|
42 |
+
force_a = body_a.mass*(g*frame_n.z)
|
43 |
+
force_b = body_b.mass*(g*frame_n.z)
|
44 |
+
kd_eqs = [theta_d - omega, phi_d - alpha]
|
45 |
+
forceList = [(body_a.masscenter,body_a.mass*(g*frame_n.z)), (body_b.masscenter,body_b.mass*(g*frame_n.z))]
|
46 |
+
kane = _me.KanesMethod(frame_n, q_ind=[theta,phi], u_ind=[omega, alpha], kd_eqs = kd_eqs)
|
47 |
+
fr, frstar = kane.kanes_equations([body_a, body_b], forceList)
|
48 |
+
zero = fr+frstar
|
49 |
+
from pydy.system import System
|
50 |
+
sys = System(kane, constants = {g:9.81, lb:0.2, w:0.2, h:0.1, ma:0.01, mb:0.1},
|
51 |
+
specifieds={},
|
52 |
+
initial_conditions={theta:_np.deg2rad(90), phi:_np.deg2rad(0.5), omega:0, alpha:0},
|
53 |
+
times = _np.linspace(0.0, 10, 10/0.02))
|
54 |
+
|
55 |
+
y=sys.integrate()
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/pydy-example-repo/double_pendulum.al
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
MOTIONVARIABLES' Q{2}', U{2}'
|
2 |
+
CONSTANTS L,M,G
|
3 |
+
NEWTONIAN N
|
4 |
+
FRAMES A,B
|
5 |
+
SIMPROT(N, A, 3, Q1)
|
6 |
+
SIMPROT(N, B, 3, Q2)
|
7 |
+
W_A_N>=U1*N3>
|
8 |
+
W_B_N>=U2*N3>
|
9 |
+
POINT O
|
10 |
+
PARTICLES P,R
|
11 |
+
P_O_P> = L*A1>
|
12 |
+
P_P_R> = L*B1>
|
13 |
+
V_O_N> = 0>
|
14 |
+
V2PTS(N, A, O, P)
|
15 |
+
V2PTS(N, B, P, R)
|
16 |
+
MASS P=M, R=M
|
17 |
+
Q1' = U1
|
18 |
+
Q2' = U2
|
19 |
+
GRAVITY(G*N1>)
|
20 |
+
ZERO = FR() + FRSTAR()
|
21 |
+
KANE()
|
22 |
+
INPUT M=1,G=9.81,L=1
|
23 |
+
INPUT Q1=.1,Q2=.2,U1=0,U2=0
|
24 |
+
INPUT TFINAL=10, INTEGSTP=.01
|
25 |
+
CODE DYNAMICS() some_filename.c
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/pydy-example-repo/double_pendulum.py
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import sympy.physics.mechanics as _me
|
2 |
+
import sympy as _sm
|
3 |
+
import math as m
|
4 |
+
import numpy as _np
|
5 |
+
|
6 |
+
q1, q2, u1, u2 = _me.dynamicsymbols('q1 q2 u1 u2')
|
7 |
+
q1_d, q2_d, u1_d, u2_d = _me.dynamicsymbols('q1_ q2_ u1_ u2_', 1)
|
8 |
+
l, m, g = _sm.symbols('l m g', real=True)
|
9 |
+
frame_n = _me.ReferenceFrame('n')
|
10 |
+
frame_a = _me.ReferenceFrame('a')
|
11 |
+
frame_b = _me.ReferenceFrame('b')
|
12 |
+
frame_a.orient(frame_n, 'Axis', [q1, frame_n.z])
|
13 |
+
frame_b.orient(frame_n, 'Axis', [q2, frame_n.z])
|
14 |
+
frame_a.set_ang_vel(frame_n, u1*frame_n.z)
|
15 |
+
frame_b.set_ang_vel(frame_n, u2*frame_n.z)
|
16 |
+
point_o = _me.Point('o')
|
17 |
+
particle_p = _me.Particle('p', _me.Point('p_pt'), _sm.Symbol('m'))
|
18 |
+
particle_r = _me.Particle('r', _me.Point('r_pt'), _sm.Symbol('m'))
|
19 |
+
particle_p.point.set_pos(point_o, l*frame_a.x)
|
20 |
+
particle_r.point.set_pos(particle_p.point, l*frame_b.x)
|
21 |
+
point_o.set_vel(frame_n, 0)
|
22 |
+
particle_p.point.v2pt_theory(point_o,frame_n,frame_a)
|
23 |
+
particle_r.point.v2pt_theory(particle_p.point,frame_n,frame_b)
|
24 |
+
particle_p.mass = m
|
25 |
+
particle_r.mass = m
|
26 |
+
force_p = particle_p.mass*(g*frame_n.x)
|
27 |
+
force_r = particle_r.mass*(g*frame_n.x)
|
28 |
+
kd_eqs = [q1_d - u1, q2_d - u2]
|
29 |
+
forceList = [(particle_p.point,particle_p.mass*(g*frame_n.x)), (particle_r.point,particle_r.mass*(g*frame_n.x))]
|
30 |
+
kane = _me.KanesMethod(frame_n, q_ind=[q1,q2], u_ind=[u1, u2], kd_eqs = kd_eqs)
|
31 |
+
fr, frstar = kane.kanes_equations([particle_p, particle_r], forceList)
|
32 |
+
zero = fr+frstar
|
33 |
+
from pydy.system import System
|
34 |
+
sys = System(kane, constants = {l:1, m:1, g:9.81},
|
35 |
+
specifieds={},
|
36 |
+
initial_conditions={q1:.1, q2:.2, u1:0, u2:0},
|
37 |
+
times = _np.linspace(0.0, 10, 10/.01))
|
38 |
+
|
39 |
+
y=sys.integrate()
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/pydy-example-repo/mass_spring_damper.al
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
CONSTANTS M,K,B,G
|
2 |
+
MOTIONVARIABLES' POSITION',SPEED'
|
3 |
+
VARIABLES O
|
4 |
+
FORCE = O*SIN(T)
|
5 |
+
NEWTONIAN CEILING
|
6 |
+
POINTS ORIGIN
|
7 |
+
V_ORIGIN_CEILING> = 0>
|
8 |
+
PARTICLES BLOCK
|
9 |
+
P_ORIGIN_BLOCK> = POSITION*CEILING1>
|
10 |
+
MASS BLOCK=M
|
11 |
+
V_BLOCK_CEILING>=SPEED*CEILING1>
|
12 |
+
POSITION' = SPEED
|
13 |
+
FORCE_MAGNITUDE = M*G-K*POSITION-B*SPEED+FORCE
|
14 |
+
FORCE_BLOCK>=EXPLICIT(FORCE_MAGNITUDE*CEILING1>)
|
15 |
+
ZERO = FR() + FRSTAR()
|
16 |
+
KANE()
|
17 |
+
INPUT TFINAL=10.0, INTEGSTP=0.01
|
18 |
+
INPUT M=1.0, K=1.0, B=0.2, G=9.8, POSITION=0.1, SPEED=-1.0, O=2
|
19 |
+
CODE DYNAMICS() dummy_file.c
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/pydy-example-repo/mass_spring_damper.py
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import sympy.physics.mechanics as _me
|
2 |
+
import sympy as _sm
|
3 |
+
import math as m
|
4 |
+
import numpy as _np
|
5 |
+
|
6 |
+
m, k, b, g = _sm.symbols('m k b g', real=True)
|
7 |
+
position, speed = _me.dynamicsymbols('position speed')
|
8 |
+
position_d, speed_d = _me.dynamicsymbols('position_ speed_', 1)
|
9 |
+
o = _me.dynamicsymbols('o')
|
10 |
+
force = o*_sm.sin(_me.dynamicsymbols._t)
|
11 |
+
frame_ceiling = _me.ReferenceFrame('ceiling')
|
12 |
+
point_origin = _me.Point('origin')
|
13 |
+
point_origin.set_vel(frame_ceiling, 0)
|
14 |
+
particle_block = _me.Particle('block', _me.Point('block_pt'), _sm.Symbol('m'))
|
15 |
+
particle_block.point.set_pos(point_origin, position*frame_ceiling.x)
|
16 |
+
particle_block.mass = m
|
17 |
+
particle_block.point.set_vel(frame_ceiling, speed*frame_ceiling.x)
|
18 |
+
force_magnitude = m*g-k*position-b*speed+force
|
19 |
+
force_block = (force_magnitude*frame_ceiling.x).subs({position_d:speed})
|
20 |
+
kd_eqs = [position_d - speed]
|
21 |
+
forceList = [(particle_block.point,(force_magnitude*frame_ceiling.x).subs({position_d:speed}))]
|
22 |
+
kane = _me.KanesMethod(frame_ceiling, q_ind=[position], u_ind=[speed], kd_eqs = kd_eqs)
|
23 |
+
fr, frstar = kane.kanes_equations([particle_block], forceList)
|
24 |
+
zero = fr+frstar
|
25 |
+
from pydy.system import System
|
26 |
+
sys = System(kane, constants = {m:1.0, k:1.0, b:0.2, g:9.8},
|
27 |
+
specifieds={_me.dynamicsymbols('t'):lambda x, t: t, o:2},
|
28 |
+
initial_conditions={position:0.1, speed:-1*1.0},
|
29 |
+
times = _np.linspace(0.0, 10.0, 10.0/0.01))
|
30 |
+
|
31 |
+
y=sys.integrate()
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/pydy-example-repo/non_min_pendulum.al
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
MOTIONVARIABLES' Q{2}''
|
2 |
+
CONSTANTS L,M,G
|
3 |
+
NEWTONIAN N
|
4 |
+
POINT PN
|
5 |
+
V_PN_N> = 0>
|
6 |
+
THETA1 = ATAN(Q2/Q1)
|
7 |
+
FRAMES A
|
8 |
+
SIMPROT(N, A, 3, THETA1)
|
9 |
+
PARTICLES P
|
10 |
+
P_PN_P> = Q1*N1>+Q2*N2>
|
11 |
+
MASS P=M
|
12 |
+
V_P_N>=DT(P_P_PN>, N)
|
13 |
+
F_V = DOT(EXPRESS(V_P_N>,A), A1>)
|
14 |
+
GRAVITY(G*N1>)
|
15 |
+
DEPENDENT[1] = F_V
|
16 |
+
CONSTRAIN(DEPENDENT[Q1'])
|
17 |
+
ZERO=FR()+FRSTAR()
|
18 |
+
F_C = MAG(P_P_PN>)-L
|
19 |
+
CONFIG[1]=F_C
|
20 |
+
ZERO[2]=CONFIG[1]
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/pydy-example-repo/non_min_pendulum.py
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import sympy.physics.mechanics as _me
|
2 |
+
import sympy as _sm
|
3 |
+
import math as m
|
4 |
+
import numpy as _np
|
5 |
+
|
6 |
+
q1, q2 = _me.dynamicsymbols('q1 q2')
|
7 |
+
q1_d, q2_d = _me.dynamicsymbols('q1_ q2_', 1)
|
8 |
+
q1_dd, q2_dd = _me.dynamicsymbols('q1_ q2_', 2)
|
9 |
+
l, m, g = _sm.symbols('l m g', real=True)
|
10 |
+
frame_n = _me.ReferenceFrame('n')
|
11 |
+
point_pn = _me.Point('pn')
|
12 |
+
point_pn.set_vel(frame_n, 0)
|
13 |
+
theta1 = _sm.atan(q2/q1)
|
14 |
+
frame_a = _me.ReferenceFrame('a')
|
15 |
+
frame_a.orient(frame_n, 'Axis', [theta1, frame_n.z])
|
16 |
+
particle_p = _me.Particle('p', _me.Point('p_pt'), _sm.Symbol('m'))
|
17 |
+
particle_p.point.set_pos(point_pn, q1*frame_n.x+q2*frame_n.y)
|
18 |
+
particle_p.mass = m
|
19 |
+
particle_p.point.set_vel(frame_n, (point_pn.pos_from(particle_p.point)).dt(frame_n))
|
20 |
+
f_v = _me.dot((particle_p.point.vel(frame_n)).express(frame_a), frame_a.x)
|
21 |
+
force_p = particle_p.mass*(g*frame_n.x)
|
22 |
+
dependent = _sm.Matrix([[0]])
|
23 |
+
dependent[0] = f_v
|
24 |
+
velocity_constraints = [i for i in dependent]
|
25 |
+
u_q1_d = _me.dynamicsymbols('u_q1_d')
|
26 |
+
u_q2_d = _me.dynamicsymbols('u_q2_d')
|
27 |
+
kd_eqs = [q1_d-u_q1_d, q2_d-u_q2_d]
|
28 |
+
forceList = [(particle_p.point,particle_p.mass*(g*frame_n.x))]
|
29 |
+
kane = _me.KanesMethod(frame_n, q_ind=[q1,q2], u_ind=[u_q2_d], u_dependent=[u_q1_d], kd_eqs = kd_eqs, velocity_constraints = velocity_constraints)
|
30 |
+
fr, frstar = kane.kanes_equations([particle_p], forceList)
|
31 |
+
zero = fr+frstar
|
32 |
+
f_c = point_pn.pos_from(particle_p.point).magnitude()-l
|
33 |
+
config = _sm.Matrix([[0]])
|
34 |
+
config[0] = f_c
|
35 |
+
zero = zero.row_insert(zero.shape[0], _sm.Matrix([[0]]))
|
36 |
+
zero[zero.shape[0]-1] = config[0]
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/ruletest1.al
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
% ruletest1.al
|
2 |
+
CONSTANTS F = 3, G = 9.81
|
3 |
+
CONSTANTS A, B
|
4 |
+
CONSTANTS S, S1, S2+, S3+, S4-
|
5 |
+
CONSTANTS K{4}, L{1:3}, P{1:2,1:3}
|
6 |
+
CONSTANTS C{2,3}
|
7 |
+
E1 = A*F + S2 - G
|
8 |
+
E2 = F^2 + K3*K2*G
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/ruletest10.py
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import sympy.physics.mechanics as _me
|
2 |
+
import sympy as _sm
|
3 |
+
import math as m
|
4 |
+
import numpy as _np
|
5 |
+
|
6 |
+
x, y = _me.dynamicsymbols('x y')
|
7 |
+
a, b = _sm.symbols('a b', real=True)
|
8 |
+
e = a*(b*x+y)**2
|
9 |
+
m = _sm.Matrix([e,e]).reshape(2, 1)
|
10 |
+
e = e.expand()
|
11 |
+
m = _sm.Matrix([i.expand() for i in m]).reshape((m).shape[0], (m).shape[1])
|
12 |
+
e = _sm.factor(e, x)
|
13 |
+
m = _sm.Matrix([_sm.factor(i,x) for i in m]).reshape((m).shape[0], (m).shape[1])
|
14 |
+
eqn = _sm.Matrix([[0]])
|
15 |
+
eqn[0] = a*x+b*y
|
16 |
+
eqn = eqn.row_insert(eqn.shape[0], _sm.Matrix([[0]]))
|
17 |
+
eqn[eqn.shape[0]-1] = 2*a*x-3*b*y
|
18 |
+
print(_sm.solve(eqn,x,y))
|
19 |
+
rhs_y = _sm.solve(eqn,x,y)[y]
|
20 |
+
e = (x+y)**2+2*x**2
|
21 |
+
e.collect(x)
|
22 |
+
a, b, c = _sm.symbols('a b c', real=True)
|
23 |
+
m = _sm.Matrix([a,b,c,0]).reshape(2, 2)
|
24 |
+
m2 = _sm.Matrix([i.subs({a:1,b:2,c:3}) for i in m]).reshape((m).shape[0], (m).shape[1])
|
25 |
+
eigvalue = _sm.Matrix([i.evalf() for i in (m2).eigenvals().keys()])
|
26 |
+
eigvec = _sm.Matrix([i[2][0].evalf() for i in (m2).eigenvects()]).reshape(m2.shape[0], m2.shape[1])
|
27 |
+
frame_n = _me.ReferenceFrame('n')
|
28 |
+
frame_a = _me.ReferenceFrame('a')
|
29 |
+
frame_a.orient(frame_n, 'Axis', [x, frame_n.x])
|
30 |
+
frame_a.orient(frame_n, 'Axis', [_sm.pi/2, frame_n.x])
|
31 |
+
c1, c2, c3 = _sm.symbols('c1 c2 c3', real=True)
|
32 |
+
v = c1*frame_a.x+c2*frame_a.y+c3*frame_a.z
|
33 |
+
point_o = _me.Point('o')
|
34 |
+
point_p = _me.Point('p')
|
35 |
+
point_o.set_pos(point_p, c1*frame_a.x)
|
36 |
+
v = (v).express(frame_n)
|
37 |
+
point_o.set_pos(point_p, (point_o.pos_from(point_p)).express(frame_n))
|
38 |
+
frame_a.set_ang_vel(frame_n, c3*frame_a.z)
|
39 |
+
print(frame_n.ang_vel_in(frame_a))
|
40 |
+
point_p.v2pt_theory(point_o,frame_n,frame_a)
|
41 |
+
particle_p1 = _me.Particle('p1', _me.Point('p1_pt'), _sm.Symbol('m'))
|
42 |
+
particle_p2 = _me.Particle('p2', _me.Point('p2_pt'), _sm.Symbol('m'))
|
43 |
+
particle_p2.point.v2pt_theory(particle_p1.point,frame_n,frame_a)
|
44 |
+
point_p.a2pt_theory(particle_p1.point,frame_n,frame_a)
|
45 |
+
body_b1_cm = _me.Point('b1_cm')
|
46 |
+
body_b1_cm.set_vel(frame_n, 0)
|
47 |
+
body_b1_f = _me.ReferenceFrame('b1_f')
|
48 |
+
body_b1 = _me.RigidBody('b1', body_b1_cm, body_b1_f, _sm.symbols('m'), (_me.outer(body_b1_f.x,body_b1_f.x),body_b1_cm))
|
49 |
+
body_b2_cm = _me.Point('b2_cm')
|
50 |
+
body_b2_cm.set_vel(frame_n, 0)
|
51 |
+
body_b2_f = _me.ReferenceFrame('b2_f')
|
52 |
+
body_b2 = _me.RigidBody('b2', body_b2_cm, body_b2_f, _sm.symbols('m'), (_me.outer(body_b2_f.x,body_b2_f.x),body_b2_cm))
|
53 |
+
g = _sm.symbols('g', real=True)
|
54 |
+
force_p1 = particle_p1.mass*(g*frame_n.x)
|
55 |
+
force_p2 = particle_p2.mass*(g*frame_n.x)
|
56 |
+
force_b1 = body_b1.mass*(g*frame_n.x)
|
57 |
+
force_b2 = body_b2.mass*(g*frame_n.x)
|
58 |
+
z = _me.dynamicsymbols('z')
|
59 |
+
v = x*frame_a.x+y*frame_a.z
|
60 |
+
point_o.set_pos(point_p, x*frame_a.x+y*frame_a.y)
|
61 |
+
v = (v).subs({x:2*z, y:z})
|
62 |
+
point_o.set_pos(point_p, (point_o.pos_from(point_p)).subs({x:2*z, y:z}))
|
63 |
+
force_o = -1*(x*y*frame_a.x)
|
64 |
+
force_p1 = particle_p1.mass*(g*frame_n.x)+ x*y*frame_a.x
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/ruletest11.al
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
VARIABLES X, Y
|
2 |
+
CONSTANTS A{1:2, 1:2}, B{1:2}
|
3 |
+
EQN[1] = A11*x + A12*y - B1
|
4 |
+
EQN[2] = A21*x + A22*y - B2
|
5 |
+
INPUT A11=2, A12=5, A21=3, A22=4, B1=7, B2=6
|
6 |
+
CODE ALGEBRAIC(EQN, X, Y) some_filename.c
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/ruletest3.al
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
% ruletest3.al
|
2 |
+
FRAMES A, B
|
3 |
+
NEWTONIAN N
|
4 |
+
|
5 |
+
VARIABLES X{3}
|
6 |
+
CONSTANTS L
|
7 |
+
|
8 |
+
V1> = X1*A1> + X2*A2> + X3*A3>
|
9 |
+
V2> = X1*B1> + X2*B2> + X3*B3>
|
10 |
+
V3> = X1*N1> + X2*N2> + X3*N3>
|
11 |
+
|
12 |
+
V> = V1> + V2> + V3>
|
13 |
+
|
14 |
+
POINTS C, D
|
15 |
+
POINTS PO{3}
|
16 |
+
|
17 |
+
PARTICLES L
|
18 |
+
PARTICLES P{3}
|
19 |
+
|
20 |
+
BODIES S
|
21 |
+
BODIES R{2}
|
22 |
+
|
23 |
+
V4> = X1*S1> + X2*S2> + X3*S3>
|
24 |
+
|
25 |
+
P_C_SO> = L*N1>
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/ruletest4.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import sympy.physics.mechanics as _me
|
2 |
+
import sympy as _sm
|
3 |
+
import math as m
|
4 |
+
import numpy as _np
|
5 |
+
|
6 |
+
frame_a = _me.ReferenceFrame('a')
|
7 |
+
frame_b = _me.ReferenceFrame('b')
|
8 |
+
q1, q2, q3 = _me.dynamicsymbols('q1 q2 q3')
|
9 |
+
frame_b.orient(frame_a, 'Axis', [q3, frame_a.x])
|
10 |
+
dcm = frame_a.dcm(frame_b)
|
11 |
+
m = dcm*3-frame_a.dcm(frame_b)
|
12 |
+
r = _me.dynamicsymbols('r')
|
13 |
+
circle_area = _sm.pi*r**2
|
14 |
+
u, a = _me.dynamicsymbols('u a')
|
15 |
+
x, y = _me.dynamicsymbols('x y')
|
16 |
+
s = u*_me.dynamicsymbols._t-1/2*a*_me.dynamicsymbols._t**2
|
17 |
+
expr1 = 2*a*0.5-1.25+0.25
|
18 |
+
expr2 = -1*x**2+y**2+0.25*(x+y)**2
|
19 |
+
expr3 = 0.5*10**(-10)
|
20 |
+
dyadic = _me.outer(frame_a.x, frame_a.x)+_me.outer(frame_a.y, frame_a.y)+_me.outer(frame_a.z, frame_a.z)
|
venv/lib/python3.10/site-packages/sympy/parsing/autolev/test-examples/ruletest9.al
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
% ruletest9.al
|
2 |
+
NEWTONIAN N
|
3 |
+
FRAMES A
|
4 |
+
A> = 0>
|
5 |
+
D>> = EXPRESS(1>>, A)
|
6 |
+
|
7 |
+
POINTS PO{2}
|
8 |
+
PARTICLES P{2}
|
9 |
+
MOTIONVARIABLES' C{3}'
|
10 |
+
BODIES R
|
11 |
+
P_P1_PO2> = C1*A1>
|
12 |
+
V> = 2*P_P1_PO2> + C2*A2>
|
13 |
+
|
14 |
+
W_A_N> = C3*A3>
|
15 |
+
V> = 2*W_A_N> + C2*A2>
|
16 |
+
W_R_N> = C3*A3>
|
17 |
+
V> = 2*W_R_N> + C2*A2>
|
18 |
+
|
19 |
+
ALF_A_N> = DT(W_A_N>, A)
|
20 |
+
V> = 2*ALF_A_N> + C2*A2>
|
21 |
+
|
22 |
+
V_P1_A> = C1*A1> + C3*A2>
|
23 |
+
A_RO_N> = C2*A2>
|
24 |
+
V_A> = CROSS(A_RO_N>, V_P1_A>)
|
25 |
+
|
26 |
+
X_B_C> = V_A>
|
27 |
+
X_B_D> = 2*X_B_C>
|
28 |
+
A_B_C_D_E> = X_B_D>*2
|
29 |
+
|
30 |
+
A_B_C = 2*C1*C2*C3
|
31 |
+
A_B_C += 2*C1
|
32 |
+
A_B_C := 3*C1
|
33 |
+
|
34 |
+
MOTIONVARIABLES' Q{2}', U{2}'
|
35 |
+
Q1' = U1
|
36 |
+
Q2' = U2
|
37 |
+
|
38 |
+
VARIABLES X'', Y''
|
39 |
+
SPECIFIED YY
|
40 |
+
Y'' = X*X'^2 + 1
|
41 |
+
YY = X*X'^2 + 1
|
42 |
+
|
43 |
+
M[1] = 2*X
|
44 |
+
M[2] = 2*Y
|
45 |
+
A = 2*M[1]
|
46 |
+
|
47 |
+
M = [1,2,3;4,5,6;7,8,9]
|
48 |
+
M[1, 2] = 5
|
49 |
+
A = M[1, 2]*2
|
50 |
+
|
51 |
+
FORCE_RO> = Q1*N1>
|
52 |
+
TORQUE_A> = Q2*N3>
|
53 |
+
FORCE_RO> = Q2*N2>
|
54 |
+
F> = FORCE_RO>*2
|
venv/lib/python3.10/site-packages/sympy/parsing/tests/__init__.py
ADDED
File without changes
|
venv/lib/python3.10/site-packages/sympy/parsing/tests/__pycache__/__init__.cpython-310.pyc
ADDED
Binary file (187 Bytes). View file
|
|
venv/lib/python3.10/site-packages/sympy/parsing/tests/__pycache__/test_ast_parser.cpython-310.pyc
ADDED
Binary file (1.1 kB). View file
|
|
venv/lib/python3.10/site-packages/sympy/parsing/tests/__pycache__/test_autolev.cpython-310.pyc
ADDED
Binary file (5.68 kB). View file
|
|
venv/lib/python3.10/site-packages/sympy/parsing/tests/__pycache__/test_c_parser.cpython-310.pyc
ADDED
Binary file (48.5 kB). View file
|
|
venv/lib/python3.10/site-packages/sympy/parsing/tests/__pycache__/test_fortran_parser.cpython-310.pyc
ADDED
Binary file (7.16 kB). View file
|
|
venv/lib/python3.10/site-packages/sympy/parsing/tests/__pycache__/test_implicit_multiplication_application.cpython-310.pyc
ADDED
Binary file (5.55 kB). View file
|
|
venv/lib/python3.10/site-packages/sympy/parsing/tests/__pycache__/test_latex.cpython-310.pyc
ADDED
Binary file (11.2 kB). View file
|
|