[genius] Fri Mar 10 13:15:25 2017 Jiri (George) Lebl <jirka 5z com>
- From: George Lebl <jirka src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [genius] Fri Mar 10 13:15:25 2017 Jiri (George) Lebl <jirka 5z com>
- Date: Fri, 10 Mar 2017 19:15:54 +0000 (UTC)
commit 0246a972d31428d816862034b7e7ee1183a1e55a
Author: Jiri (George) Lebl <jiri lebl gmail com>
Date: Fri Mar 10 13:15:42 2017 -0600
Fri Mar 10 13:15:25 2017 Jiri (George) Lebl <jirka 5z com>
* examples/dalemb-pulse.gel: Add some other example functions
(commented out) for playing around.
ChangeLog | 5 ++++
examples/dalemb-pulse.gel | 49 +++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 52 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7a6ca65..57044ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Mar 10 13:15:25 2017 Jiri (George) Lebl <jirka 5z com>
+
+ * examples/dalemb-pulse.gel: Add some other example functions
+ (commented out) for playing around.
+
Wed Feb 15 13:13:40 2017 Jiri (George) Lebl <jirka 5z com>
* examples/fourier-series-*.gel: Run 10 instead of 3 iterations of
diff --git a/examples/dalemb-pulse.gel b/examples/dalemb-pulse.gel
index e5afc2d..d849ec7 100644
--- a/examples/dalemb-pulse.gel
+++ b/examples/dalemb-pulse.gel
@@ -2,14 +2,15 @@
# Name: D'Alembers solution animation of a plucked string
#
-# Solution to the wave equation
+# Solution to the wave equation u_tt = u_xx
# The initial conditions are: position at F(x) and velocity at 0
+# Boundary conditions are u(0,t) = u(1,t) = 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
+ # This makes the functions periodic
while x < -1 do x = x + 2;
while x > 1 do x = x - 2;
@@ -25,6 +26,50 @@ function F(x) = (
)
);
+# A plucked string function.
+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.5 then x
+ else 1-x
+);
+
+# A plucked string function in two places.
+#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.25 then -x
+# else if x < 0.5 then x-0.5
+# else if x < 0.75 then x-0.5
+# else 1-x
+#);
+
+
+# A plucked string in two places both in positive directions.
+#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.25 then x
+# else if x < 0.5 then 0.5-x
+# else if x < 0.75 then x-0.5
+# else 1-x
+#);
+
+# Examples of superposition of sin waves
+#function F(x) = (1/2)*sin(2*pi*x);
+#function F(x) = (1/2)*sin(2*pi*x) + (1/3)*sin(7*pi*x);
+#function F(x) = (1/2)*sin(2*pi*x) + (1/3)*sin(7*pi*x) + (1/8)*sin(20*pi*x);
+
+
#t a paramater
function yy(x) = (F(x-t) + F(x+t))/2;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]