From eb5342022a5f362894b1066781cb5420e550e83e Mon Sep 17 00:00:00 2001 From: beckynevin Date: Fri, 1 Sep 2023 15:44:30 -0600 Subject: [PATCH 1/3] switched time to be within the cosine argument --- deepbench/physics_object/pendulum.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deepbench/physics_object/pendulum.py b/deepbench/physics_object/pendulum.py index 65143c2..05f7c84 100644 --- a/deepbench/physics_object/pendulum.py +++ b/deepbench/physics_object/pendulum.py @@ -299,11 +299,11 @@ def simulate_pendulum_dynamics(self, time: Union[float, np.array]): pendulum_arm_length_values.any() > 0 ), "f{pendulum_arm_length_values} not greater than zero" theta_time = starting_angle_values * np.cos( - np.sqrt(acceleration_values / pendulum_arm_length_values) + np.sqrt(acceleration_values / pendulum_arm_length_values) * time ) # Calculate x using the modified parameters and time - return pendulum_arm_length_values * np.sin(theta_time * time) + return pendulum_arm_length_values * np.sin(theta_time) def displayObject(self, time: Union[float, np.array]): """ From f6b6a46712a5996d78f8fbe82d75995405f29580 Mon Sep 17 00:00:00 2001 From: beckynevin Date: Tue, 5 Sep 2023 13:10:43 -0600 Subject: [PATCH 2/3] changed pendulum formula --- deepbench/physics_object/pendulum.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deepbench/physics_object/pendulum.py b/deepbench/physics_object/pendulum.py index 05f7c84..19effde 100644 --- a/deepbench/physics_object/pendulum.py +++ b/deepbench/physics_object/pendulum.py @@ -173,10 +173,12 @@ def create_noise( if verbose: print("key", key, "attribute", attribute, "noise level", noise_level) if noise_level is not None: + print("attribute before", attribute) attribute = rs.normal( loc=attribute, scale=attribute * noise_level, size=n_steps ) setattr(self, key, attribute) + print("resetting attribute", attribute) # Now, if this is the hierarchical case, we can redefine # the acceleration_due_to_gravity term if self._noise_level["acceleration_due_to_gravity"] is None: From a90380607a4e32e33a907f3c95c2fa1a68a6184b Mon Sep 17 00:00:00 2001 From: beckynevin Date: Wed, 6 Sep 2023 14:52:11 -0600 Subject: [PATCH 3/3] removed print statements --- deepbench/physics_object/pendulum.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/deepbench/physics_object/pendulum.py b/deepbench/physics_object/pendulum.py index 19effde..05f7c84 100644 --- a/deepbench/physics_object/pendulum.py +++ b/deepbench/physics_object/pendulum.py @@ -173,12 +173,10 @@ def create_noise( if verbose: print("key", key, "attribute", attribute, "noise level", noise_level) if noise_level is not None: - print("attribute before", attribute) attribute = rs.normal( loc=attribute, scale=attribute * noise_level, size=n_steps ) setattr(self, key, attribute) - print("resetting attribute", attribute) # Now, if this is the hierarchical case, we can redefine # the acceleration_due_to_gravity term if self._noise_level["acceleration_due_to_gravity"] is None: