# Am I rewriting this differential correctly?

Tags:
1. Nov 26, 2014

### thestrangequark

1. The problem statement, all variables and given/known data
I have a differential equation that I need to solve numerically by writing a program.
x0, y0, x_dot0, y_dot0, α are all given

Hello, I have the following differential equation: http://puu.sh/d78KC/107bd6c71f.png [Broken]
I want to rewrite it so I can solve it numerically by writing a program. I believe I can replace L2 with m2 * r4 * theta_dot2 making the equation:

r_ddot= r*theta_dot2 * sin2 α -g sinαcosα

And for the problem to solve numerically, I am given the initial x and y position which I can use to solve r initial. I'm also given the initial x and y velocities, which I could solve the tangential velocity with. I then think I can replace theta_dot2 with v_tan2 /r2 making the equation

http://puu.sh/d6pd0/eefb56a511.png [Broken]

Does this all work out as I've explained, or did I make an error anywhere?

Also, any suggestions on how to write a program to solve this numerically?

Last edited by a moderator: May 7, 2017
2. Nov 26, 2014

### Simon Bridge

Is alpha is a function of t or does the dot indicate a differentiation wrt alpha or something else?
Well, usually $L=r\dot\theta$, yes.

I think you can solve for r(t) but you need more information to get x(t) and y(t) (or of alpha or whatever).

You need to be explicit about the method you want to use.
I'm guessing you are expected to use some sort of Rung-Kutta?
There are lots of examples of programming this online.

3. Nov 26, 2014

### thestrangequark

alpha is a constant. the dot means it is a differentiation wrt time. I'm trying to get r(t). If possible I would like to get x(t) and y(t) but I'm not sure how.

4. Nov 27, 2014

### Staff: Mentor

Your description of the problem is a mess, partly because you need to learn how to compose the equations so that we can read them. How confident are you that the starting equation is correct? Is dθ/dt a constant, independent of time? If so, why didn't you say that. If not, then you need another equation. Do you know how to convert from cylindrical coordinates to cartesian coordinates? Are you supposed to be solving the differential equations directly in terms of x and y? Or, are you allowed to solve in terms of the cylindrical coordinates, and then convert to cylindrical coordinates afterwards? You need to specify your problems more precisely for people who are trying to help you.

Chet