SHM - as two ordinary linear differential equations

1. Oct 24, 2015

leonmate

1. The problem statement, all variables and given/known data

I've attached an image of the problem question, it's Q1 I'm working on

This is what I have so far:

we have two components of SHM, position x and velocity v.

when x = 0, v = a maximum, when v = 0, x = a maximum

this is represented by sin & cos functions.

where x = A*sin(w*t*phi)

and v = A*w*cos(w*t*phi)

Here it can be shown that a = -w^2 * x

thus, dv/dt = -w^2 * x

and, dv/dt = dv/dx * dx/dt = -w^2 * x

and, v*dv/dx = -w^2 * x

then we're left with differential equation, v*dv = -w^2 *x*dx

So the last equation: v dv = -ω2x dx
Would this be considered two linear ordinary equations?? I'm a little unsure about the question is actually asking me - 'the analytical solution'

I've got to code this with python, and solve using euler and fourth-order Runge-Kutta method - I've already made solver functions to do both these things, I just can't progress past q1! ..frustrating

Any help would be very appriciated

Leon

Attached Files:

File size:
31.1 KB
Views:
43
• Assignment1.pdf
File size:
87.3 KB
Views:
85
2. Oct 24, 2015

SteamKing

Staff Emeritus
I'm not sure I follow what you are doing here. Have you studied ordinary differential equations and how to solve them in a separate course?

The second-order ODE, y" + ω2y = 0, describes the motion of an undamped oscillator.

The 'analytical solution' described in the assignment means the non-numerical solution to this equation which would be obtained by using the methods for solving such equations. This is a linear homogeneous second order differential equation with constant coefficients, so there are solution methods readily available:

http://tutorial.math.lamar.edu/Classes/DE/SecondOrderConcepts.aspx

In solving such equations numerically, the usual numerical procedures, like Euler's method or Runge-Kutta, can solve only first-order differential equations. What this assignment requires you to do is re-write the original second-order differential equation as a system of two first-order equations, and then solve this system numerically.

3. Oct 24, 2015

epenguin

I think you're not doing what they want in the order they want. Also to say 'it can be shown' I thought was a privilege reserved for textbook writers.

I think they want you to multiply the given equation by y and do the operations you may or may not remember to get to express in terms of the concepts of potential and kinetic energy. If it doesn't come back to you look in your intermediate level physics textbook.

4. Oct 24, 2015

rude man

"RSVP! If I trouble to help your homework and you never reply or react I will enter your name in a black book and not help you next time. I may do this if you let the thing drop before any conclusion reached.
Don't tell us you have got the answer, tell us the answer you have got!

Beautiful! Wish I had thought of it myself. It would discourage turn-key solution hunters.

5. Oct 25, 2015

leonmate

I did do a course with ODEs, but I wound up taking some time off and my memory of them isn't great. I probably need to go over it much more as this course progresses.

So, I had a read through that site - very helpful thank you.

This is what I've come up with...

y'' = w2y = 0
y(t) = ert
y''(t) = r2ert
ay'' + by' + cy = 0
r2 + w2 = 0
r = ±2π i (w = 2π)

y(t) = c1 cos (2πt) + c2 sin (2πt)
y'(t) = -2πt c1 sin (2πt) + 2πt c2 cos (2πt)

Plug in my y(0) = 1 and y'(0) = 0

gives c1 = 1, c2 = 0

and y(t) = cos(2πt)

and now i'm a little lost again. Am I heading in the right direction with this working?

Leon

6. Oct 25, 2015

SteamKing

Staff Emeritus
If c1 = c2 = 0, then y(t) = 0.

Go back to the solution of the characteristic equation r2 + ω2 = 0

How did you arrive at r = ±2π i ?

Re-writing, r2 = -ω2, so what should r be?

7. Oct 25, 2015

leonmate

8. Oct 25, 2015

rude man

"Write the second-order equation for the harmonic oscillator,
y'' + ω2y = 0
as two linear ordinary differential equations."

You're still not doing what was asked, which was to reduce the one second-order ODE into two 1st order ODE's.
Hint: let u = dy/dt, then
form two 1st order ODE's in u' and y'.

9. Oct 26, 2015

leonmate

Hey guys,

I've worked through some more, here's what I have

y1(t) = (cos(wt) + i sin(wt))
y2(t) = (cos(wt) - i sin(wt))

y(t) = A y1(t) + B y2(t)

y(t) = A(cos(wt) + i sin(wt)) + B(cos(wt) - i sin(wt))
y'(t) = Aw(-sin(wt) + i cos(wt)) + Bw(-sin(wt) - i cos(wt))

Plug in boundary conditions:

y(0) = 1

1 = A( 1 + 0 ) + B( 1 - 0 ) = A + B

y'(0) = 0

0 = Aw( 0 + i ) + Bw( 0 - i)
0 = Awi - Bwi
0 = A - B

A = B = ½

(w = 2π given in question)

y(t) = ½cos(2πt) + ½sin(2πt)

let u = y' = -π sin(2πt) + π cos(2πt)

u' = y'' = - 2π2cos(2πt) - 2π2sin(2πt)

We're given the equation y'' + w2y = 0 so we can test

- 2π2cos(2πt) - 2π2sin(2πt) + 4π2(½cos(2πt) + ½sin(2πt)) = 0
- 2π2cos(2πt) - 2π2sin(2πt) + 2π2cos(2πt) 2π2sin(2πt) = 0

...then i get stuck

I also did this, which makes more sense but I don't know if it's right

y = cos(wt)
y = cos(2πt)
u = y' = - 2π sin(2πt)
u' = -4π2cos(2πt) = -4π2y
du / dt = -4π2y

du = dy/dt

dy / y = -4π2 dt2

10. Oct 26, 2015

leonmate

My lecturer gave me this, the first two slides are relevant

Attached Files:

• SHM.pdf
File size:
861.3 KB
Views:
79
11. Oct 26, 2015

rude man

Your y(t) and u(t) are corect. Don't know why you continue with du/dt etc. You were asked to provide y(t) only in part 1.
I can't assist after that.

12. Oct 26, 2015

leonmate

Ok, how do I get y = cos(wt)

I got it once, now everytime I do it I end up with a sin in there.

y'' + w2y = 0
y(t) = ert
y''(t) = r2ert
ay'' + by' + cy = 0
r2 + w2 = 0
r = ±2π i (w = 2π)

y(t) = c1 cos (2πt) + c2 sin (2πt)
y'(t) = -2πt c1 sin (2πt) + 2πt c2 cos (2πt)

Plug in my y(0) = 1 and y'(0) = 0

gives c1 = 1, c2 = 0

and y(t) = cos(2πt)

Is this correct?

13. Oct 26, 2015

rude man

Where? I see only cosines, in both ways you did it.
yes.
Since it's a duplicate of what you just wrote above, the answer had better be Yes here too, hadn't it!
So where's the sine term(s) in y(t)???

14. Oct 27, 2015

epenguin

You were asked to derive from the second order equation two first order ones and then from those solve analytically.
It seems to me you have first solved and then tried to derive the equations from the solutions! Maybe not yet successfully.

If you feel stuck after all this you might give consideration to #3 which is a couple of lines and seems to me what is being asked.

Last edited: Oct 27, 2015