circuitjs1 icon indicating copy to clipboard operation
circuitjs1 copied to clipboard

Capacitor Trapezoidal Approximation code problem?

Open UFTL opened this issue 3 years ago • 1 comments

I think the Trapezoidal Approximation code for capacitors is acting up.

Run this: https://tinyurl.com/ybwyu6cq

Note that despite the fact that the left-most 100 uF cap is set at an initial voltage of 28 V (to match the 28 V of the battery), current still flows.

Now turn off Trapezoidal Approximation for the left-most 100 uF cap. No current flows, just as it should be.

UFTL avatar Feb 17 '22 00:02 UFTL

I suspect this is caused by roundoff error. Your timestep is set to 1 picosecond! That's extremely small, and apparently it's causing issues with capacitors that large.

pfalstad avatar Feb 18 '22 19:02 pfalstad