diff --git a/src/MacroModelling.jl b/src/MacroModelling.jl index 8310357c..428d0f82 100644 --- a/src/MacroModelling.jl +++ b/src/MacroModelling.jl @@ -1294,7 +1294,7 @@ function solve_steady_state!(𝓂::ℳ, symbolic_SS, Symbolics::symbolics; verbo SS_solve_func = [] - atoms_in_equations = Set() + atoms_in_equations = Set{Symbol}() atoms_in_equations_list = [] relevant_pars_across = [] NSSS_solver_cache_init_tmp = [] @@ -1335,7 +1335,7 @@ function solve_steady_state!(𝓂::ℳ, symbolic_SS, Symbolics::symbolics; verbo push!(𝓂.solved_vals,Meta.parse(string(soll[1]))) # atoms = reduce(union,soll[1].atoms()) - [push!(atoms_in_equations, a) for a in soll[1].atoms()] + [push!(atoms_in_equations, Symbol(a)) for a in soll[1].atoms()] push!(atoms_in_equations_list, Set(Symbol.(soll[1].atoms()))) # println(atoms_in_equations) # push!(atoms_in_equations, soll[1].atoms()) @@ -1393,7 +1393,7 @@ function solve_steady_state!(𝓂::ℳ, symbolic_SS, Symbolics::symbolics; verbo # relevant_pars = reduce(union,map(x->x.atoms(),collect(soll[1]))) atoms = reduce(union,map(x->x.atoms(),collect(soll[1]))) # println(atoms) - [push!(atoms_in_equations, a) for a in atoms] + [push!(atoms_in_equations, Symbol(a)) for a in atoms] for (k, vars) in enumerate(vars_to_solve) push!(𝓂.solved_vars,Symbol(vars)) @@ -1685,7 +1685,7 @@ function solve_steady_state!(𝓂::ℳ, symbolic_SS, Symbolics::symbolics; verbo parameters_in_equations = [] for (i, parss) in enumerate(𝓂.parameters) - if parss ∈ union(Symbol.(atoms_in_equations),relevant_pars_across) + if parss ∈ union(atoms_in_equations, relevant_pars_across) push!(parameters_in_equations,:($parss = params[$i])) end end @@ -1736,7 +1736,7 @@ function solve_steady_state!(𝓂::ℳ, symbolic_SS, Symbolics::symbolics; verbo # fix parameter bounds par_bounds = [] - for varpar in intersect(𝓂.bounded_vars, intersect(𝓂.parameters,union(Symbol.(atoms_in_equations),relevant_pars_across))) + for varpar in intersect(𝓂.bounded_vars, intersect(𝓂.parameters,union(atoms_in_equations, relevant_pars_across))) i = indexin([varpar],𝓂.bounded_vars) push!(par_bounds, :($varpar = min(max($varpar,$(𝓂.lower_bounds[i...])),$(𝓂.upper_bounds[i...])))) end @@ -1837,7 +1837,7 @@ function solve_steady_state!(𝓂::ℳ; verbose::Bool = false) SS_solve_func = [] - atoms_in_equations = Set() + atoms_in_equations = Set{Symbol}() atoms_in_equations_list = [] relevant_pars_across = [] NSSS_solver_cache_init_tmp = [] @@ -2050,7 +2050,7 @@ function solve_steady_state!(𝓂::ℳ; verbose::Bool = false) parameters_in_equations = [] for (i, parss) in enumerate(𝓂.parameters) - if parss ∈ union(Symbol.(atoms_in_equations),relevant_pars_across) + if parss ∈ union(atoms_in_equations, relevant_pars_across) push!(parameters_in_equations,:($parss = params[$i])) end end @@ -2092,7 +2092,7 @@ function solve_steady_state!(𝓂::ℳ; verbose::Bool = false) # fix parameter bounds par_bounds = [] - for varpar in intersect(𝓂.bounded_vars, intersect(𝓂.parameters,union(Symbol.(atoms_in_equations),relevant_pars_across))) + for varpar in intersect(𝓂.bounded_vars, intersect(𝓂.parameters,union(atoms_in_equations, relevant_pars_across))) i = indexin([varpar],𝓂.bounded_vars) push!(par_bounds, :($varpar = min(max($varpar,$(𝓂.lower_bounds[i...])),$(𝓂.upper_bounds[i...])))) end