{ "cells": [ { "cell_type": "code", "execution_count": null, "id": "8a403def", "metadata": {}, "outputs": [], "source": [ "import sympy as sm\n", "import sympy.physics.mechanics as me\n", "me.init_vprinting()" ] }, { "cell_type": "code", "execution_count": null, "id": "e3ef9c68", "metadata": {}, "outputs": [], "source": [ "N, A, B = sm.symbols(\"N, A, B\", cls=me.ReferenceFrame)" ] }, { "cell_type": "code", "execution_count": null, "id": "cc2c3292", "metadata": {}, "outputs": [], "source": [ "alpha, beta = me.dynamicsymbols('alpha, beta')\n", "d, w, c, l = sm.symbols('d, w, c, l')" ] }, { "cell_type": "code", "execution_count": null, "id": "adea1e25", "metadata": {}, "outputs": [], "source": [ "A.orient_axis(N, alpha, N.z)\n", "B.orient_axis(A, beta, A.x)" ] }, { "cell_type": "code", "execution_count": null, "id": "12110949", "metadata": {}, "outputs": [], "source": [ "N_v_S = -d*alpha.diff()*A.y\n", "N_v_S" ] }, { "cell_type": "code", "execution_count": null, "id": "a0934aac", "metadata": {}, "outputs": [], "source": [ "A.ang_vel_in(N) + B.ang_vel_in(A)" ] }, { "cell_type": "code", "execution_count": null, "id": "342c2c2c", "metadata": {}, "outputs": [], "source": [ "B.ang_vel_in(N)" ] }, { "cell_type": "code", "execution_count": null, "id": "fe502526", "metadata": {}, "outputs": [], "source": [ "r_S_Q = -w*B.x - (c + l/2)*B.z\n", "r_S_Q" ] }, { "cell_type": "code", "execution_count": null, "id": "52e9c74f", "metadata": {}, "outputs": [], "source": [ "N_v_Q = N_v_S + B.ang_vel_in(N).cross(r_S_Q)\n", "N_v_Q" ] }, { "cell_type": "code", "execution_count": null, "id": "a44dd22b", "metadata": {}, "outputs": [], "source": [ "N_v_Q.express(B)" ] }, { "cell_type": "code", "execution_count": null, "id": "e6e2a169", "metadata": {}, "outputs": [], "source": [ "S, Q = sm.symbols('S, Q', cls=me.Point)" ] }, { "cell_type": "code", "execution_count": null, "id": "f256f998", "metadata": {}, "outputs": [], "source": [ "Q.set_pos(S, r_S_Q)" ] }, { "cell_type": "code", "execution_count": null, "id": "2d92dc1d", "metadata": {}, "outputs": [], "source": [ "Q.pos_from(S)" ] }, { "cell_type": "code", "execution_count": null, "id": "6b35ae5f", "metadata": {}, "outputs": [], "source": [ "S.set_vel(N, N_v_S)" ] }, { "cell_type": "code", "execution_count": null, "id": "0f36fa94", "metadata": {}, "outputs": [], "source": [ "S.vel(N)" ] }, { "cell_type": "code", "execution_count": null, "id": "c00e642f", "metadata": {}, "outputs": [], "source": [ "Q.v2pt_theory(S, N, B)" ] }, { "cell_type": "code", "execution_count": null, "id": "544de114", "metadata": {}, "outputs": [], "source": [ "s = me.dynamicsymbols('s')" ] }, { "cell_type": "code", "execution_count": null, "id": "d2429e55", "metadata": {}, "outputs": [], "source": [ "r_S_R = (s-w)*B.x + (l/2-c)*B.z\n", "r_S_R" ] }, { "cell_type": "code", "execution_count": null, "id": "347cb387", "metadata": {}, "outputs": [], "source": [ "B_v_R = s.diff()*B.x\n", "B_v_R" ] }, { "cell_type": "code", "execution_count": null, "id": "82940f3e", "metadata": {}, "outputs": [], "source": [ "B.ang_vel_in(A)" ] }, { "cell_type": "code", "execution_count": null, "id": "cf660c85", "metadata": {}, "outputs": [], "source": [ "A_v_R = B_v_R + me.cross(B.ang_vel_in(A), r_S_R)\n", "A_v_R" ] }, { "cell_type": "code", "execution_count": null, "id": "826fccc0", "metadata": {}, "outputs": [], "source": [ "me.cross(B.ang_acc_in(A), r_S_R)" ] }, { "cell_type": "code", "execution_count": null, "id": "8c783cf5", "metadata": {}, "outputs": [], "source": [ "me.cross(B.ang_vel_in(A), me.cross(B.ang_vel_in(A), r_S_R))" ] }, { "cell_type": "code", "execution_count": null, "id": "c72f8897", "metadata": {}, "outputs": [], "source": [ "2*me.cross(B.ang_vel_in(A), B_v_R)" ] }, { "cell_type": "code", "execution_count": null, "id": "873535c1", "metadata": {}, "outputs": [], "source": [ "B_v_R" ] }, { "cell_type": "code", "execution_count": null, "id": "259f1443", "metadata": {}, "outputs": [], "source": [ "t = me.dynamicsymbols._t" ] }, { "cell_type": "code", "execution_count": null, "id": "b2b74c2d", "metadata": {}, "outputs": [], "source": [ "B_v_R.diff(t, B)" ] }, { "cell_type": "code", "execution_count": null, "id": "4a4e4b5c", "metadata": {}, "outputs": [], "source": [ "R = me.Point('R')" ] }, { "cell_type": "code", "execution_count": null, "id": "ced534bc", "metadata": {}, "outputs": [], "source": [ "R.set_pos(S, r_S_R)" ] }, { "cell_type": "code", "execution_count": null, "id": "7a4a8720", "metadata": {}, "outputs": [], "source": [ "R.set_vel(B, B_v_R)" ] }, { "cell_type": "code", "execution_count": null, "id": "8dca98a8", "metadata": {}, "outputs": [], "source": [ "S.set_vel(A, 0)" ] }, { "cell_type": "code", "execution_count": null, "id": "78098491", "metadata": {}, "outputs": [], "source": [ "R.a1pt_theory(S, A, B)" ] }, { "cell_type": "code", "execution_count": null, "id": "0a5c34ca", "metadata": {}, "outputs": [], "source": [ "R.a1pt_theory(S, N, B)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.12" } }, "nbformat": 4, "nbformat_minor": 5 }