In the first place thanks for answering. My doubt right know is connected to the holomonic constraint (distance constraint) and the resulting equations of motion. I don't have much experience with this kind of systems, but the resulting equations of motion seem really large for such a simple problem.
Would it be possible for someone to check it? https://nbviewer.jupyter.org/github/ndevelop/sympy_3D_pendulum/blob/master/3D%20pendulum.ipynb <https://www.google.com/url?q=https%3A%2F%2Fnbviewer.jupyter.org%2Fgithub%2Fndevelop%2Fsympy_3D_pendulum%2Fblob%2Fmaster%2F3D%2520pendulum.ipynb&sa=D&sntz=1&usg=AFQjCNFv4yA58FeM-_iKxES4nt9dF1VIGA> The way I'm dealing with the distance constrain right now is: distance = (mass_cm.pos_from(anchor_cm)) #distance from the mass to the anchor point holonomic_constraint = [x_m - cable_length*distance.normalize().to_matrix(inertial_frame)[0], y_m - cable_length*distance.normalize().to_matrix(inertial_frame)[1], z_m - cable_length*distance.normalize().to_matrix(inertial_frame)[2] ] Thanks again, Nuno quarta-feira, 10 de Agosto de 2016 às 11:27:42 UTC+1, Jason Moore escreveu: > > Nuno, > > If you re using KanesMethod it supports two types of constraints: > holonomic and non-holonomic. You can supply these constraints to the > initializer and then the equations of motion will be formed that take the > nonholonomic constraints into account. Note that if you have holonomic > kinematic constraints, you'll have to ensure that any of your numerical > analyses code properly deals with that constraint, for example you may need > to numerically solve for your dependent coordinates when setting initial > conditions for simulation. > > > Jason > moorepants.info > +01 530-601-9791 > > On Tue, Aug 9, 2016 at 10:28 PM, Nuno <nmi...@gmail.com <javascript:>> > wrote: > >> Since I think I was not clear with the first question, I'm going to try >> and explain it better now. >> >> What I'm trying to achieve is a simple example similar to a 3D pendulum. >> At the time I talked about 2 masses, but one of those was the anchor point, >> so in fact everything can be done with only one mass. >> >> The twist here (in comparison with the simple 3D pendulum) is that >> besides the gravitational force, the mass is under the effect of: >> - A force in the x-axis of the mass >> - A torque about the z-axis of the mass >> >> Futhermore, since I'm choosing to describe the system using the (x,y,z) >> coordinates of the mass (and 3 euler angles) I was trying to add a distance >> constraint: >> (r_anchor - r_mass) - L = 0 >> >> Here is the jupyter notebook I created in order to define this system: >> >> https://nbviewer.jupyter.org/github/ndevelop/sympy_3D_pendulum/blob/master/3D%20pendulum.ipynb >> >> Could someone help me understand any mistake I'm making and point me in >> the right direction? >> >> Thanks in advance, >> Nuno >> >> sexta-feira, 5 de Agosto de 2016 às 18:01:39 UTC+1, Nuno escreveu: >>> >>> I'm trying to get familiar with the sympy and its uses in obtaining the >>> equations of motion of multi-body systems. >>> >>> In order to test things out I decided to use an example similar to a 3D >>> pendulum where I have two masses. However the mass that is not fixed has a >>> force and torque applied to it. So I wanted to have a distance constraint >>> between the two masses: (r_a - r_b)^2 - L = 0 >>> >>> However I'm not sure how I should set this constrain in python/sympy in >>> order to input it to KanesMethod() >>> >>> I'm sorry if this is question is a mess and thanks in advance for any >>> help >>> >> -- >> 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+un...@googlegroups.com <javascript:>. >> To post to this group, send email to sy...@googlegroups.com <javascript:> >> . >> 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/fd9a076b-8aad-4aeb-9765-6fc765d4119a%40googlegroups.com >> >> <https://groups.google.com/d/msgid/sympy/fd9a076b-8aad-4aeb-9765-6fc765d4119a%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/b4cdd147-1fcc-4667-bb8b-8ca36843a716%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.