Skip to content

dscim.main_recipe.weitzman_min fails for larger values of eta #411

@JMGilbert

Description

@JMGilbert

https://github.com/ClimateImpactLab/dscim/blob/main/src/dscim/menu/main_recipe.py#L902-L912

If very large eta values are used, this function can create very small numbers which can exceed the smallest floats possible. As an example, with eta = 6, and no_cc_consumption and cc_consumption each being of type np.float32, parameter becomes a number usually around 10^13. The w_utility and bottom_utility variables then become numbers around -1*10^(-68) which gets stored as 0 since the float32 closest to 0 is around 10^(-38).

A fix for this may be possible by using an alternative form of the calculation or by taking advantage of the nice properties of isoelastic utility.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions