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

**URL:** https://discourse.julialang.org/t/dyad-cyclic-guesses-detected-in-dyad-from-non-ideal-rlc/135249
**Category:** Modelling & Simulations
**Tags:** modelingtoolkit, dyad
**Created:** [January 25, 2026, 12:31am UTC](https://discourse.julialang.org/t/dyad-cyclic-guesses-detected-in-dyad-from-non-ideal-rlc/135249 "2026-01-25T00:31:51Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![junmorenodi99](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/junmorenodi99/32/217862_2.png) [@junmorenodi99](https://discourse.julialang.org/u/junmorenodi99)
#### Post date: [January 25, 2026, 12:31am UTC](https://discourse.julialang.org/t/dyad-cyclic-guesses-detected-in-dyad-from-non-ideal-rlc/135249/1 "2026-01-25T00:31:51Z")

</div>

Hi everyone,

I’ve been experimenting with **Dyad** using the [**RLC circuit example**](https://help.juliahub.com/dyad/dev/tutorials/creating-components.html) 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:**

```julia-auto
┌ 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:**

```julia-auto
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:

```julia-auto
┌ 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.:

```julia-auto
    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.)

```julia-auto
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:

```julia-auto
result = SimBoostModel()

```

---

<div class="post-metadata">

### Author: ![asinghvi17](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/asinghvi17/32/8272_2.png) [@asinghvi17](https://discourse.julialang.org/u/asinghvi17)
#### Post date: [January 25, 2026, 1:39am UTC](https://discourse.julialang.org/t/dyad-cyclic-guesses-detected-in-dyad-from-non-ideal-rlc/135249/2 "2026-01-25T01:39:21Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)
#### Post date: [January 25, 2026, 6:50am UTC](https://discourse.julialang.org/t/dyad-cyclic-guesses-detected-in-dyad-from-non-ideal-rlc/135249/3 "2026-01-25T06:50:23Z")

</div>

> [@junmorenodi99](#):
>
> `Warning: Initialization system is overdetermined. 3 equations for 1 unknowns`

The problem here is probably not _lack_ of information, I think it’s the opposite, two initial conditions too much. You can ask MTK for `initial_conditions(model)` and see if there are more specified than expected. Have a look at the dimension of the state after `mtkcompile`, and make sure you have specified the same number of initial conditions. If you do not, you’ll have an under or over determined system and initialization will be a bit harder.

---

<div class="post-metadata">

### Author: ![johhell](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johhell/32/46165_2.png) [@johhell](https://discourse.julialang.org/u/johhell)
#### Post date: [January 25, 2026, 7:58am UTC](https://discourse.julialang.org/t/dyad-cyclic-guesses-detected-in-dyad-from-non-ideal-rlc/135249/4 "2026-01-25T07:58:26Z")

</div>

> [@junmorenodi99](#):
>
> ```julia-auto
> 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)
> 
> ```

Check the connections: `RLoad.p` is connected with both ends of `capacitor` resulting in a short-circuit.

---

<div class="post-metadata">

### Author: ![junmorenodi99](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/junmorenodi99/32/217862_2.png) [@junmorenodi99](https://discourse.julialang.org/u/junmorenodi99)
#### Post date: [January 25, 2026, 4:11pm UTC](https://discourse.julialang.org/t/dyad-cyclic-guesses-detected-in-dyad-from-non-ideal-rlc/135249/5 "2026-01-25T16:11:51Z")

</div>

You’re right ! thanks for pointing that out.

It was a copy/paste mistake, but even with the correct configuration I’m still seeing the same issue.

```julia-auto
  connect(source.p, inductor.p)
  connect(inductor.n, RL.p)
  connect(RL.n, capacitor.p, RLoad.p)
  connect(Rc.p, capacitor.n)
  connect(RLoad.n, Rc.n, source.n, ground.g)

```

Here’s the output I’m getting:

```julia-auto
┌ Warning: Did not converge after `maxiters = 100` substitutions. Either there is a cycle in the rules or `maxiters` needs to be higher.

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

```

Although it’s true that the symbolic values detected this time are different.

---

<div class="post-metadata">

### Author: ![junmorenodi99](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/junmorenodi99/32/217862_2.png) [@junmorenodi99](https://discourse.julialang.org/u/junmorenodi99)
#### Post date: [January 25, 2026, 4:24pm UTC](https://discourse.julialang.org/t/dyad-cyclic-guesses-detected-in-dyad-from-non-ideal-rlc/135249/6 "2026-01-25T16:24:23Z")

</div>

Thanks everyone for the help!

I tried what @asinghvi17 suggested using the corrected model (thanks again @johhell), and this time it worked 🙂.

Here’s the corrected code, plus the extra **guess** added for the variable mentioned in the Error:

```julia-auto
component BoostModel
  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
  guess capacitor.i = 0.0 # added 
  connect(source.p, inductor.p)
  connect(inductor.n, RL.p)
  connect(RL.n, capacitor.p, RLoad.p)
  connect(Rc.p, capacitor.n)
  connect(RLoad.n, Rc.n, source.n, ground.g)
end

```

@baggepinnen thanks for the recommendation. It’ll be useful later for more complex applications.
