This is a standing wave simulation as a damp string project written in Julia.
The scripts require the SymPy.jl and Plots.jl packages.
Either run:
]activate .
]instantiate
Or manually add the packages with Pkg.jl
.
A stretched string oscillation is described by the partial differential equation (PDE):
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:
For demonstration purposes, the following will be used:
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:
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:
where
is solved for d_n(t)
taking into account the initial conditions.
Finally, the resulting string oscillation is as follows: