[Dyad] “Cyclic guesses detected” in Dyad from non-ideal RLC

Hi everyone,

I’ve been experimenting with Dyad using the RLC circuit example from the documentation, except I made it a bit less ideal by adding:

  • coil series resistance ( RL )
  • capacitor ESR (Rc

When I add the capacitor ESR, I get one warning and one error.

Warning:

┌ Warning: Initialization system is overdetermined. 3 equations for 1 unknowns. Initialization will default to using least squares. `SCCNonlinearProblem` can only be used for initialization of fully determined systems and hence will not be used here. To suppress this warning pass warn_initialize_determined = false. To make this warning into an error, pass fully_determined = true
└

Error:

ERROR: Cyclic guesses detected in the system. Symbolic values were found for the following variables/parameters in the map:
Rc₊v(t)  => (150RLoad₊v(t)) / RLoad₊R
In order to resolve this, please provide additional numeric guesses so that the chain can be resolved to assign numeric values to each variable.

From what I understand, the issue comes from initialization: there isn’t enough numeric information at t=0, so the solver can’t resolve the system.

However, when I try to add the problematic variable to the initial conditions, the initialization system becomes “weird” (effectively no unknowns), and the result ends up being 0, with a warning like:

┌ Warning: Initialization system is overdetermined. 2 equations for 0 unknowns. Initialization will default to using least squares. `SCCNonlinearProblem` can only be used for initialization of fully determined systems and hence will not be used here. To suppress this warning pass warn_initialize_determined = false. To make this warning into an error, pass fully_determined = true
└

Questions

In Julia / ModelingToolkit, you can include “soft constraints” via guesses, e.g.:

    prob = ODEProblem(sys; defaults, tspan;   guesses = [cvar=> 500.0])

Is there an equivalent way to provide numeric guesses in Dyad?

If not, what’s the recommended approach in Dyad to resolve cyclic guesses during initialization?

Thanks a lot!

Code (minimal example):

  • dyad : (Note: all the other components are the same as in the tutorial.)
component RLC_non_ideal
  RL = Resistor(R=0.1)
  Rc = Resistor(R=0.01)
  RLoad = Resistor(R=150.0)
  capacitor = Capacitor(C=1e-6)
  inductor = Inductor(L= 3e-3)
  source = StepVoltage()
  ground = Ground()
relations
  initial inductor.i = 0.0
  initial capacitor.v = 0.0
  initial Rc.v = 0.0 # added after warning
  connect(source.p, inductor.p)
  connect(inductor.n, RL.p)
  connect(RL.n, capacitor.p, RLoad.p)
  connect(Rc.p, capacitor.n, RLoad.p)
  connect(RLoad.n, Rc.n, source.n, ground.g)
end

analysis SimBoostModel
  extends TransientAnalysis(stop=0.5, abstol=1m, reltol=1m )
  model = BoostModel()
end
  • Julia:
result = SimBoostModel()

Hey, to directly address the question there is a guess relation in Dyad with the same syntax as initial. If it’s not in the docs, will add it on Monday!