Harmonic Oscillator (not sure where to post)

Click For Summary

Discussion Overview

The discussion revolves around understanding the harmonic oscillator formula, particularly the equation F = ma = m(d²x)/(dt²) = -kx. Participants explore its application in programming and seek clarification on the underlying physics and mathematical concepts involved.

Discussion Character

  • Exploratory
  • Technical explanation
  • Homework-related

Main Points Raised

  • Jamie expresses confusion regarding the harmonic oscillator formula and requests a step-by-step explanation of how to solve it, particularly regarding the presence of multiple assignment operators.
  • One participant notes that only the last part of the equation is relevant for solving the problem and suggests that it represents a differential equation.
  • Another participant clarifies that x is a function of time and that m and k are constants, indicating that the equation can be solved analytically for a single mass-spring system.
  • Jamie seeks further clarification on how to implement the formula in programming, asking for examples with random values to illustrate the solution process.
  • A participant suggests that if Jamie is working with multiple interconnected masses and springs, more complex methods like finite element analysis would be necessary.
  • There is a mention that the formula is a specific case of Newton's Second Law, but the discussion does not delve deeply into the physics behind it.
  • One participant expresses uncertainty about Jamie's understanding of the programming aspect and suggests that clearer phrasing of the problem might elicit better assistance.

Areas of Agreement / Disagreement

Participants generally agree on the nature of the formula and its relation to Newton's Second Law, but there is no consensus on how best to assist Jamie with the programming aspect or the depth of explanation required.

Contextual Notes

There are unresolved questions regarding the specific programming methods Jamie intends to use and the level of detail needed to bridge the gap between physics and programming. Additionally, the discussion does not clarify the assumptions behind the application of the harmonic oscillator in a computational context.

lxXTaCoXxl
Messages
9
Reaction score
0
I'm not understanding the following formula. I'm a computer programmer and was given a set of formulas to have an application to solve; however I'm not completely understanding how this works. I'm just looking for a step by step way to solve this and an explanation on why there are 3 assignment operators within the formula. This is the first I've seen of this kind. I plan to further my education in Physics, but this is above my head right now and I'm looking for some assistance.

F = ma = m(d^2x)/(dt^2) = -kx

Thanks in advance,
Jamie

PS - I don't know how to work the super script or the fraction bar available. Sorry.
 
Physics news on Phys.org
lxXTaCoXxl said:
F = ma = m(d^2x)/(dt^2) = -kx
It's sloppy. Only the last pair constitutes the equation you must solve.

x is a function of time, m and k are constants (mass and stiffness).

So you must solve a differential equation like this:
<br /> \frac{d^2x(t)}{dt^2} ~=~ - \omega^2 x(t)<br />
where ##\omega := \sqrt{k/m}## .

If you're supposed to solve this by computer methods, the question should probably be asked over in the computing forum. Otherwise, the calculus forum.

(If this is homework, then ask in the homework forum.)
 
No this isn't homework; but as I read in the description of the formula that was given is that x was to be a variable in my computed method to represent the location of the object? But at the same time I thought the description given was a little more like Newton's Second Law. I'm new to the whole physics formulas into programming algorithms thing. So a little bit more a break down would be more efficient here. For example; plug some random values in and explain step by step how to solve it?

Thanks,
Jamie
 
lxXTaCoXxl said:
No this isn't homework; but as I read in the description of the formula that was given is that x was to be a variable in my computed method to represent the location of the object? But at the same time I thought the description given was a little more like Newton's Second Law. I'm new to the whole physics formulas into programming algorithms thing. So a little bit more a break down would be more efficient here. For example; plug some random values in and explain step by step how to solve it?

Thanks,
Jamie

You don't need to understand the physics behind the mass-spring vibration. If you have only one spring (k) and one mass ( m) ,There is an analytical solution to this equation. You can simply define a function in your code and pass m, k, and initial values to it. It returns the displacement!

But if there is a large number of interconnected mass and springs ( or modeled like that, as in finite element method), then a little bit more work is required.
 
lxXTaCoXxl said:
as I read in the description of the formula that was given is that x was to be a variable in my computed method to represent the location of the object?
Yes.
But at the same time I thought the description given was a little more like Newton's Second Law.
It's a particular case of Newton's 2nd law.

If you want more background on the physics of it, try Wikipedia:
http://en.wikipedia.org/wiki/Harmonic_oscillator

I'm new to the whole physics formulas into programming algorithms thing.
I'm unsure what this sentence means. It sounds like you're doing an exercise of solving a differential equation by writing your own program to do so. If so, I'm not the best person to help further with that. Maybe someone else can do so if you can phrase the problem more articulately. (Even though it's not homework, please read the homework guidelines since they contain useful suggestions on how to format this type of request. No one is likely to put effort into helping unless you prove that you're putting in a reasonable amount of effort yourself.)
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 131 ·
5
Replies
131
Views
9K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
17
Views
3K