/usr/share/genius/examples/dalemb-pulse.gel is in genius-common 1.0.21-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | # Category: Differential Equations
# Name: D'Alembers solution animation of a plucked string
#
# Solution to the wave equation
# The initial conditions are: position at F(x) and velocity at 0
#
# A pulse function. Feel free to set this function to whatever you want,
# though you should have ends at 0
function F(x) = (
# This makes the functions periodic
while x < -1 do x = x + 2;
while x > 1 do x = x - 2;
if x < 0 then
-F(-x)
else if x < 0.45 or x > 0.55 then
0
else (
if x < 1/2 then
20*(x-0.45)
else
20*(0.55-x)
)
);
#t a paramater
function yy(x) = (F(x-t) + F(x+t))/2;
LinePlotDrawLegends = false;
PlotWindowPresent(); # Make sure the window is raised
for n=1 to 1000 do (
t = n*0.005;
LinePlot(yy,[0,1,-1.1,1.1])
)
|