@@ -46,7 +46,7 @@ function ode_def_opts(name::Symbol,opts::Dict{Symbol,Bool},ex::Expr,params...;M=
4646 # Parameter Functions
4747 paramfuncs = Vector {Vector{Expr}} (undef, numparams)
4848 for i in 1 : numparams
49- tmp_pfunc = Vector {Expr} (length (funcs))
49+ tmp_pfunc = Vector {Expr} (undef, length (funcs))
5050 for j in eachindex (funcs)
5151 tmp_pfunc[j] = copy (funcs[j])
5252 end
@@ -104,14 +104,14 @@ function ode_def_opts(name::Symbol,opts::Dict{Symbol,Bool},ex::Expr,params...;M=
104104 tgrad_exists = true
105105 tgradex = build_tgrad_func (symtgrad,indvar_dict,params)
106106 catch err
107- warn (" Time Derivative Gradient could not be built" )
107+ @ warn (" Time Derivative Gradient could not be built" )
108108 end
109109 end
110110
111111 if opts[:build_jac ]
112112 try # Jacobians and Hessian
113113 # Build the Jacobian Matrix of SymEngine Expressions
114- symjac = Matrix {SymEngine.Basic} (numsyms,numsyms)
114+ symjac = Matrix {SymEngine.Basic} (undef, numsyms,numsyms)
115115 for i in eachindex (funcs)
116116 for j in eachindex (syms)
117117 symjac[i,j] = diff (symfuncs[i],syms[j])
@@ -125,12 +125,12 @@ function ode_def_opts(name::Symbol,opts::Dict{Symbol,Bool},ex::Expr,params...;M=
125125
126126 if opts[:build_expjac ]
127127 try
128- expjac = expm (γ* symjac) # This does not work, which is why disabled
128+ expjac = exp (γ* symjac) # This does not work, which is why disabled
129129 expJex = build_jac_func (expjac,indvar_dict,params)
130130 bad_derivative (expJex)
131131 expjac_exists = true
132132 catch
133- warn (" Jacobian could not exponentiate" )
133+ @ warn (" Jacobian could not exponentiate" )
134134 end
135135 end
136136
@@ -141,7 +141,8 @@ function ode_def_opts(name::Symbol,opts::Dict{Symbol,Bool},ex::Expr,params...;M=
141141 bad_derivative (invJex)
142142 invjac_exists = true
143143 catch err
144- warn (" Jacobian could not invert" )
144+ println (err)
145+ @warn (" Jacobian could not invert" )
145146 end
146147 end
147148 if opts[:build_invW ]
@@ -155,7 +156,8 @@ function ode_def_opts(name::Symbol,opts::Dict{Symbol,Bool},ex::Expr,params...;M=
155156 bad_derivative (invWex_t)
156157 invW_t_exists = true
157158 catch err
158- warn (" Rosenbrock-W could not invert" )
159+ println (err)
160+ @warn (" Rosenbrock-W could not invert" )
159161 end
160162 end
161163 if opts[:build_hes ]
@@ -175,13 +177,15 @@ function ode_def_opts(name::Symbol,opts::Dict{Symbol,Bool},ex::Expr,params...;M=
175177 bad_derivative (invHex)
176178 invhes_exists = true
177179 catch err
178- warn (" Hessian could not invert" )
180+ @ warn (" Hessian could not invert" )
179181 end
180182 end
183+ catch err
184+ @warn (" Hessians failed to build." )
181185 end
182186 end
183187 catch err
184- warn (" Failed to build the Jacobian. This means the Hessian is not built as well." )
188+ @ warn (" Failed to build the Jacobian. This means the Hessian is not built as well." )
185189 end
186190 end # End Jacobian tree
187191
@@ -218,11 +222,11 @@ function ode_def_opts(name::Symbol,opts::Dict{Symbol,Bool},ex::Expr,params...;M=
218222 param_jac_exists = true
219223 catch err
220224 println (err)
221- warn (" Failed to build the parameter derivatives." )
225+ @ warn (" Failed to build the parameter derivatives." )
222226 end
223227 end
224228 catch err
225- warn (" Symbolic calculations could not initiate. Likely there's a function which is not differentiable by SymEngine." )
229+ @ warn (" Symbolic calculations could not initiate. Likely there's a function which is not differentiable by SymEngine." )
226230 end
227231 end
228232
0 commit comments