Simulating Dynamics - 2

Difficulty: Very hard indeed. To spoil it for you, only 18% of the attempts were right.

This problem is going to be pretty hard due to the many forces involved. The problem is similar to my previous problem, "Dynamic system with friction". Don't try to solve analytically.

However, the system this time is a pulley setup .

Consider the pulley system below as I have drawn, with a mass hung over a pulley hinge, providing a force to drag a block over to x = 0 x = 0 (shown by the dotted line) solely using gravitational force. The string is completely massless, and only the floor has friction; all other surfaces are completely frictionless.

The pulley hinge is a vertical distance of 8 8 meters from the ground, and the length of the string is 14 14 meters.

Block 2 starts at the hinge at time t = 0 t = 0 seconds, and is also released at the same time. Block 1 is a distance of 14 14 meters away from block 2 diagonally and the displacement from x = 0 x = 0 can be found using Pythagoras' Theorem.

Here m 1 = 3 k g m_1 = 3kg and m 2 = 2 k g m_2 = 2kg

There is a friction force acting opposite to the direction of the velocity, μ N \mu \bold{N} , where N \bold{N} is the contact force between block 1 and normal to the floor. Here μ \mu is the frictional coefficient, and is equal to 0.5 0.5 .

Find the time it takes for block 1 to reach x = 0 x = 0 .

Take gravitational acceleration g g to be 10 m / s 2 10 m/s^2 .


The answer is 3.865.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Steven Chase
Jun 2, 2020

Just a different flavor of the solution posted by @Karan Chatrath . I have a 2 × 2 2 \times 2 linear system to solve for T T and x ¨ \ddot{x} , so my expressions are correspondingly more complex than in the 4 × 4 4 \times 4 linear system. Let the pulley height be h h

The string length constraint gives (after a great deal of chain-ruling):

m 2 g T m 2 = x 2 x ˙ 2 ( x 2 + h 2 ) 3 / 2 ( x x ¨ + x ˙ 2 ) ( x 2 + h 2 ) 1 / 2 \frac{m_2 g - T}{m_2} = x^2 \dot{x}^2 (x^2 + h^2)^{-3/2} - (x \ddot{x} + \dot{x}^2)(x^2 + h^2)^{-1/2}

And the dynamics of the block with friction give the other equation ( θ \theta is the angle between the string and the horizontal):

T cos θ μ ( m 1 g T sin θ ) = m 1 x ¨ T \cos \theta - \mu(m_1 g - T \sin \theta) = -m_1 \ddot{x}

Solve the system for T T and x ¨ \ddot{x} on each time step, and use numerical integration. The block reaches x = 0 x = 0 at approximately t = 3.87 t = 3.87

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import math
import numpy as np

h = 8.0
x0 = math.sqrt(14.0**2.0 - h**2.0)

m1 = 3.0
m2 = 2.0
u = 0.5
g = 10.0

dt = 10.0**(-4.0)

##########################################

t = 0.0

x = x0
xd = 0.0
xdd = 0.0

while x >= 0.0:

    x = x + xd*dt
    xd = xd + xdd*dt

    cos = x/math.sqrt(x**2.0 + h**2.0)
    sin = h/math.sqrt(x**2.0 + h**2.0)

    q1 = (x**2.0 + h**2.0)**(-1.0/2.0)
    q2 = (x**2.0 + h**2.0)**(-3.0/2.0)

    J11 = 1.0/m2
    J12 = -x*q1

    J21 = cos + u*sin
    J22 = m1

    J = np.array([[J11,J12],[J21,J22]])

    vec1 = g - (x**2.0)*(xd**2.0)*q2 + (xd**2.0)*q1
    vec2 = u*m1*g

    vec = np.array([vec1,vec2])

    Sol = np.linalg.solve(J, vec)

    T = Sol[0]
    xdd = Sol[1]

    t = t + dt

##########################################

print dt
print t

#>>> 
#0.001
#3.868
#>>> ================================ RESTART ================================
#>>> 
#0.0001
#3.8658
#>>> 

Nice one, I upvoted your solution. Your solution's getting a lot of upvotes. You're on a roll!

Krishna Karthik - 1 year ago
Karan Chatrath
Jun 2, 2020

The equations of motion have been re-arranged in a matrix form in the solution. I have not necessarily used the same sign convention as you might have.

m 2 g T = m 2 y ¨ m_2g-T = m_2\ddot{y} T cos θ μ N = m 1 x ¨ T\cos{\theta} - \mu N = m_1 \ddot{x} T sin θ + N = m 1 g T\sin{\theta} + N = m_1 g

Finally, the constraint equation is:

x 2 + 64 = ( 14 y ) 2 x^2+64=(14-y)^2

Double differentiation gives the fourth equation using which T T , N N , x ¨ \ddot{x} and y ¨ \ddot{y} can be solved for. I did that by re-arranging the equations in a matrix form.

θ = arccos ( x 14 y ) \theta = \arccos\left(\frac{-x}{14-y}\right)

[ m 1 0 μ cos θ 0 m 2 0 1 0 0 1 sin θ 2 x 28 2 y 0 0 ] [ x ¨ y ¨ N T ] = [ 0 m 2 g m 1 g 2 x ˙ 2 2 y ˙ 2 ] \left[\begin{matrix} m_1&0&\mu& -\cos{\theta} \\ 0&m_2&0&1 \\ 0&0&1&\sin{\theta}\\2x&28-2y&0&0\end{matrix}\right]\left[\begin{matrix} \ddot{x}\\ \ddot{y} \\ N \\ T\end{matrix}\right]=\left[\begin{matrix} 0\\m_2g \\ m_1g \\ 2\dot{x}^2-2\dot{y}^2\end{matrix}\right]

A [ x ¨ y ¨ N T ] = b \implies A \left[\begin{matrix} \ddot{x}\\ \ddot{y} \\ N \\ T\end{matrix}\right]=b [ x ¨ y ¨ N T ] = A 1 b \implies \left[\begin{matrix} \ddot{x}\\ \ddot{y} \\ N \\ T\end{matrix}\right] = A^{-1}b

Uncommented simulation code attached below. Used the modified Euler step for numerical integration:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
clear all
clc

m1 = 3;
m2 = 2;

g  = 10;
mu = 0;

x(1) = -14*cos(asin(8/14));
y(1) = 0;

dx(1) = 0;
dy(1) = 0;

dt    = 1e-5;
tf    = 3.8655;

t     = 0:dt:tf;

for k = 1:length(t)-1


    A = [m1 0 mu -x(k)/(y(k)-14);0 m2 0 1;0 0 1 (1 - x(k)^2/(y(k) - 14)^2)^(1/2);2*x(k) 28-2*y(k) 0 0];
    b = [0;m2*g;m1*g;2*dy(k)^2-2*dx(k)^2];

    S = inv(A)*b;

    ddx = S(1);
    ddy = S(2);

    dx(k+1) = dx(k) + ddx*dt;
    dy(k+1) = dy(k) + ddy*dt;

    x(k+1)  = x(k) + dx(k+1)*dt;
    y(k+1)  = y(k) + dy(k+1)*dt;
end

Yup, looking back on it I think I had written out one of the forces wrong. I later got the same answer as you. Thanks for taking the effort to solve the problem😁

Krishna Karthik - 1 year ago

Log in to reply

Thanks for the problem. It was a good one

Karan Chatrath - 1 year ago

I cannot see your comments to my report without conceding the porblem. You may convey your thoughts here.

Karan Chatrath - 10 months, 3 weeks ago

Log in to reply

The variation of X coordinate and X component of velocity with time. This to me seems like a reasonable result.

Karan Chatrath - 10 months, 3 weeks ago

Log in to reply

I noticed you have commented in the report for the problem. I cannot see them until I concede it. So please respond here, if you wish.

Karan Chatrath - 10 months, 3 weeks ago

Log in to reply

@Karan Chatrath @Krishna Karthik I noticed another comment on the problem report. Recall that I cannot see the comments.

Karan Chatrath - 10 months, 3 weeks ago

Log in to reply

@Karan Chatrath Oh hi, can you see this comment? :)

Krishna Karthik - 10 months, 3 weeks ago

Log in to reply

@Krishna Karthik Yes, this one I can

Karan Chatrath - 10 months, 3 weeks ago

@Karan Chatrath Ok; I have fixed up one of the errors in the code. I had first inputed the derivative of 3 x 2 3x^2 incorrectly as 2 x 2x in my code. It was incorrect originally. However, I still manage to get a different result from the one you have.

Krishna Karthik - 10 months, 3 weeks ago

Log in to reply

@Krishna Karthik Very well. In that case, delete that problem and re-upload it. The Brilliant staff will take time to update it.

Karan Chatrath - 10 months, 3 weeks ago

@Krishna Karthik I have verified my result with @Steven Chase . He gets the same result as I do. So please re-check your work. Perhaps later, I will share my approach too.

Karan Chatrath - 10 months, 3 weeks ago

Log in to reply

@Karan Chatrath I agree. I have re-uploaded the problem; I would like to see solutions so I can figure out what I did wrong, if that's ok and whenever you like.

Cheers!

Krishna Karthik - 10 months, 3 weeks ago

Log in to reply

@Krishna Karthik Yes, noticed that it is uploaded. I will post a solution after some time.

Karan Chatrath - 10 months, 3 weeks ago

@Krishna Karthik Have you tried using the atan2 function instead of atan? The atan function has ambiguities that can cause problems

Steven Chase - 10 months, 3 weeks ago

Log in to reply

@Steven Chase Ah, yes. I'll try that. I will reupload my problem right now.

Krishna Karthik - 10 months, 3 weeks ago

@Steven Chase The problem is re-uploaded now. Sorry for the delay. Cheers!

@Karan Chatrath @Steven Chase

Krishna Karthik - 10 months, 3 weeks ago

Is this Matlab code? Lol I'm only now learning how to use matlab. I'm actually finding it much better than python.

Krishna Karthik - 10 months ago

Log in to reply

Yes, this is MATLAB.

Karan Chatrath - 9 months, 4 weeks ago

Log in to reply

Hey there; I've posted a discussion because I need help with a new problem. Is it ok if you can check it out? Thanks.

Krishna Karthik - 9 months, 3 weeks ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...