Skip to content

String simulation in Julia from a Mathematical Methods of Physics project.

Notifications You must be signed in to change notification settings

fernandesafp/mmf-string-simulation

Repository files navigation

Damped string simulation

This is a standing wave simulation as a damp string project written in Julia.

Installation

The scripts require the SymPy.jl and Plots.jl packages.

Either run:

]activate .
]instantiate

Or manually add the packages with Pkg.jl.

Oscillation of a stretched string

A stretched string oscillation is described by the partial differential equation (PDE):

equation

Where y(x,t) represents the y-axis position of a given x coordinate in the string, v the velocity of the string and k the dampening of the string.

Both string extremities are fixed with the initial conditions as:

equation

For demonstration purposes, the following will be used:

equation

where L represents the length of the string and, as an integer, will act as the harmonic number, g(x) = f(x), N the maximum number of iterations, and b_n the Fourier coefficient defined as:

equation

The following animation displays the effect of the number of iterations N over the function g(x) where t = 0.

Adding the time component, the amplitude function is defined as:

equation

where

equation

is solved for d_n(t) taking into account the initial conditions.

Finally, the resulting string oscillation is as follows:

About

String simulation in Julia from a Mathematical Methods of Physics project.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages