Also, I get this error when trying to run you code: --------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-1-ee4045953474> in <module>() 30 31 # Set Positions ---> 32 ChassisC.set_pos(GlobalCoord0,(ChassisDeltax * inertial_frame.x + ChassisDeltay * inertial_frame.y + ChassisDeltaz * inertial_frame.z)) 33 CGpos.set_pos(ChassisC,(CGposx * Chassis_frame.x + CGposy * Chassis_frame.y + CGposz * Chassis_frame.z)) 34 LUCAMP.set_pos(ChassisC,(LUCAMPx * Chassis_frame.x + LUCAMPy * Chassis_frame.y + LUCAMPz * Chassis_frame.z))
NameError: name 'ChassisC' is not defined moorepants.info +01 530-601-9791 On Mon, Jul 17, 2017 at 4:53 PM, Jason Moore <moorepa...@gmail.com> wrote: > One issue you may be having is the mixture of sympy.vector, > sympy.physics.vector, and sympy.geometry. These packages are not designed > to work with each other currently. I recommend sticking to one of those > depending on what you are trying to do. > > moorepants.info > +01 530-601-9791 <(530)%20601-9791> > > On Mon, Jul 17, 2017 at 11:11 AM, <shoulddt...@gmail.com> wrote: > >> Hello all, >> I am trying to use Sympy to model a multi-body dynamic system. I am >> trying to create the required points and coordinate systems to model the >> system in 3d. I am running into trouble creating symbolic points in 3 >> dimensions. I can create the points as shown below, but whenever I attempt >> to perform a math operation on the points, such as deriving the midpoint or >> distance, I receive an error saying that "Point" is an unsupported type, or >> that the "Point" has no x-attribute. >> >> What is the correct method for declaring a 3 dimensional point >> symbolically, so that you can reference each component of it and perform >> operations to it? After declaring the point, I need to use the .set_pos >> function or an equivalent function to declare the position of the points. >> >> from __future__ import print_function, division >> from sympy import symbols, simplify, Segment >> from sympy.geometry import Point3D >> from sympy.vector import * >> from sympy.physics.mechanics import dynamicsymbols, ReferenceFrame, Point >> from sympy.physics.vector import init_vprinting >> init_vprinting(use_latex='mathjax', pretty_print=False) >> >> # Declare reference frames >> inertial_frame = ReferenceFrame('inertial_frame') >> Chassis_frame = ReferenceFrame('Chassis_frame') >> LUCA_frame = ReferenceFrame('LUCA_frame') >> >> # Define the rotation angle symbols >> thRoll, thPitch, thYaw = dynamicsymbols('thRoll, thPitch, thYaw') >> thLUCAy = symbols('thLUCAy') ; thLUCAz = symbols('thLUCAz') >> thLUCAx, thLLCAx, thRUCAx, thRLCAx = dynamicsymbols('thLUCAx, thLLCAx, >> thRUCAx, thRLCAx') >> >> >> # Define Position Components >> ChassisDeltax = symbols('ChassisDeltax') >> ChassisDeltay = symbols('ChassisDeltay') >> ChassisDeltaz = symbols('ChassisDeltaz') >> CGposx = symbols('CGposx') >> CGposy = symbols('CGposy') >> CGposz = symbols('CGposz') >> LUCAMPx = symbols('LUCAMPx') >> LUCAMPy = symbols('LUCAMPy') >> LUCAMPz = symbols('LUCAMPz') >> >> # Set Positions >> ChassisC.set_pos(GlobalCoord0,(ChassisDeltax * inertial_frame.x + >> ChassisDeltay * inertial_frame.y + ChassisDeltaz * inertial_frame.z)) >> CGpos.set_pos(ChassisC,(CGposx * Chassis_frame.x + CGposy * >> Chassis_frame.y + CGposz * Chassis_frame.z)) >> LUCAMP.set_pos(ChassisC,(LUCAMPx * Chassis_frame.x + LUCAMPy * >> Chassis_frame.y + LUCAMPz * Chassis_frame.z)) >> >> # Center of Mass Locations >> CoM_Chassis = Point('CoM_Chassis') >> CoM_Chassis.set_pos(CGpos,0) >> CoM_LUCA = Point('CoM_LUCA') >> CoM_LUCA.set_pos(LUCAMP, ((LUCA_xOff / 2) * LUCA_frame.x + (LUCA_L / 2) * >> LUCA_frame.y + 0 * LUCA_frame.z)) >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "sympy" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to sympy+unsubscr...@googlegroups.com. >> To post to this group, send email to sympy@googlegroups.com. >> Visit this group at https://groups.google.com/group/sympy. >> To view this discussion on the web visit https://groups.google.com/d/ms >> gid/sympy/fbea45f1-c15d-455a-901b-b5cb5d0ae199%40googlegroups.com >> <https://groups.google.com/d/msgid/sympy/fbea45f1-c15d-455a-901b-b5cb5d0ae199%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To post to this group, send email to sympy@googlegroups.com. Visit this group at https://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAP7f1AgUm4B6PN5FG-1pAV3uNvyHO_4c3Sh-VfTk8GyQk9hj%2Bw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.