Skip to content
Snippets Groups Projects
Commit 6cf8f27d authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Merge branch 'RBC_mom' into 'master'

RBC_MoM: filter out additional pathological cases with try-catch

See merge request !1755
parents 032357f8 9fa24aa7
Branches
Tags
1 merge request!1755RBC_MoM: filter out additional pathological cases with try-catch
Pipeline #4048 passed
......@@ -10,8 +10,13 @@ if ETAc == 1 && ETAl == 1
else
% No closed-form solution use a fixed-point algorithm
N0 = 1/3;
[N, ~, exitflag] = fsolve(@(N) THETA*(1-N)^(-ETAl)*N^ETAc - (1-BETTA*B)*(C_O_N*(1-B))^(-ETAc)*W, N0,optimset('Display','off','TolX',1e-12,'TolFun',1e-12));
if exitflag<1
try
[N, ~, exitflag] = fsolve(@(N) THETA*(1-N)^(-ETAl)*N^ETAc - (1-BETTA*B)*(C_O_N*(1-B))^(-ETAc)*W, N0,optimset('Display','off','TolX',1e-12,'TolFun',1e-12));
if exitflag<1
info=1;
end
catch
N=NaN;
info=1;
end
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment