From bfd6e3d56f2e91f81b42c811fbff62abc153724d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Sat, 16 Oct 2021 10:09:16 +0200 Subject: new files --- .../110-elliptisch/images/unvollstaendig.m | 81 ++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 buch/chapters/110-elliptisch/images/unvollstaendig.m (limited to 'buch/chapters/110-elliptisch/images/unvollstaendig.m') diff --git a/buch/chapters/110-elliptisch/images/unvollstaendig.m b/buch/chapters/110-elliptisch/images/unvollstaendig.m new file mode 100644 index 0000000..25196d0 --- /dev/null +++ b/buch/chapters/110-elliptisch/images/unvollstaendig.m @@ -0,0 +1,81 @@ +# +# unvollstaendig.m +# +# (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule +# +global N; +N = 200; +global n; +n = 5; + +function retval = integrand_f(t, k) + retval = 1 / sqrt((1 - t^2) * (1 - k^2 * t^2)); +endfunction + +function retval = integrand_e(t, k) + retval = sqrt((1-k^2*t^2)/(1-t^2)); +endfunction + +function retval = integrand_pi(n, t, k) + retval = 1 / ((1-n*t^2) * sqrt((1-k^2*t^2)*(1-t^2))); +endfunction + +function retval = elliptisch1(f, name, k) + global N; + global n; + s = 0; + fprintf(f, "\\def\\ell%s{ (0,0)", name); + delta = 1 / N; + for x = (0:delta:(1-delta)) + h = delta / n; + for t = (x+h/2:h:x+delta) + s = s + integrand_f(t, k) * h; + endfor + fprintf(f, "\n -- ({\\dx*%.4f},{\\dy*%.4f})", x + delta, s); + endfor + fprintf(f, "}\n"); +endfunction + +function retval = elliptisch2(f, name, k) + global N; + global n; + s = 0; + fprintf(f, "\\def\\ell%s{ (0,0)", name); + delta = 1 / N; + for x = (0:delta:(1-delta)) + h = delta / n; + for t = (x+h/2:h:x+delta) + s = s + integrand_e(t, k) * h; + endfor + fprintf(f, "\n -- ({\\dx*%.4f},{\\dy*%.4f})", x + delta, s); + endfor + fprintf(f, "\n}\n"); +endfunction + +fn = fopen("unvollpath.tex", "w"); + +elliptisch1(fn, "Fzero", 0.0); +elliptisch1(fn, "Fone", 0.1); +elliptisch1(fn, "Ftwo", 0.2); +elliptisch1(fn, "Fthree", 0.3); +elliptisch1(fn, "Ffour", 0.4); +elliptisch1(fn, "Ffive", 0.5); +elliptisch1(fn, "Fsix", 0.6); +elliptisch1(fn, "Fseven", 0.7); +elliptisch1(fn, "Feight", 0.8); +elliptisch1(fn, "Fnine", 0.9); +elliptisch1(fn, "Ften", 1.0); + +elliptisch2(fn, "Ezero", 0.0); +elliptisch2(fn, "Eone", 0.1); +elliptisch2(fn, "Etwo", 0.2); +elliptisch2(fn, "Ethree", 0.3); +elliptisch2(fn, "Efour", 0.4); +elliptisch2(fn, "Efive", 0.5); +elliptisch2(fn, "Esix", 0.6); +elliptisch2(fn, "Eseven", 0.7); +elliptisch2(fn, "Eeight", 0.8); +elliptisch2(fn, "Enine", 0.9); +elliptisch2(fn, "Eten", 1.0); + +fclose(fn); -- cgit v1.2.1