vault backup: 2025-02-27 16:40:30
This commit is contained in:
commit
0f29ce51a4
@ -75,13 +75,6 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"C.orient_body_fixed(B, (q3, q4, 0), 'XZX')"
|
"C.orient_body_fixed(B, (q3, q4, 0), 'XZX')"
|
||||||
]
|
]
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": null,
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": []
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"metadata": {
|
"metadata": {
|
||||||
|
30
补课/多体动力学/05_vectors.py
Normal file
30
补课/多体动力学/05_vectors.py
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import sympy as sm
|
||||||
|
import sympy.physics.mechanics as me
|
||||||
|
sm.init_printing()
|
||||||
|
|
||||||
|
q1, q2, q3, q4 = sm.symbols('q1:5')
|
||||||
|
l1, l2, l3, l4 = sm.symbols('l1:5')
|
||||||
|
|
||||||
|
N, A, B, C = sm.symbols('N, A, B, C', cls=me.ReferenceFrame)
|
||||||
|
|
||||||
|
A.orient_body_fixed(N, (q1, q2, 0), 'ZXZ')
|
||||||
|
print(A.dcm(N))
|
||||||
|
|
||||||
|
B.orient_axis(A, q3, A.x)
|
||||||
|
|
||||||
|
C.orient_body_fixed(B, (q3, q4, 0), 'XZX')
|
||||||
|
|
||||||
|
r_P1_P2 = l1 * A.z
|
||||||
|
print(r_P1_P2)
|
||||||
|
|
||||||
|
r_P2_P3 = l2 * B.z
|
||||||
|
print(r_P2_P3)
|
||||||
|
|
||||||
|
r_P3_P4 = l3 *C.z - l4 *C.y
|
||||||
|
print(r_P3_P4)
|
||||||
|
|
||||||
|
r_P1_P4 = r_P1_P2 + r_P2_P3 + r_P3_P4
|
||||||
|
print(r_P1_P4)
|
||||||
|
|
||||||
|
print(r_P1_P4.express(B))
|
||||||
|
print(r_P1_P4.free_symbols(N))
|
0
补课/多体动力学/06_Vector_Differentiation.md
Normal file
0
补课/多体动力学/06_Vector_Differentiation.md
Normal file
@ -289,7 +289,7 @@
|
|||||||
],
|
],
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"kernelspec": {
|
"kernelspec": {
|
||||||
"display_name": "Turtle",
|
"display_name": "blade",
|
||||||
"language": "python",
|
"language": "python",
|
||||||
"name": "python3"
|
"name": "python3"
|
||||||
},
|
},
|
||||||
@ -303,7 +303,7 @@
|
|||||||
"name": "python",
|
"name": "python",
|
||||||
"nbconvert_exporter": "python",
|
"nbconvert_exporter": "python",
|
||||||
"pygments_lexer": "ipython3",
|
"pygments_lexer": "ipython3",
|
||||||
"version": "3.11.8"
|
"version": "3.10.16"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nbformat": 4,
|
"nbformat": 4,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user