/usr/share/genius/examples/fourier-series-animation.gel is in genius-common 1.0.23-3.
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 38 39 | # Category: Differential Equations
# Name: Fourier series animation (Gibbs phenomenon)
#
# Animation where a discontinuity appears and disappears to exhibit
# Gibbs phenomenon
#
# The computation can be slow, so be patient when running...
# The function (h is a parameter)
function F(x) = (
while x < -pi do increment x by 2*pi;
while x > pi do increment x by -2*pi;
if x < 0 then 2*h*(x+pi/2)/pi else 2-h
);
LinePlotWindow=[-pi*1.1,pi*1.1,-3,3];
LinePlotDrawLegends=false;
# For faster animation, precompute,
print("Precomputing Fourier Series...");
hvals = [0.0:0.1:2.0,2.0:-0.1:0.0];
for n=1 to elements(hvals) do (
h = hvals@(n);
printn (n + "/" + elements(hvals) + "...");
fs@(n) = NumericalFourierSeriesFunction (F, pi, 10);
);
print("Done... Starting animation...");
PlotWindowPresent(); # Make sure the window is raised
for k = 1 to 10 do (
for n = 1 to elements(hvals) do (
h = hvals@(n);
LinePlot(F, fs@(n))
)
)
|