From 43dd4efedf1ecfe721cde5830bdcee67ffa48907 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Tue, 28 Dec 2004 12:38:45 +0000 Subject: a few new attractors ... svn path=/trunk/externals/tb/; revision=2434 --- chaos/src/latoomutgamma.hpp | 83 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 chaos/src/latoomutgamma.hpp (limited to 'chaos/src/latoomutgamma.hpp') diff --git a/chaos/src/latoomutgamma.hpp b/chaos/src/latoomutgamma.hpp new file mode 100644 index 0000000..b4f3bf8 --- /dev/null +++ b/chaos/src/latoomutgamma.hpp @@ -0,0 +1,83 @@ +// +// +// chaos~ +// Copyright (C) 2004 Tim Blechmann +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; see the file COPYING. If not, write to +// the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +// Boston, MA 02111-1307, USA. + +#include "map_base.hpp" +#include + +// latoocarfian model, mutation gamma: +// x1[n+1] = abs(sin(x2[n]*b)) + pow(sin(x1[n]*b),2) +// x2[n+1] = abs(sin(x1[n]*a)) + pow(sin(x2[n]*a),2) +// taken from Pickover: Chaos In Wonderland + +class latoomutgamma + : public map_base +{ +public: + latoomutgamma() + { + m_num_eq = 2; + m_data = new data_t[m_num_eq]; + + CHAOS_SYS_INIT(x1,0.5); + CHAOS_SYS_INIT(x2,0.5); + CHAOS_SYS_INIT(a,-0.966918); + CHAOS_SYS_INIT(b,2.879879); + } + + ~latoomutgamma() + { + delete m_data; + } + + virtual void m_step() + { + data_t x1 = m_data[0], x2 = m_data[1]; + data_t a = CHAOS_PARAMETER(a), b = CHAOS_PARAMETER(b); + data_t tmp; + + tmp = sin(x1*b); + m_data[0] = CHAOS_ABS(sin(x2*b)) + tmp*tmp; + tmp = sin(x2*a); + m_data[1] = CHAOS_ABS(sin(x1*a)) + tmp*tmp; + } + + CHAOS_SYSVAR_FUNCS(x1, 0); + CHAOS_SYSVAR_FUNCS(x2, 1); + + CHAOS_SYSPAR_FUNCS(a); + CHAOS_SYSPAR_FUNCS(b); +}; + + +#define LATOOMUTGAMMA_CALLBACKS \ +MAP_CALLBACKS; \ +CHAOS_SYS_CALLBACKS(x1); \ +CHAOS_SYS_CALLBACKS(x2); \ +CHAOS_SYS_CALLBACKS(a); \ +CHAOS_SYS_CALLBACKS(b); + + +#define LATOOMUTGAMMA_ATTRIBUTES \ +MAP_ATTRIBUTES; \ +CHAOS_SYS_ATTRIBUTE(x1); \ +CHAOS_SYS_ATTRIBUTE(x2); \ +CHAOS_SYS_ATTRIBUTE(a); \ +CHAOS_SYS_ATTRIBUTE(b); + -- cgit v1.2.1 From 2393d5bab1917825e806871d9050ca54dc3041f3 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Sat, 12 Feb 2005 08:58:21 +0000 Subject: stability improvement and others svn path=/trunk/externals/tb/; revision=2568 --- chaos/src/latoomutgamma.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'chaos/src/latoomutgamma.hpp') diff --git a/chaos/src/latoomutgamma.hpp b/chaos/src/latoomutgamma.hpp index b4f3bf8..d83059e 100644 --- a/chaos/src/latoomutgamma.hpp +++ b/chaos/src/latoomutgamma.hpp @@ -58,6 +58,19 @@ public: m_data[1] = CHAOS_ABS(sin(x1*a)) + tmp*tmp; } + + /* function has a fix point for x1 == x2 == 0 */ + virtual void m_verify() + { + for (int i = 0; i != get_num_eq(); ++i) + { +#ifndef DOUBLE_PRECISION + if (PD_BIGORSMALL(m_data[i])) + m_data[i] = 0.01; +#endif + } + }; + CHAOS_SYSVAR_FUNCS(x1, 0); CHAOS_SYSVAR_FUNCS(x2, 1); -- cgit v1.2.1 From 2434290915cda6ed855e4dc2249312153b995817 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Thu, 9 Jun 2005 12:52:17 +0000 Subject: changed initialisation svn path=/trunk/externals/tb/; revision=3145 --- chaos/src/latoomutgamma.hpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'chaos/src/latoomutgamma.hpp') diff --git a/chaos/src/latoomutgamma.hpp b/chaos/src/latoomutgamma.hpp index d83059e..fcdf6a6 100644 --- a/chaos/src/latoomutgamma.hpp +++ b/chaos/src/latoomutgamma.hpp @@ -32,18 +32,20 @@ class latoomutgamma public: latoomutgamma() { - m_num_eq = 2; - m_data = new data_t[m_num_eq]; + CHAOS_PRECONSTRUCTOR; - CHAOS_SYS_INIT(x1,0.5); - CHAOS_SYS_INIT(x2,0.5); - CHAOS_SYS_INIT(a,-0.966918); - CHAOS_SYS_INIT(b,2.879879); + CHAOS_SYS_INIT(x1,0.5,0); + CHAOS_SYS_INIT(x2,0.5,1); + + CHAOS_PAR_INIT(a,-0.966918); + CHAOS_PAR_INIT(b,2.879879); + + CHAOS_POSTCONSTRUCTOR; } ~latoomutgamma() { - delete m_data; + } virtual void m_step() -- cgit v1.2.1 From d1ed55f96f9cecc818844006fb36cd58ca70da5e Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Thu, 16 Jun 2005 13:02:02 +0000 Subject: - parameter searching (broken) - misc. updates svn path=/trunk/externals/tb/; revision=3192 --- chaos/src/latoomutgamma.hpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'chaos/src/latoomutgamma.hpp') diff --git a/chaos/src/latoomutgamma.hpp b/chaos/src/latoomutgamma.hpp index fcdf6a6..b9c8c08 100644 --- a/chaos/src/latoomutgamma.hpp +++ b/chaos/src/latoomutgamma.hpp @@ -64,15 +64,11 @@ public: /* function has a fix point for x1 == x2 == 0 */ virtual void m_verify() { - for (int i = 0; i != get_num_eq(); ++i) - { -#ifndef DOUBLE_PRECISION - if (PD_BIGORSMALL(m_data[i])) - m_data[i] = 0.01; -#endif - } - }; - + if (m_data[0] == 0 && m_data[1] == 0) + for (int i = 0; i != 2; ++i) + m_data[i] = rand_range(0,0.1); + } + CHAOS_SYSVAR_FUNCS(x1, 0); CHAOS_SYSVAR_FUNCS(x2, 1); -- cgit v1.2.1 From f1c4f4640db0f0446accfbf7013b7b7b53a86c55 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Sun, 21 Aug 2005 14:57:28 +0000 Subject: different range svn path=/trunk/externals/tb/; revision=3439 --- chaos/src/latoomutgamma.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'chaos/src/latoomutgamma.hpp') diff --git a/chaos/src/latoomutgamma.hpp b/chaos/src/latoomutgamma.hpp index b9c8c08..daf3608 100644 --- a/chaos/src/latoomutgamma.hpp +++ b/chaos/src/latoomutgamma.hpp @@ -66,7 +66,7 @@ public: { if (m_data[0] == 0 && m_data[1] == 0) for (int i = 0; i != 2; ++i) - m_data[i] = rand_range(0,0.1); + m_data[i] = rand_range(-1,1); } CHAOS_SYSVAR_FUNCS(x1, 0); -- cgit v1.2.1 From ef53e19b3d9019b1b1f3345390f55ae9229ce390 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Sat, 22 Oct 2005 15:11:45 +0000 Subject: cleanups and new system svn path=/trunk/externals/tb/; revision=3750 --- chaos/src/latoomutgamma.hpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'chaos/src/latoomutgamma.hpp') diff --git a/chaos/src/latoomutgamma.hpp b/chaos/src/latoomutgamma.hpp index daf3608..5e55225 100644 --- a/chaos/src/latoomutgamma.hpp +++ b/chaos/src/latoomutgamma.hpp @@ -30,17 +30,14 @@ class latoomutgamma : public map_base { public: - latoomutgamma() + latoomutgamma(): + map_base(2) { - CHAOS_PRECONSTRUCTOR; - CHAOS_SYS_INIT(x1,0.5,0); CHAOS_SYS_INIT(x2,0.5,1); CHAOS_PAR_INIT(a,-0.966918); CHAOS_PAR_INIT(b,2.879879); - - CHAOS_POSTCONSTRUCTOR; } ~latoomutgamma() -- cgit v1.2.1 From 13cba7a7997e318fbba01a36912219355e387d52 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Sun, 21 May 2006 18:34:34 +0000 Subject: rewrote most stuff using templates svn path=/trunk/externals/tb/; revision=5105 --- chaos/src/latoomutgamma.hpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'chaos/src/latoomutgamma.hpp') diff --git a/chaos/src/latoomutgamma.hpp b/chaos/src/latoomutgamma.hpp index 5e55225..022e651 100644 --- a/chaos/src/latoomutgamma.hpp +++ b/chaos/src/latoomutgamma.hpp @@ -27,11 +27,10 @@ // taken from Pickover: Chaos In Wonderland class latoomutgamma - : public map_base + : public map_base<2> { public: - latoomutgamma(): - map_base(2) + latoomutgamma() { CHAOS_SYS_INIT(x1,0.5,0); CHAOS_SYS_INIT(x2,0.5,1); @@ -39,11 +38,6 @@ public: CHAOS_PAR_INIT(a,-0.966918); CHAOS_PAR_INIT(b,2.879879); } - - ~latoomutgamma() - { - - } virtual void m_step() { @@ -59,7 +53,7 @@ public: /* function has a fix point for x1 == x2 == 0 */ - virtual void m_verify() + void m_verify() { if (m_data[0] == 0 && m_data[1] == 0) for (int i = 0; i != 2; ++i) -- cgit v1.2.1 From 2c157bd8aa1f5387169cc0c0910d36c8068c4068 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Sun, 21 May 2006 19:17:04 +0000 Subject: improved inlining for maps svn path=/trunk/externals/tb/; revision=5106 --- chaos/src/latoomutgamma.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'chaos/src/latoomutgamma.hpp') diff --git a/chaos/src/latoomutgamma.hpp b/chaos/src/latoomutgamma.hpp index 022e651..0120745 100644 --- a/chaos/src/latoomutgamma.hpp +++ b/chaos/src/latoomutgamma.hpp @@ -39,7 +39,7 @@ public: CHAOS_PAR_INIT(b,2.879879); } - virtual void m_step() + void m_step() { data_t x1 = m_data[0], x2 = m_data[1]; data_t a = CHAOS_PARAMETER(a), b = CHAOS_PARAMETER(b); -- cgit v1.2.1 From fae4d2ec359b596a775973956daf4636856f0141 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Wed, 6 Sep 2006 20:32:21 +0000 Subject: cleanups svn path=/trunk/externals/tb/; revision=5880 --- chaos/src/latoomutgamma.hpp | 94 ++++++++++++++++++++++----------------------- 1 file changed, 47 insertions(+), 47 deletions(-) (limited to 'chaos/src/latoomutgamma.hpp') diff --git a/chaos/src/latoomutgamma.hpp b/chaos/src/latoomutgamma.hpp index 0120745..040a071 100644 --- a/chaos/src/latoomutgamma.hpp +++ b/chaos/src/latoomutgamma.hpp @@ -1,18 +1,18 @@ -// -// +// +// // chaos~ // Copyright (C) 2004 Tim Blechmann -// +// // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; see the file COPYING. If not, write to // the Free Software Foundation, Inc., 59 Temple Place - Suite 330, @@ -27,59 +27,59 @@ // taken from Pickover: Chaos In Wonderland class latoomutgamma - : public map_base<2> + : public map_base<2> { public: - latoomutgamma() - { - CHAOS_SYS_INIT(x1,0.5,0); - CHAOS_SYS_INIT(x2,0.5,1); - - CHAOS_PAR_INIT(a,-0.966918); - CHAOS_PAR_INIT(b,2.879879); - } + latoomutgamma() + { + CHAOS_SYS_INIT(x1,0.5,0); + CHAOS_SYS_INIT(x2,0.5,1); - void m_step() - { - data_t x1 = m_data[0], x2 = m_data[1]; - data_t a = CHAOS_PARAMETER(a), b = CHAOS_PARAMETER(b); - data_t tmp; - - tmp = sin(x1*b); - m_data[0] = CHAOS_ABS(sin(x2*b)) + tmp*tmp; - tmp = sin(x2*a); - m_data[1] = CHAOS_ABS(sin(x1*a)) + tmp*tmp; - } + CHAOS_PAR_INIT(a,-0.966918); + CHAOS_PAR_INIT(b,2.879879); + } + void m_step() + { + data_t x1 = m_data[0], x2 = m_data[1]; + data_t a = CHAOS_PARAMETER(a), b = CHAOS_PARAMETER(b); + data_t tmp; - /* function has a fix point for x1 == x2 == 0 */ - void m_verify() - { - if (m_data[0] == 0 && m_data[1] == 0) - for (int i = 0; i != 2; ++i) - m_data[i] = rand_range(-1,1); - } - - CHAOS_SYSVAR_FUNCS(x1, 0); - CHAOS_SYSVAR_FUNCS(x2, 1); + tmp = sin(x1*b); + m_data[0] = std::abs(sin(x2*b)) + tmp*tmp; + tmp = sin(x2*a); + m_data[1] = std::abs(sin(x1*a)) + tmp*tmp; + } - CHAOS_SYSPAR_FUNCS(a); - CHAOS_SYSPAR_FUNCS(b); + + /* function has a fix point for x1 == x2 == 0 */ + void m_verify() + { + if (m_data[0] == 0 && m_data[1] == 0) + for (int i = 0; i != 2; ++i) + m_data[i] = rand_range(-1,1); + } + + CHAOS_SYSVAR_FUNCS(x1, 0); + CHAOS_SYSVAR_FUNCS(x2, 1); + + CHAOS_SYSPAR_FUNCS(a); + CHAOS_SYSPAR_FUNCS(b); }; -#define LATOOMUTGAMMA_CALLBACKS \ -MAP_CALLBACKS; \ -CHAOS_SYS_CALLBACKS(x1); \ -CHAOS_SYS_CALLBACKS(x2); \ -CHAOS_SYS_CALLBACKS(a); \ +#define LATOOMUTGAMMA_CALLBACKS \ +MAP_CALLBACKS; \ +CHAOS_SYS_CALLBACKS(x1); \ +CHAOS_SYS_CALLBACKS(x2); \ +CHAOS_SYS_CALLBACKS(a); \ CHAOS_SYS_CALLBACKS(b); -#define LATOOMUTGAMMA_ATTRIBUTES \ -MAP_ATTRIBUTES; \ -CHAOS_SYS_ATTRIBUTE(x1); \ -CHAOS_SYS_ATTRIBUTE(x2); \ -CHAOS_SYS_ATTRIBUTE(a); \ +#define LATOOMUTGAMMA_ATTRIBUTES \ +MAP_ATTRIBUTES; \ +CHAOS_SYS_ATTRIBUTE(x1); \ +CHAOS_SYS_ATTRIBUTE(x2); \ +CHAOS_SYS_ATTRIBUTE(a); \ CHAOS_SYS_ATTRIBUTE(b); -- cgit v1.2.1