Skip to content

Commit

Permalink
[MOD] - modified Lorenz function to stabilize gpc test
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin Weise committed Jul 23, 2024
1 parent 7f799a9 commit f29a01a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pygpc/testfunctions/testfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4259,7 +4259,7 @@ def lorenz(t, state, sigma, beta, rho):
y0 = [self.p["x_0"][i], self.p["y_0"][i], self.p["z_0"][i]]
# only save x-coordinate (index 0)
sols[i, :] = odeint(lorenz, y0, t, p, tfirst=True)[:, 0]
x_out = sols
x_out = sols[:, 1:] # skip first timestep

return x_out

Expand Down Expand Up @@ -4330,6 +4330,6 @@ def simulate(self, process_id=None, matlab_engine=None):
y0 = [self.p["x_0"][i], self.p["y_0"][i], self.p["z_0"][i]]
# only save x-coordinate (index 0)
sols[i, :] = Main.Julia_Lorenz(p, y0, t)[0]
x_out = sols
x_out = sols[:, 1:] # skip first timestep

return x_out
4 changes: 2 additions & 2 deletions tests/test_postprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def test_postprocessing_002_plot_functions(self):
options["n_cpu"] = 0
options["error_type"] = 'nrmsd'
options["error_norm"] = 'absolute'
options["n_samples_validation"] = 1000
options["n_samples_validation"] = 10
options["matrix_ratio"] = 5
options["fn_results"] = fn_results
options["eps"] = 0.01
Expand Down Expand Up @@ -259,7 +259,7 @@ def test_postprocessing_002_plot_functions(self):
fn_out=fn_results + "_sens_summary.txt")

# plot time course of mean together with probability density, sobol sensitivity coefficients and global derivatives
t = np.arange(0.0, parameters["t_end"], parameters["step_size"])
t = np.arange(parameters["step_size"], parameters["t_end"], parameters["step_size"])
pygpc.plot_sens_summary(session=session,
coeffs=coeffs,
sobol=sobol,
Expand Down

0 comments on commit f29a01a

Please sign in to comment.