evaluate_static_model.m: provide jacobian output with bytecode

Set to NaN for block
pac-components
Johannes Pfeifer 2021-11-08 14:31:24 +01:00
parent 7cffd34b66
commit 1174cad1f8
1 changed files with 10 additions and 1 deletions

View File

@ -39,8 +39,14 @@ function [residuals,check1,jacob] = evaluate_static_model(ys,exo_ss,params,M,opt
check1 = 0;
if options.bytecode
residuals = bytecode('evaluate','static',ys,...
if nargout<3
[residuals]= bytecode('evaluate','static',ys,...
exo_ss, params, ys, 1);
else
[residuals, junk]= bytecode('evaluate','static',ys,...
exo_ss, params, ys, 1);
jacob = junk.g1;
end
else
fh_static = str2func([M.fname '.static']);
if options.block
@ -60,6 +66,9 @@ else
[~, ~, T] = feval(fh_static,b,ys,exo_ss,params,T);
end
end
if nargout==3
jacob=NaN(length(ys));
end
else
if nargout<3
residuals = feval(fh_static,ys,exo_ss,params);