File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -21,18 +21,18 @@ def derivs(state, t):
21
21
22
22
del_ = state [2 ] - state [0 ]
23
23
den1 = (M1 + M2 )* L1 - M2 * L1 * cos (del_ )* cos (del_ )
24
- dydx [1 ] = (M2 * L1 * state [1 ]* state [1 ]* sin (del_ )* cos (del_ )
25
- + M2 * G * sin (state [2 ])* cos (del_ )
26
- + M2 * L2 * state [3 ]* state [3 ]* sin (del_ )
27
- - (M1 + M2 )* G * sin (state [0 ]))/ den1
24
+ dydx [1 ] = (M2 * L1 * state [1 ]* state [1 ]* sin (del_ )* cos (del_ ) +
25
+ M2 * G * sin (state [2 ])* cos (del_ ) +
26
+ M2 * L2 * state [3 ]* state [3 ]* sin (del_ ) -
27
+ (M1 + M2 )* G * sin (state [0 ]))/ den1
28
28
29
29
dydx [2 ] = state [3 ]
30
30
31
31
den2 = (L2 / L1 )* den1
32
- dydx [3 ] = (- M2 * L2 * state [3 ]* state [3 ]* sin (del_ )* cos (del_ )
33
- + (M1 + M2 )* G * sin (state [0 ])* cos (del_ )
34
- - (M1 + M2 )* L1 * state [1 ]* state [1 ]* sin (del_ )
35
- - (M1 + M2 )* G * sin (state [2 ]))/ den2
32
+ dydx [3 ] = (- M2 * L2 * state [3 ]* state [3 ]* sin (del_ )* cos (del_ ) +
33
+ (M1 + M2 )* G * sin (state [0 ])* cos (del_ ) -
34
+ (M1 + M2 )* L1 * state [1 ]* state [1 ]* sin (del_ ) -
35
+ (M1 + M2 )* G * sin (state [2 ]))/ den2
36
36
37
37
return dydx
38
38
You can’t perform that action at this time.
0 commit comments