Hi, I am trying to create a C++ program which simulates the response of system to different voltage inputs. The circuit is simply a voltage source connected to an inductor, to ground. Using the discrete-time model of an inductor, I have the following equations to determine the voltage across the load: Is [k] = (dt/(2L))*VL[k] + hL[k - 1]hL[k-1] = IL[k-1] + (dt/(2*L))*VL[k-1]VL = 2L/dt*(IL[k] - hL[k-1])I have attached an image to better summarize the current progress thus far. My issue is that this gives me extremely large values for the resulting VLoad, which I know aren't right. Are these reliable equations to find the voltage drop across the inductor, or what could be causing this my results to go wrong? The source voltage is a PWL signal from an .txt file. I have thought it might be a convergence error or may be due to local truncation error, but I wanted to get confirmation before I go down that route first.