ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 05 Mar 2019 10:43:13 +0100solving a physic problem using sagehttps://ask.sagemath.org/question/10625/solving-a-physic-problem-using-sage/Hi, I'm new in this community.
I want to solve a physic problem which requires differential equation system solutions.
I don't know if my equations are correctly set. Any suggestion is good. My problem is described by this image: http://img805.imageshack.us/img805/7043/lllzm.png
I have two masses (1/3m the first, 2/3m the second) linked with a rope. The rope is free to slide around a nail (the big black point in the image). The image shows the starting condition: a man keeps the first mass stopped and so the rope is kept stretched by the second mass.
I search three functions describing the kinematics of two masses after the man will leave the fist mass: vertical movement of mass A y(t), vertical movement of mass B j(t), and horizontal movement of mass B x(t).
My Cartesian reference system is x-y system in the image.
I have to solve the following equations:
1. $-\frac{2}{3}mg+T=\frac{2}{3}m \frac{d^2y}{dt^2}$
2. $-\frac{1}{3}mg+S_y=\frac{1}{3}m\frac{d^2j}{dt^2}$
3. $S_x=\frac{1}{3}m\frac{d^2x}{dt^2}$
4. $|T|=\sqrt{S_x^2+S_y^2}$
5. $|y(t)|=\sqrt{x(t)^2+j(t)^2}$
From the forth and the fifth equations I obtain two equations, so I have 5 equations in 5 unknowns. They are:
1) T force sustaining the second mass
2) Sx x-component of force sustaining the first mass
3) Sy y-component of force sustaining the first mass
4) y(t) position of the second mass
5) x(t) x-position of the first mass
6) j(t) y-position of the first mass
I hope my explanation is clear.
How can I obtain my solutions using Sage?
Thank you very much!!Fri, 18 Oct 2013 14:33:59 +0200https://ask.sagemath.org/question/10625/solving-a-physic-problem-using-sage/Comment by psp for <p>Hi, I'm new in this community.</p>
<p>I want to solve a physic problem which requires differential equation system solutions.</p>
<p>I don't know if my equations are correctly set. Any suggestion is good. My problem is described by this image: <a href="http://img805.imageshack.us/img805/7043/lllzm.png">http://img805.imageshack.us/img805/70...</a></p>
<p>I have two masses (1/3m the first, 2/3m the second) linked with a rope. The rope is free to slide around a nail (the big black point in the image). The image shows the starting condition: a man keeps the first mass stopped and so the rope is kept stretched by the second mass.</p>
<p>I search three functions describing the kinematics of two masses after the man will leave the fist mass: vertical movement of mass A y(t), vertical movement of mass B j(t), and horizontal movement of mass B x(t).</p>
<p>My Cartesian reference system is x-y system in the image.</p>
<p>I have to solve the following equations: </p>
<ol>
<li>$-\frac{2}{3}mg+T=\frac{2}{3}m \frac{d^2y}{dt^2}$</li>
<li>$-\frac{1}{3}mg+S_y=\frac{1}{3}m\frac{d^2j}{dt^2}$</li>
<li>$S_x=\frac{1}{3}m\frac{d^2x}{dt^2}$</li>
<li>$|T|=\sqrt{S_x^2+S_y^2}$</li>
<li>$|y(t)|=\sqrt{x(t)^2+j(t)^2}$</li>
</ol>
<p>From the forth and the fifth equations I obtain two equations, so I have 5 equations in 5 unknowns. They are: </p>
<p>1) T force sustaining the second mass </p>
<p>2) Sx x-component of force sustaining the first mass </p>
<p>3) Sy y-component of force sustaining the first mass </p>
<p>4) y(t) position of the second mass </p>
<p>5) x(t) x-position of the first mass </p>
<p>6) j(t) y-position of the first mass</p>
<p>I hope my explanation is clear.</p>
<p>How can I obtain my solutions using Sage?</p>
<p>Thank you very much!!</p>
https://ask.sagemath.org/question/10625/solving-a-physic-problem-using-sage/?comment=37031#post-id-37031After years, someone else could suggest a solution with Sage?Wed, 22 Mar 2017 12:28:35 +0100https://ask.sagemath.org/question/10625/solving-a-physic-problem-using-sage/?comment=37031#post-id-37031Comment by psp for <p>Hi, I'm new in this community.</p>
<p>I want to solve a physic problem which requires differential equation system solutions.</p>
<p>I don't know if my equations are correctly set. Any suggestion is good. My problem is described by this image: <a href="http://img805.imageshack.us/img805/7043/lllzm.png">http://img805.imageshack.us/img805/70...</a></p>
<p>I have two masses (1/3m the first, 2/3m the second) linked with a rope. The rope is free to slide around a nail (the big black point in the image). The image shows the starting condition: a man keeps the first mass stopped and so the rope is kept stretched by the second mass.</p>
<p>I search three functions describing the kinematics of two masses after the man will leave the fist mass: vertical movement of mass A y(t), vertical movement of mass B j(t), and horizontal movement of mass B x(t).</p>
<p>My Cartesian reference system is x-y system in the image.</p>
<p>I have to solve the following equations: </p>
<ol>
<li>$-\frac{2}{3}mg+T=\frac{2}{3}m \frac{d^2y}{dt^2}$</li>
<li>$-\frac{1}{3}mg+S_y=\frac{1}{3}m\frac{d^2j}{dt^2}$</li>
<li>$S_x=\frac{1}{3}m\frac{d^2x}{dt^2}$</li>
<li>$|T|=\sqrt{S_x^2+S_y^2}$</li>
<li>$|y(t)|=\sqrt{x(t)^2+j(t)^2}$</li>
</ol>
<p>From the forth and the fifth equations I obtain two equations, so I have 5 equations in 5 unknowns. They are: </p>
<p>1) T force sustaining the second mass </p>
<p>2) Sx x-component of force sustaining the first mass </p>
<p>3) Sy y-component of force sustaining the first mass </p>
<p>4) y(t) position of the second mass </p>
<p>5) x(t) x-position of the first mass </p>
<p>6) j(t) y-position of the first mass</p>
<p>I hope my explanation is clear.</p>
<p>How can I obtain my solutions using Sage?</p>
<p>Thank you very much!!</p>
https://ask.sagemath.org/question/10625/solving-a-physic-problem-using-sage/?comment=16532#post-id-16532Help!!Help!!Help!!Tue, 17 Dec 2013 13:13:31 +0100https://ask.sagemath.org/question/10625/solving-a-physic-problem-using-sage/?comment=16532#post-id-16532Comment by psp for <p>Hi, I'm new in this community.</p>
<p>I want to solve a physic problem which requires differential equation system solutions.</p>
<p>I don't know if my equations are correctly set. Any suggestion is good. My problem is described by this image: <a href="http://img805.imageshack.us/img805/7043/lllzm.png">http://img805.imageshack.us/img805/70...</a></p>
<p>I have two masses (1/3m the first, 2/3m the second) linked with a rope. The rope is free to slide around a nail (the big black point in the image). The image shows the starting condition: a man keeps the first mass stopped and so the rope is kept stretched by the second mass.</p>
<p>I search three functions describing the kinematics of two masses after the man will leave the fist mass: vertical movement of mass A y(t), vertical movement of mass B j(t), and horizontal movement of mass B x(t).</p>
<p>My Cartesian reference system is x-y system in the image.</p>
<p>I have to solve the following equations: </p>
<ol>
<li>$-\frac{2}{3}mg+T=\frac{2}{3}m \frac{d^2y}{dt^2}$</li>
<li>$-\frac{1}{3}mg+S_y=\frac{1}{3}m\frac{d^2j}{dt^2}$</li>
<li>$S_x=\frac{1}{3}m\frac{d^2x}{dt^2}$</li>
<li>$|T|=\sqrt{S_x^2+S_y^2}$</li>
<li>$|y(t)|=\sqrt{x(t)^2+j(t)^2}$</li>
</ol>
<p>From the forth and the fifth equations I obtain two equations, so I have 5 equations in 5 unknowns. They are: </p>
<p>1) T force sustaining the second mass </p>
<p>2) Sx x-component of force sustaining the first mass </p>
<p>3) Sy y-component of force sustaining the first mass </p>
<p>4) y(t) position of the second mass </p>
<p>5) x(t) x-position of the first mass </p>
<p>6) j(t) y-position of the first mass</p>
<p>I hope my explanation is clear.</p>
<p>How can I obtain my solutions using Sage?</p>
<p>Thank you very much!!</p>
https://ask.sagemath.org/question/10625/solving-a-physic-problem-using-sage/?comment=16877#post-id-16877Is my problem too difficult to set on Sage that no one could help me?Wed, 23 Oct 2013 11:59:55 +0200https://ask.sagemath.org/question/10625/solving-a-physic-problem-using-sage/?comment=16877#post-id-16877Comment by psp for <p>Hi, I'm new in this community.</p>
<p>I want to solve a physic problem which requires differential equation system solutions.</p>
<p>I don't know if my equations are correctly set. Any suggestion is good. My problem is described by this image: <a href="http://img805.imageshack.us/img805/7043/lllzm.png">http://img805.imageshack.us/img805/70...</a></p>
<p>I have two masses (1/3m the first, 2/3m the second) linked with a rope. The rope is free to slide around a nail (the big black point in the image). The image shows the starting condition: a man keeps the first mass stopped and so the rope is kept stretched by the second mass.</p>
<p>I search three functions describing the kinematics of two masses after the man will leave the fist mass: vertical movement of mass A y(t), vertical movement of mass B j(t), and horizontal movement of mass B x(t).</p>
<p>My Cartesian reference system is x-y system in the image.</p>
<p>I have to solve the following equations: </p>
<ol>
<li>$-\frac{2}{3}mg+T=\frac{2}{3}m \frac{d^2y}{dt^2}$</li>
<li>$-\frac{1}{3}mg+S_y=\frac{1}{3}m\frac{d^2j}{dt^2}$</li>
<li>$S_x=\frac{1}{3}m\frac{d^2x}{dt^2}$</li>
<li>$|T|=\sqrt{S_x^2+S_y^2}$</li>
<li>$|y(t)|=\sqrt{x(t)^2+j(t)^2}$</li>
</ol>
<p>From the forth and the fifth equations I obtain two equations, so I have 5 equations in 5 unknowns. They are: </p>
<p>1) T force sustaining the second mass </p>
<p>2) Sx x-component of force sustaining the first mass </p>
<p>3) Sy y-component of force sustaining the first mass </p>
<p>4) y(t) position of the second mass </p>
<p>5) x(t) x-position of the first mass </p>
<p>6) j(t) y-position of the first mass</p>
<p>I hope my explanation is clear.</p>
<p>How can I obtain my solutions using Sage?</p>
<p>Thank you very much!!</p>
https://ask.sagemath.org/question/10625/solving-a-physic-problem-using-sage/?comment=16891#post-id-16891No one can help me???Tue, 22 Oct 2013 12:54:47 +0200https://ask.sagemath.org/question/10625/solving-a-physic-problem-using-sage/?comment=16891#post-id-16891Answer by kcrisman for <p>Hi, I'm new in this community.</p>
<p>I want to solve a physic problem which requires differential equation system solutions.</p>
<p>I don't know if my equations are correctly set. Any suggestion is good. My problem is described by this image: <a href="http://img805.imageshack.us/img805/7043/lllzm.png">http://img805.imageshack.us/img805/70...</a></p>
<p>I have two masses (1/3m the first, 2/3m the second) linked with a rope. The rope is free to slide around a nail (the big black point in the image). The image shows the starting condition: a man keeps the first mass stopped and so the rope is kept stretched by the second mass.</p>
<p>I search three functions describing the kinematics of two masses after the man will leave the fist mass: vertical movement of mass A y(t), vertical movement of mass B j(t), and horizontal movement of mass B x(t).</p>
<p>My Cartesian reference system is x-y system in the image.</p>
<p>I have to solve the following equations: </p>
<ol>
<li>$-\frac{2}{3}mg+T=\frac{2}{3}m \frac{d^2y}{dt^2}$</li>
<li>$-\frac{1}{3}mg+S_y=\frac{1}{3}m\frac{d^2j}{dt^2}$</li>
<li>$S_x=\frac{1}{3}m\frac{d^2x}{dt^2}$</li>
<li>$|T|=\sqrt{S_x^2+S_y^2}$</li>
<li>$|y(t)|=\sqrt{x(t)^2+j(t)^2}$</li>
</ol>
<p>From the forth and the fifth equations I obtain two equations, so I have 5 equations in 5 unknowns. They are: </p>
<p>1) T force sustaining the second mass </p>
<p>2) Sx x-component of force sustaining the first mass </p>
<p>3) Sy y-component of force sustaining the first mass </p>
<p>4) y(t) position of the second mass </p>
<p>5) x(t) x-position of the first mass </p>
<p>6) j(t) y-position of the first mass</p>
<p>I hope my explanation is clear.</p>
<p>How can I obtain my solutions using Sage?</p>
<p>Thank you very much!!</p>
https://ask.sagemath.org/question/10625/solving-a-physic-problem-using-sage/?answer=37033#post-id-37033I think the problem is that you are really asking a physics question, not a Sage question. So anyone trying to answer will first have to make sure your physics is right. Certainly Sage does include several ways to solve systems of differential equations, numerically or exactly - see [these Maxima solvers](http://doc.sagemath.org/html/en/reference/calculus/sage/calculus/desolvers.html) or [this well-understood library of numerical methods](http://doc.sagemath.org/html/en/reference/calculus/sage/gsl/ode.html#sage.gsl.ode.ode_solver).Wed, 22 Mar 2017 13:52:42 +0100https://ask.sagemath.org/question/10625/solving-a-physic-problem-using-sage/?answer=37033#post-id-37033Answer by paulmasson for <p>Hi, I'm new in this community.</p>
<p>I want to solve a physic problem which requires differential equation system solutions.</p>
<p>I don't know if my equations are correctly set. Any suggestion is good. My problem is described by this image: <a href="http://img805.imageshack.us/img805/7043/lllzm.png">http://img805.imageshack.us/img805/70...</a></p>
<p>I have two masses (1/3m the first, 2/3m the second) linked with a rope. The rope is free to slide around a nail (the big black point in the image). The image shows the starting condition: a man keeps the first mass stopped and so the rope is kept stretched by the second mass.</p>
<p>I search three functions describing the kinematics of two masses after the man will leave the fist mass: vertical movement of mass A y(t), vertical movement of mass B j(t), and horizontal movement of mass B x(t).</p>
<p>My Cartesian reference system is x-y system in the image.</p>
<p>I have to solve the following equations: </p>
<ol>
<li>$-\frac{2}{3}mg+T=\frac{2}{3}m \frac{d^2y}{dt^2}$</li>
<li>$-\frac{1}{3}mg+S_y=\frac{1}{3}m\frac{d^2j}{dt^2}$</li>
<li>$S_x=\frac{1}{3}m\frac{d^2x}{dt^2}$</li>
<li>$|T|=\sqrt{S_x^2+S_y^2}$</li>
<li>$|y(t)|=\sqrt{x(t)^2+j(t)^2}$</li>
</ol>
<p>From the forth and the fifth equations I obtain two equations, so I have 5 equations in 5 unknowns. They are: </p>
<p>1) T force sustaining the second mass </p>
<p>2) Sx x-component of force sustaining the first mass </p>
<p>3) Sy y-component of force sustaining the first mass </p>
<p>4) y(t) position of the second mass </p>
<p>5) x(t) x-position of the first mass </p>
<p>6) j(t) y-position of the first mass</p>
<p>I hope my explanation is clear.</p>
<p>How can I obtain my solutions using Sage?</p>
<p>Thank you very much!!</p>
https://ask.sagemath.org/question/10625/solving-a-physic-problem-using-sage/?answer=37035#post-id-37035Your first three equations for the balance of the components of force look fine. Your fourth equation, while accurate, is less useful than writing the tensions $S_x$ and $S_y$ as projections of the total tension $T$:
$ \qquad S_x = \frac{x}{\sqrt{x^2+j^2}}T \qquad S_y = \frac{j}{\sqrt{x^2+j^2}}T $
Your fifth equation is incorrect, since it says that the amount of rope on each side of the nail is always equal, which is not true for a sliding inelastic rope. If the rope is of length $L$, then the constraint you want is
$ \qquad y + \sqrt{x^2+j^2} = L $
If you take a second derivative of this constraint with respect to time and substitute it in the first equation, you'll have an expression for the total tension $T$ as a function of $x$ and $j$ and their derivatives. You can use that to eliminate $T$ from the second and third equations. Then you should have three coupled nonlinear differential equations for $x$, $j$ and $y$ without $T$.
At that point you'll have to numerically integrate the equations as a system using for example [this method](http://doc.sagemath.org/html/en/reference/calculus/sage/calculus/desolvers.html#sage.calculus.desolvers.desolve_system_rk4). You'll need to solve for all second derivatives and then introduce intermediate variables for the first derivatives of $x$, $j$ and $y$ in order to write the system in terms of first-order equations.
The problem you're trying to solve is mathematically identical to the [swinging](https://en.wikipedia.org/wiki/Swinging_Atwood%27s_machine) Atwood machine, but with one point of support instead of two. While it can be done in Cartesian coordinates, it will look a lot simpler in polar coordinates.
Cheers!
Thu, 23 Mar 2017 00:58:49 +0100https://ask.sagemath.org/question/10625/solving-a-physic-problem-using-sage/?answer=37035#post-id-37035Comment by clon for <p>Your first three equations for the balance of the components of force look fine. Your fourth equation, while accurate, is less useful than writing the tensions $S_x$ and $S_y$ as projections of the total tension $T$:</p>
<p>$ \qquad S_x = \frac{x}{\sqrt{x^2+j^2}}T \qquad S_y = \frac{j}{\sqrt{x^2+j^2}}T $</p>
<p>Your fifth equation is incorrect, since it says that the amount of rope on each side of the nail is always equal, which is not true for a sliding inelastic rope. If the rope is of length $L$, then the constraint you want is</p>
<p>$ \qquad y + \sqrt{x^2+j^2} = L $</p>
<p>If you take a second derivative of this constraint with respect to time and substitute it in the first equation, you'll have an expression for the total tension $T$ as a function of $x$ and $j$ and their derivatives. You can use that to eliminate $T$ from the second and third equations. Then you should have three coupled nonlinear differential equations for $x$, $j$ and $y$ without $T$.</p>
<p>At that point you'll have to numerically integrate the equations as a system using for example <a href="http://doc.sagemath.org/html/en/reference/calculus/sage/calculus/desolvers.html#sage.calculus.desolvers.desolve_system_rk4">this method</a>. You'll need to solve for all second derivatives and then introduce intermediate variables for the first derivatives of $x$, $j$ and $y$ in order to write the system in terms of first-order equations.</p>
<p>The problem you're trying to solve is mathematically identical to the <a href="https://en.wikipedia.org/wiki/Swinging_Atwood%27s_machine">swinging</a> Atwood machine, but with one point of support instead of two. While it can be done in Cartesian coordinates, it will look a lot simpler in polar coordinates.</p>
<p>Cheers!</p>
https://ask.sagemath.org/question/10625/solving-a-physic-problem-using-sage/?comment=45661#post-id-45661Great answer! Sorry I can't upvote it yet. I just created the account, and I need more points.Tue, 05 Mar 2019 10:43:13 +0100https://ask.sagemath.org/question/10625/solving-a-physic-problem-using-sage/?comment=45661#post-id-45661Comment by psp for <p>Your first three equations for the balance of the components of force look fine. Your fourth equation, while accurate, is less useful than writing the tensions $S_x$ and $S_y$ as projections of the total tension $T$:</p>
<p>$ \qquad S_x = \frac{x}{\sqrt{x^2+j^2}}T \qquad S_y = \frac{j}{\sqrt{x^2+j^2}}T $</p>
<p>Your fifth equation is incorrect, since it says that the amount of rope on each side of the nail is always equal, which is not true for a sliding inelastic rope. If the rope is of length $L$, then the constraint you want is</p>
<p>$ \qquad y + \sqrt{x^2+j^2} = L $</p>
<p>If you take a second derivative of this constraint with respect to time and substitute it in the first equation, you'll have an expression for the total tension $T$ as a function of $x$ and $j$ and their derivatives. You can use that to eliminate $T$ from the second and third equations. Then you should have three coupled nonlinear differential equations for $x$, $j$ and $y$ without $T$.</p>
<p>At that point you'll have to numerically integrate the equations as a system using for example <a href="http://doc.sagemath.org/html/en/reference/calculus/sage/calculus/desolvers.html#sage.calculus.desolvers.desolve_system_rk4">this method</a>. You'll need to solve for all second derivatives and then introduce intermediate variables for the first derivatives of $x$, $j$ and $y$ in order to write the system in terms of first-order equations.</p>
<p>The problem you're trying to solve is mathematically identical to the <a href="https://en.wikipedia.org/wiki/Swinging_Atwood%27s_machine">swinging</a> Atwood machine, but with one point of support instead of two. While it can be done in Cartesian coordinates, it will look a lot simpler in polar coordinates.</p>
<p>Cheers!</p>
https://ask.sagemath.org/question/10625/solving-a-physic-problem-using-sage/?comment=38547#post-id-38547Mmm, let me do some checks. Anyway your answer seems very interesting!Wed, 16 Aug 2017 17:04:14 +0200https://ask.sagemath.org/question/10625/solving-a-physic-problem-using-sage/?comment=38547#post-id-38547