I posted on the Mathematica thread of the Raspberry Pi forum (https://www.raspberrypi.org/forums/viewtopic.php?f=94&t=174635) in search of an equation describing the behaviour of an electronic RC network. It's a standard topic in undergraduate maths, but not in the depth I require. Here's an edited version of the thread:

A respondent replied:

... to which I responded:

I'd be most grateful for any assistance, and would like to post back anything useful to the Rpi forum, with permission and attribution.

*This is more about mathematics and electronics, but I'd like to use Mathematica to generate the graphs I need. It's probably something that others might also find useful.*

Given: a voltage source Vo with an output of 0V - 5V at a frequency Fclk. One end of a resistor R is connected to Vo, the other end to a capacitor C, the second terminal of C being connected to 0V.

Required: an equation of the form v = f(t) that gives the voltage across the capacitor at time t.Given: a voltage source Vo with an output of 0V - 5V at a frequency Fclk. One end of a resistor R is connected to Vo, the other end to a capacitor C, the second terminal of C being connected to 0V.

Required: an equation of the form v = f(t) that gives the voltage across the capacitor at time t.

*Working: I've only ever solved for a steady voltage using some variant of the standard equation dv/dt = i/C. The standard text-book integration is over the interval (inf - t] and does not address varying voltages. My maths isn't good enough to know where to start with a solution, and I'd be most grateful for any pointers to info or suggestions for a solution.*A respondent replied:

*What you have described is an RC low-pass filter.*

Look up in wiki under RC filters. The -3dB point frequency is at 1/(2*PI*R*C).Look up in wiki under RC filters. The -3dB point frequency is at 1/(2*PI*R*C).

... to which I responded:

*The filter analyses I've seen treat the RC combination as a frequency-dependent network, and thus use the frequency domain as the abscissa rather than time, as I require.*

The other analyses use a "step" approach. They use starting conditions to plot the v:t curve using the standard exponential function up to the first half-cycle of the waveform, then change the form of the equation to recalculate using the new voltage for the next half-cycle, and repeat this until a steady state becomes evident. This strikes me as rather inelegant, and I've no idea how to insert it into Mathematica to create the graph I want.

On the other hand, I don't know of any mathematical formalism that allows a "continuous" equation to be derived. There may be one in e.g. multivariable calculus, but my knowledge doesn't stretch that far.

The other analyses use a "step" approach. They use starting conditions to plot the v:t curve using the standard exponential function up to the first half-cycle of the waveform, then change the form of the equation to recalculate using the new voltage for the next half-cycle, and repeat this until a steady state becomes evident. This strikes me as rather inelegant, and I've no idea how to insert it into Mathematica to create the graph I want.

On the other hand, I don't know of any mathematical formalism that allows a "continuous" equation to be derived. There may be one in e.g. multivariable calculus, but my knowledge doesn't stretch that far.

*... there are two independent variables - time and current - and one dependent variable - the voltage across the capacitor. The current into and out of the cap is determined by the drive voltage applied to the resistor, which alternates over time.*

Standard diff equns are of the form y = dx/dz so integrating with respect to z yields a function x = F(y), typically using a standardized integral.

One possibility is partial differential equations. I've only ever encountered them in the vector analysis of fields, usually dx/dt, dy/dt and dz/dt. Whether or not the technique could be applied here I'm not knowlegeable enough to say.Standard diff equns are of the form y = dx/dz so integrating with respect to z yields a function x = F(y), typically using a standardized integral.

One possibility is partial differential equations. I've only ever encountered them in the vector analysis of fields, usually dx/dt, dy/dt and dz/dt. Whether or not the technique could be applied here I'm not knowlegeable enough to say.

I'd be most grateful for any assistance, and would like to post back anything useful to the Rpi forum, with permission and attribution.

Last edited: