I was wondering whether it's possible to write a code in C++ that would be able to solve the Harmonic Oscillator:(adsbygoogle = window.adsbygoogle || []).push({});

[itex] \ddot{x} + \gamma x = F_{external}(t,x)[/itex]

With different [itex]F[/itex] function inputs... I thought about creating a function with if clauses, so for different inputs by the user, the force F would be described by a different function...What do you think?

**Physics Forums - The Fusion of Science and Community**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# C++ Harmonic Oscillator (with Force)

Loading...

Similar Threads - Harmonic Oscillator Force | Date |
---|---|

[MATLAB] Spherical Harmonics | Jul 31, 2014 |

Mathematica: Transistor Harmonic Derivations | Sep 4, 2012 |

Harmonic Oscillator with random number-mathlab | Mar 9, 2012 |

How do I fit damped harmonic motion data (x vs. t) using Mathematica? | Oct 19, 2010 |

Spherical Harmonics in MATLAB | Oct 22, 2008 |

**Physics Forums - The Fusion of Science and Community**