Skip to content

Commit 4e876ae

Browse files
committed
add rc error tolerances as separate parameters
1 parent 38d7481 commit 4e876ae

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

ogcore/SS.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ def SS_solver(
927927
+ " budget"
928928
)
929929

930-
if ENFORCE_SOLUTION_CHECKS and (max(np.absolute(RC)) > p.mindist_SS):
930+
if ENFORCE_SOLUTION_CHECKS and (max(np.absolute(RC)) > p.RC_SS):
931931
print("Resource Constraint Difference:", RC)
932932
err = "Steady state aggregate resource constraint not satisfied"
933933
raise RuntimeError(err)

ogcore/TPI.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1326,7 +1326,7 @@ def run_TPI(p, client=None):
13261326
)
13271327

13281328
if (
1329-
np.any(np.absolute(RC_error) >= p.mindist_TPI * 10)
1329+
np.any(np.absolute(RC_error) >= p.RC_TPI)
13301330
) and ENFORCE_SOLUTION_CHECKS:
13311331
raise RuntimeError(
13321332
"Transition path equlibrium not found " + "(RC_error)"

ogcore/default_parameters.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3340,6 +3340,42 @@
33403340
}
33413341
}
33423342
},
3343+
"RC_SS": {
3344+
"title": "Tolerance for the resource constraint in the steady state solution",
3345+
"description": "Tolerance for the resource constraint in the steady state solution.",
3346+
"section_1": "Model Solution Parameters",
3347+
"notes": "",
3348+
"type": "float",
3349+
"value": [
3350+
{
3351+
"value": 1e-09
3352+
}
3353+
],
3354+
"validators": {
3355+
"range": {
3356+
"min": 1e-13,
3357+
"max": 0.001
3358+
}
3359+
}
3360+
},
3361+
"RC_TPI": {
3362+
"title": "Tolerance for the resource constraint in the time path solution",
3363+
"description": "Tolerance for the resource constraint in the time path solution.",
3364+
"section_1": "Model Solution Parameters",
3365+
"notes": "",
3366+
"type": "float",
3367+
"value": [
3368+
{
3369+
"value": 1e-05
3370+
}
3371+
],
3372+
"validators": {
3373+
"range": {
3374+
"min": 1e-13,
3375+
"max": 0.01
3376+
}
3377+
}
3378+
},
33433379
"reform_use_baseline_solution":{
33443380
"title": "Whether or not the baseline SS solution is used for starting values when solving the reform",
33453381
"description": "Whether or not the baseline SS solution is used for starting values when solving the reform.",

0 commit comments

Comments
 (0)