Dyad - Warning: Verbosity toggle: max_iters

I build a model of a grid rectifier with some diodes and switches (fsw ~50kHz).
The simulation results look quite good, but I am getting this warning:

┌ Warning: Verbosity toggle: max_iters 
│  Interrupted. Larger maxiters is needed. If you are using an integrator for non-stiff ODEs or an automatic switching algorithm (the default), you may want to consider using a method for stiff equations. See the solver pages for more details (e.g. https://docs.sciml.ai/DiffEqDocs/stable/solvers/ode_solve/#Stiff-Problems).
└ @ SciMLBase /home/actions-runner-7/.julia/packages/SciMLBase/zNntj/src/integrator_interface.jl:679

I looked at the mentioned website and I switched to Rodas5P. It might have improved the length of the simulation a bit. I think it is quite normal that this needs a small stepsize to compute and I would not mind waiting a bit longer for a longer simulation duration.

With mtk I could set the maxiters to something bigger, but with dyad I don’t know how to do that and Dyad AI Agent could not help either :slight_smile:

I tried

extends TransientAnalysis(stop = 0.2, abstol = 1e-6, reltol = 1e-3, alg = ODEAlg.Rodas5P(max_iters = 1000000))

and

extends TransientAnalysis(stop = 0.2, abstol = 1e-6, reltol = 1e-3, alg = ODEAlg.Rodas5P(), max_iters = 1000000)

and

extends TransientAnalysis(stop = 0.2, abstol = 1e-6, reltol = 1e-3, alg = ODEAlg.Rodas5P(), maxiters = 1000000)

all give me some sort of compilation error.

Is there a way I could set maxiters to a bigger value? And where do I need to set that?

Hey, so it turns out we don’t expose maxiters in the transient analysis yet. I’ve raised this internally and perhaps we can improve that.

In the meanwhile though, any Dyad model is also an MTK model in Julia, so you can go through the usual mtkcompile → ODEProblem pipeline, though at this point that will lose some of the Dyad enhancements to the code generation. Hopefully we can follow up on that shortly, though!

P.S. it’s not quite the same, but you can always set dtmax to limit step size, as a placeholder for now.

Thanks for the quick reply! I will look into that and try to solve it the MTK way.

Would not setting dtmax be the opposite of what I want? As I understand it would limit the maximum stepsize during times where the solver could do bigger steps and thus would lead to a shorter overall simulation? I will try…