Harmonic Oscillator (not sure where to post)

In summary, the conversation is about a computer programmer who is struggling to understand a physics formula given to them and is looking for assistance in solving it. The formula is a differential equation representing the relationship between force, mass, and displacement in a mass-spring system. The conversation also touches on the analytical solution for a single spring-mass system and the challenges of solving for multiple interconnected systems. The expert suggests using a function to solve the equation and provides a resource for further understanding the physics behind it.
  • #1
lxXTaCoXxl
9
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
  • #2
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:
[tex]
\frac{d^2x(t)}{dt^2} ~=~ - \omega^2 x(t)
[/tex]
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.)
 
  • #3
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
 
  • #4
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.
 
  • #5
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.)
 

Related to Harmonic Oscillator (not sure where to post)

1. What is a harmonic oscillator?

A harmonic oscillator is a physical system that exhibits a periodic motion around an equilibrium point. It can be described by a simple mathematical equation known as the harmonic oscillator equation.

2. What are some examples of harmonic oscillators?

Some examples of harmonic oscillators include a mass attached to a spring, a pendulum, and an LC circuit in electrical engineering.

3. How is the motion of a harmonic oscillator affected by its parameters?

The motion of a harmonic oscillator is affected by its parameters such as the mass, spring constant, and initial conditions. These parameters determine the amplitude, frequency, and period of the oscillation.

4. How is the energy of a harmonic oscillator related to its motion?

The energy of a harmonic oscillator is directly proportional to the amplitude of its motion. As the oscillator moves away from its equilibrium point, the energy increases, and as it returns to the equilibrium point, the energy decreases.

5. What are the applications of harmonic oscillators in science and technology?

Harmonic oscillators have many practical applications in science and technology. They are used in clocks, watches, musical instruments, and even in seismology to measure earthquakes. In quantum mechanics, harmonic oscillators are used to describe the behavior of atoms and molecules.

Similar threads

Replies
13
Views
2K
Replies
7
Views
698
Replies
13
Views
1K
Replies
2
Views
1K
  • Quantum Physics
Replies
1
Views
868
  • Introductory Physics Homework Help
Replies
8
Views
1K
Replies
17
Views
2K
  • Introductory Physics Homework Help
Replies
12
Views
2K
  • Introductory Physics Homework Help
Replies
7
Views
1K
Replies
4
Views
3K
Back
Top