Skip to content

Calibrator: Reuse residual from solver #153

@mrp089

Description

@mrp089

Problem

We currently reimplement the residual in the calibrator, e.g., for the BloodVessel block:

residual(global_eqn_ids[0]) =
y0 - (resistance + stenosis_resistance) * y1 - y2 - inductance * dy3;
residual(global_eqn_ids[1]) =
y1 - y3 - capacitance * dy0 +
capacitance * (resistance + 2.0 * stenosis_resistance) * dy1;

However, the residual is the same as in the solver. Compare equations (2.18) and (2.24) in this paper. Only the Jacobian is different and needs to be implemented separately for the solver and calibrator.

Solution

Automatically reuse the solver's residual in the calibrator for all blocks.

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct and Contributing Guidelines

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions