From b3d2d4386e8a47f97235df354a7619aa3be62a8b Mon Sep 17 00:00:00 2001 From: pogudingleb Date: Thu, 19 Dec 2024 08:18:00 +0100 Subject: [PATCH] bump SU + format --- Project.toml | 2 +- test/differentiate_output.jl | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Project.toml b/Project.toml index dd1c76fa..bfb07e0a 100644 --- a/Project.toml +++ b/Project.toml @@ -48,7 +48,7 @@ PrecompileTools = "1.2" Primes = "0.5" Random = "1.10, 1.11" SpecialFunctions = "2" -SymbolicUtils = "3.2" +SymbolicUtils = "3.7" Symbolics = "6.16" Test = "1.10, 1.11" TestSetExtensions = "2" diff --git a/test/differentiate_output.jl b/test/differentiate_output.jl index 2630097c..fbd9c03b 100644 --- a/test/differentiate_output.jl +++ b/test/differentiate_output.jl @@ -64,7 +64,7 @@ function diff_sol_Lie_derivatives(ode::ODE, params, ic, inputs, prec::Int) push!( result[y][v], eval_at_dict( - derivative(Lie_derivatives[y][j], str_to_var("$v", new_ring)), + derivative(Lie_derivatives[y][j], switch_ring(v, new_ring)), eval_point, ), ) @@ -212,6 +212,7 @@ end ), ) + t = copy(test_cases) varnames = vcat( ["x_$i" for i in 1:3], ["p_$i" for i in 1:3], @@ -280,14 +281,12 @@ end ), :ic => Dict(vars[i] => F(rand(1:50)) for i in 1:2), :param_vals => Dict(vars[i + 2] => F(rand(1:50)) for i in 1:2), - :inputs => Dict(vars[5] => [F(rand(-30:30)) for i in 1:4]), + :inputs => Dict(vars[5] => [F(rand(-30:30)) for i in 1:5]), :prec => 5, ), ) - - - for case in test_cases + for case in t ode, prec = case[:ODE], case[:prec] @time sol1 = differentiate_output(ode, case[:param_vals], case[:ic], case[:inputs], prec) @@ -296,7 +295,7 @@ end for y in ode.y_vars for v in vcat(ode.x_vars, ode.parameters) @test sol2[y][v] == [ - base_ring(ode.poly_ring)(coeff(sol1[y][v], j) * factorial(j)) for + base_ring(ode.poly_ring)(coeff(sol1[y][v], j) * facrorial(j)) for j in 0:(prec - 1) ] end