Skip to content

Conversation

@pilarcoordinates
Copy link
Collaborator

@pilarcoordinates pilarcoordinates commented Jan 25, 2026

This PR introduces two new examples for handling DAEs with state-dependent switches and implements a "Last Point Strategy" to optimize the integration process immediately preceding a switching point.

  1. New Examples for State-Dependent Switches
    To demonstrate and test the handling of DAEs with switches, I have added:
  • Academic Example: Fundamental example to demonstrate working with DAEs in IFDIFF. (files: daeExampleRHS.m, daeExample_main.m, daeExample_README.md)
  • RLC Circuit with Switch: Physical modeling example about an RLC electrical circuit with a voltage-controlled switch. (files: rlcRHS.m, rlc_main.m, rlcExample_README.md)
  1. Last Point Strategy (files: extendODEuntilSwitch_t1_to_t2.m and Config)
    Once a switching point is detected (between t1​ and t2​), the strategy forces the integrator to reach the exact switching point using a single step. For compatible one-step solvers the function sets the InitialStep to the remaining time-to-switch (delta_t) and relaxes the tolerances for this section. This ensures the solver hits the boundary efficiently without sub-stepping.
  • Supported Solvers: ode23, ode45, ode78, ode89, ode113, ode23t, ode23tb
  • Activation of the strategy: Enable last_point_strategy in Config file

@pilarcoordinates pilarcoordinates marked this pull request as ready for review January 25, 2026 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants