0
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

For the above circuit I want to know if there is a formula that can give me the capacitor voltage as a function of time. I'm not interested in developing or deriving such a formula myself; I just want to know if such a formula already exists.

In this circuit what we know is the amplitude, frequency of the source, the resistor value and the capacitor value, diode is as it is (Vf). Because of the tau value is so big I don't want to run the simulator everytime to calculate the total charge time so a formula would help so much.

\$\endgroup\$
16
  • 2
    \$\begingroup\$ To reach the exact value takes infinite time. \$\endgroup\$
    – Andy aka
    Apr 27 at 13:02
  • 2
    \$\begingroup\$ @ElliotAlderson what if I don't have a simulator or maybe the battery of my pc is down or I'm away from the PC , can I not want to know how to calculate it with a pencil , paper and a calculator with a formula ? I simply care if there is a "mathematical expression of the time that it takes the capacitor to charge of to its x percent" .. Simply "care this " simply ... \$\endgroup\$
    – GNY
    Apr 27 at 13:52
  • 3
    \$\begingroup\$ @All - We continue to get flags on comments which don't respond to the specific question here. The OP wants to understand if there is a mathematical approach or formula to calculate this and does not want to run a simulator each time. Therefore comments which just say to run a simulator come across as unhelpful (even passive-aggressive) since they are deliberately ignoring the constraint in the question. Please don't do that. Those comments are being counted and deleted. Remember: You don't have to comment, so either be constructive & friendly or don't comment. Thanks. \$\endgroup\$
    – SamGibson
    Apr 27 at 14:31
  • 2
    \$\begingroup\$ At a first attempt, I considered \$\tau = P2RC\$, where P is the universal parabolic constant, however this isn't holing true for different values. The answer will have a non-linear component in it. \$\endgroup\$
    – rdtsc
    Apr 27 at 15:49
  • 3
    \$\begingroup\$ Do you want to consider an ideal diode (e.g. zero ON resistance, or some finite, fixed value), or a (quasi-)real case? If it's the former then it's a simple matter of an RC time constant, 1-exp(-t/tau); if it's the latter then you'll end up with a LambertW function (see this post from jonk, for example). \$\endgroup\$ Apr 27 at 17:50

2 Answers 2

2
\$\begingroup\$

Whenever V1 is above V(C1)-0.7V (approximately), the capacitor charges, according to the following differential equation:

$$ \frac{{\rm d}Q}{{\rm d}t} = \frac{V_R}{R}, $$

where \$Q\$ is the charge on the capacitor, and \$V_R\$ is the voltage across the resistor. The resistor acts as a voltage-to-current converter, and the capacitor acts as an integrator for that current. Since \$C=Q/V_C\$, \$V_R \approx V_1- V_C-0.7{\rm\ V}\$, and \$V_1(t)=A\sin(\omega t)\$, we get

$$ RC^{-1}\frac{{\rm d}V_C}{{\rm d}t} = A\sin(\omega t) - V_C - 0.7{\rm\ V}. $$

This differential equation would have to be integrated for each time period when \$V_1>V_C\$. Since it is linear in \$R/C\$, you can solve it once, e.g. by simulation, for \$R=C=1\$, and then rescale the solution for any R and C you want. If the diode is assumed to be ideal, i.e. with \$V_F=0\$, the solution is linear in \$A\$ as well, and of course it scales with time according to \$\omega\$. So you really can just stick it into CircuitLab, set \$R=C=A=1\$, get a plot, and then just change the units on the time and voltage scale, and the solution will be valid. Play with it by changing R, C and A, and look how the plot will change. You'll immediately know how to rescale the prototypical plot :)

Here's the prototypical circuit:

schematic

simulate this circuit – Schematic created using CircuitLab

And here is its voltage-vs-time plot:

enter image description here

The time units get multiplied by the values of R and C, e.g. the right hand side of the plot is at 30s. With R=10, C=1, it'd be 300s. With R=1, C=0.2F, it'd be 6s. The voltage scales linearly with amplitude of the sine wave, e.g. for 100V, the asymptote is at 100V, not 1V. Easy, right?

And then you can fit a polynomial or any other function of your liking to this plot and see what comes out :)

\$\endgroup\$
6
  • \$\begingroup\$ @Kubahasn'tforgottenmonica thanks for your approach , when I try to solve the equation I get Vc(t) = integral(Asin(wt)*e^t*dt)/e^t . At this stage I have to accumulate the 't' values for the conditions V1(t)>Vc(t) , am I correct ? \$\endgroup\$
    – GNY
    Apr 28 at 5:45
  • 1
    \$\begingroup\$ @GNY And remember that the charging time during each half wave decreases as the capacitor charges, so the integration interval is not constant. \$\endgroup\$ Apr 28 at 9:33
  • \$\begingroup\$ @GNY There's no closed form solution to this because it has to be integrated over discrete time intervals and then summed. It's a hybrid continuous-discrete problem. So you can just simulate it once, plot out \$V_C(t)\$, for C=R=A=1, and then just rescale it. The voltage scales with R. Time scales inversely to C, i.e. if C is doubled, the time units are doubled as well, and so on. Back in the days when SPICE was a luxury, you'd plot this on a chart recorder, stick it in your notebook, and rescale as needed. Handy. \$\endgroup\$ Apr 28 at 12:01
  • \$\begingroup\$ "then you can fit a polynomial or any other function" Like one based on a logarithm.. ;) Under certain premises (voltage large enough so that even 5% of it is much more than the diode voltage drop; series resistance large enough compared to the diode, many charge cycles due to RC >> 1/Hz etc). That's it: a good and quick estimate. \$\endgroup\$
    – devnull
    Apr 28 at 12:16
  • 2
    \$\begingroup\$ @All - Due to multiple flags here, we've had to delete yet more comments e.g. due to people creating "strawman" arguments, and attacking the OP's question through those. And then other people have got angry about that injustice. Please be nice ... be welcoming and patient, as the site rules require everyone to be. Don't try to guess intent. If something is important to know then ask - don't assume and then criticise based on that assumption. Don't misquote people. Don't criticise the question in a way that feels personal, see the CoC. Thanks. \$\endgroup\$
    – SamGibson
    Apr 28 at 13:33
1
\$\begingroup\$

As @Kuba hasn't forgotten Monica stated, it is a recurrent equation, so the solution is also recurrent. Calculating is possible, but "longest" ... And recurrent equation can't always be "reduced" to a simple easy equation.

EDIT: The "solution" can't be reduced to an exponential equation.
Updated picture with "nearest" exponential function.
In the beginning, it is quasi exponential (until 50% ok, but can't justify -until now- the exponent), but after it diverges quickly.

Note: as the amplitude of the sinusoid is "big", one can forget the diode, except that it locks the charge.

So, I made a simulation ...
You have also the "answer" for any "%" charge.

enter image description here

\$\endgroup\$
4
  • \$\begingroup\$ Thanks for the effort by the way . Which simulator program is that ? \$\endgroup\$
    – GNY
    Apr 28 at 6:39
  • 1
    \$\begingroup\$ Free simulator microcap v12, spectrum-soft.com/download/mc12cd.zip \$\endgroup\$
    – Antonio51
    Apr 28 at 6:41
  • 2
    \$\begingroup\$ @Antonio51 Now that you have the simulation set up, can you tell the OP and the rest of us how long it takes to run if we, say, change the capacitor value? Does it take longer than the time needed to calculate the result by hand from a differential equation? I'm betting the simulation is faster and the OP's objection to simulation is disingenuous. \$\endgroup\$ Apr 28 at 9:31
  • \$\begingroup\$ Between loading file (after drawing it :-) ), slowly changing values, running on i7 Intel Core takes 10 s? For a newbie, it should take a bit "longer". Note that axes are adapted automatically with the use of microcap text "litteral" instructions and embedded "calculators". \$\endgroup\$
    – Antonio51
    Apr 28 at 13:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.