Skip to content

use np.expm1 in singlediode model for exp(x) - 1 #500

Closed
@mikofski

Description

@mikofski

Problem
it is possible that at extremely small voltages there may be machine precision error of less than 1 part per million because the single diode model has the term exp(x) - 1 which has an increasing error as x → 0 because exp(x) → 1, so 1 - 1 is a very, very small number close to zero.

Solution
Use np.expm1(x) instead of np.exp(x) - 1 as suggested in this comment

Additional context
#409

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions