/usr/share/genius/examples/eulers-method-exp-run.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 | # Category: Differential Equations
# Name: Estimation of exp(4) using Euler's Method
# we will measure time it takes
ct=CurrentTime;
sp=(CurrentTime-ct);
print("Estimation of e^4 with Euler's method");
print("h is the step size we use");
# Rounding to specific number of digits
function ourround(num) = round(num*10000.0)/10000.0;
function ourroundb(num) = round(num*100000000.0)/100000000.0;
for k=1 to 21 do (
ct = CurrentTime;
eu = EulersMethod(`(x,y)=y,0,1,4,2^k);
ct2 = (CurrentTime-ct-sp);
print("h=2^"+(3-k)+" gets "+ourroundb(eu)+" (e^4=" + ourroundb(e^4) + ", error="+ourroundb(|eu-e^4|)+") .. in " + ourround(ct2) + " secs");
);
|