15:15
In v9.0.1, when uPWN=12, I only get pdord warning, and this can be suppressed by adding SolveDelayed->True to NDSolveValue
A possible solution is to modify the equation set a bit i.e. add a very small derivative term of vdiode to the equation
With[{eps = 10^-3}, res = NDSolveValue[{l i'[t] == u[t, PWMFreq, PulseDuration] - r i[t] - (i[t] - 10^-14 Exp[vdiode[t]/(25/1000)]), eps vdiode'[t] + vdiode[t] + l i'[t] + r i[t] == 0, vdiode[0] == 0, i[0] == -1/2*10^-14}, {i, vdiode}, {t, timeStart, timeEnd}]]
8 hours later…
23:56
@Tschibi I have modified your original u[t] to remove the discontinuities. It doesn't work. The simulation totally miss the 5ms spike at t=4 second (for example). Then I have tried MaxStepSize-> 10^-4, but it only brings other problems ( NDSolves send complaining errors and the result is not right). At the contrary @xzczd approach gives credible results. Sadly I don't understand the magic of "+eps vdiode'[t]" effect.
« first day next day → last day (33 days later) »
Transcript for
Jan13
Jan '1714
Jan15
electrical simulation
discussion about [this answer](mathematica.stackexchange.com/a...