RC - Thevenin Equivalent Analysis

Thread Starter

itsamiracle

Joined Mar 16, 2026
4
Screenshot 2026-03-16 003506.png hi, I'm working on the above problem, and I'm having some discrepancies with my solution versus a simulation.
for my solution, I'm solving for a thevenin equivalent of everything to the left of the capacitor
I found r_th = 15
for v_th: the node in between the 30, 10, and 15ohm resistor has voltage x, and the node between the 10, 60ohm has voltage y
so i set up KCL on those nodes for x and y, and found that y = (v_s + 1200)/4
plugging in the givens, I found a capacitor equation of v_c(t) = 600 - 600 e^(-t/15)
on the other hand, my spice simulation varies from -150 to 480, which doesn't match. Any help on where I'm going wrong would be greatly appreciated.
 

Attachments

Last edited by a moderator:

WBahn

Joined Mar 31, 2012
32,702
View attachment 364718 hi, I'm working on the above problem, and I'm having some discrepancies with my solution versus a simulation.
for my solution, I'm solving for a thevenin equivalent of everything to the left of the capacitor
I found r_th = 15
for v_th: the node in between the 30, 10, and 15ohm resistor has voltage x, and the node between the 10, 60ohm has voltage y
so i set up KCL on those nodes for x and y, and found that y = (v_s + 1200)/4
plugging in the givens, I found a capacitor equation of v_c(t) = 600 - 600 e^(-t/15)
on the other hand, my spice simulation varies from -150 to 480, which doesn't match. Any help on where I'm going wrong would be greatly appreciated.
Thank you for describing the work you've done so far. It would help if it were in a bit more detail, but at least it's there.

When discussing a circuit (whether here or in the work you present for grading, or to your supervisor or a customer), I recommend making it as easy as possible for them to follow your work. So don't describe nodes based on what things they connect together and make the reader hunt for them. Annotate your circuit diagram with every variable you reference so that the reader can see immediately what you are referring to. Remember, you are asking us for free help, you are asking a grader to award you a grade, you are asking a supervisor or customer to pay you for your work. It is in YOUR best interest to make that as easy and enjoyable as you can -- doing so WILL pay off.

So take the time to do something like the following:

1773644951639.png
Now you can talk about the voltage on Node B, or even just refer to V_B, and people can immediately see which voltage you are talking about.

So... which do you believe is correct? Do you have confidence that your work is correct and that you aren't setting up the simulation quite right? Or are you pretty sure you've set up the simulation correctly and suspect that your work has an issue?

The are two quite different discussions.

If you suspect your work may be wrong, the consider the following:

You need to SHOW YOUR WORK. What if you hadn't gotten the correct value for Rth? All we could have done would have told you that you were wrong. But if you show how you got it, then if you are wrong we are in a position to help you discover what you did wrong. Similarly, don't tell use that you set up KCL on a couple of nodes. We are not mind readers. Show your equations. Frequently, if you make a mistake it will be in setting up your equations. We can point out your mistakes if that's the problem, but when you just say that you set them up and then give the result, if the result is wrong, we can only tell you that it's wrong, not why it is wrong.

Now let's turn attention to your simulation.

You should always include your LTSpice simulation files so that we can run them and make suggestions. Screenshots are useful, but limited. There are lots of things that are set in the file but not reflected on the schematic.

They are particular limited when you make us guess what is being shown. You are plotting the voltage on node n003. How are we supposed to know which node that is. Engineering is not about making people guess. Always label any node that you are going to plot or refer to.

Also, we can't tell if you've set up your Pulse voltage source correctly. You should show the trace for that waveform as well. This is also why it's good to attach the sim file so that we can verify that it's correct.

Because you didn't attach your simulation file, anyone that wants to validate your results has to manually set up the schematic and simulation commands themselves. Don't make people that want to give you free help put in that kind of effort -- many will just move on to another thread. Also, since they aren't running YOUR file, no one knows if they are really running YOUR circuit as YOU set it up.

I went ahead and did this and got the following results (notice the node labels and the separation of the waveforms and the axis scaling).

1773649230304.png

1773649255219.png


I tried to set my file up like your circuit, but clearly the results are not the same as yours. If you will attach your .asc file, I can look into it and see if I can figure out the difference.
 

WBahn

Joined Mar 31, 2012
32,702
Look very carefully at the following two circuits from your first post:

1773731868693.png

1773731964043.png

Are those really the same circuit?

We all have a tendency to see what we expect to see, even when it doesn't match what is actually right in front of us.
 

MrAl

Joined Jun 17, 2014
13,667
View attachment 364718 hi, I'm working on the above problem, and I'm having some discrepancies with my solution versus a simulation.
for my solution, I'm solving for a thevenin equivalent of everything to the left of the capacitor
I found r_th = 15
for v_th: the node in between the 30, 10, and 15ohm resistor has voltage x, and the node between the 10, 60ohm has voltage y
so i set up KCL on those nodes for x and y, and found that y = (v_s + 1200)/4
plugging in the givens, I found a capacitor equation of v_c(t) = 600 - 600 e^(-t/15)
on the other hand, my spice simulation varies from -150 to 480, which doesn't match. Any help on where I'm going wrong would be greatly appreciated.
Hi,

I got the same result for the capacitor voltage you call v_c(t), but in the simulation along with having the current source connected wrong, you also assumed that a pulse of -1200v for 4 seconds would be enough to represent the state of the circuit just before the +1200v source is applied. In your simulation that happens at t=4 seconds. This brings in two issues.

The first is that when you look at the graph, when you see the solution for v_c(t)=500v, it will be advanced by that 4 seconds so you would have to subtract that 4 seconds. If you got 30 seconds for example, you would have to subtract 4 seconds to get 26 seconds (if that was the right result).
The way these problems are usually done is we solve for the initial conditions first before applying the next topology. Doing that, the graph would have come out to the right value at the actual right time when the voltage had reached 500v.
The reason we do this is because that is the way we handle initial conditions. First we solve for them, then proceed from there. That helps get the initial conditions correct. If we don't do that, we might end up getting the wrong initial conditions. For example, if the initial voltage was -1100v instead of -1200v, you would have had a hard time finding the right result graphically for the time value when vc=500v. It's better to do it in two steps unless you can be certain that the initial conditions will be the same with the -1200v pulse as they would with a constant -1200v for a very long time. 4 seconds is not a very long time.

So the second thing is, how did you determine that the -1200v pulse for 4 seconds would be enough. Why not 8 seconds, or 2 seconds, or 100 seconds? This is very important. It's the time when the initial conditions come to steady state.
 

WBahn

Joined Mar 31, 2012
32,702
So the second thing is, how did you determine that the -1200v pulse for 4 seconds would be enough. Why not 8 seconds, or 2 seconds, or 100 seconds? This is very important. It's the time when the initial conditions come to steady state.
The quickest way is to try it and look at the waveform. If it is flat from the start of the simulation to the time of the change, then the DC operating point of the simulation converged based on the initial voltage. This is usually what happens, but is not guaranteed, particularly for more complex circuits or circuits with charge-storage nodes. These often require the simulator to perform a power-up analysis to obtain initial-point convergence and then you need to be very careful about being aware of simulation artifacts in the transient response.

The better way is to impose the desired initial conditions in the simulation files, but this requires that those conditions have been previously determined. If you are trying to verify the correctness of your analysis, this is not a very good way to go.

The more-or-less gold standard is to do two simulations. In the first, you simulate the desired initial conditions and let the simulator converge where ever it wants to and take however long it needs to take in order to do it. You then capture the node voltages and use those to impose initial conditions in subsequent simulations. Of course, if you change the circuit, you have to do it all over again. But if your simulation takes an hour to get through the power-up transient (and I've worked on circuits that took quite a bit longer), but the transient is settled within a few seconds when you impose the initial conditions from a previous power-up simulation, even if the circuit has changed a bit, you do it so that you can keep making progress. When you do your final simulations for the critical design review, you should do a fresh power-up analysis to verify that it is still valid and use those results for the initial conditions for the various details simulations.

The real fun comes when you need to do corner sims or Monte Carlo sims on a circuit that has convergence issues.
 

MrAl

Joined Jun 17, 2014
13,667
Hello there,

Yes the gold standard is really the only way to do this in order to be sure. It's always two steps:
1. Solve for the initial values.
2. Solve for the rest.

The possible problem with accepting the flat part as gold is that it can be ramping and still now show up on the graph. Luckily that would probably be small.
An example 'might' be using -1190v (just a guess) as the starting voltage, then check for steady state. It could be that the ramping does not change much though. Even -1200v is interesting though, because the time constant is 15 seconds, which means 5 time constants is 75 seconds. That suggests if we apply a pulse it should be for 75 seconds to get to within 1 percent of final value. 104 seconds to get even better, to within 0.1 percent of final value.

What else I like about the standard two step analysis is that once we get the right initial values and startup the transient part of the simulation, then we can read the values off on the graph almost, such as for the time to reach 500v,

I guess we can estimate the graphical error that might come up. If we have 1080 pixels vertically and estimate that at 1000, and it takes up half the screen vertically with the voltage range 0 to 600v, then each pixel represents 1.2 volts vertically. So the most we would be off is around 1.2v, but that's if it stops ramping up. With -1190v it looks like it gets within 1 percent of final value after 75 seconds and the final value is about 2.5 volts, so it would not show up in 4 seconds but it should show up in 75 seconds as a two pixel difference.
With -1195v, after 75 seconds we would see just a one pixel difference.
Interestingly, if we solved for the time constant first, we would know that after 75 seconds the initial values settle to within 1 percent of final value. After 104 seconds it would settle to within 0.1 percent of final value.
What this seems to suggest is that if we set the pulse to 75 seconds (or more) we should get a reasonable result for reading off the graph.
Sometimes we can zoom in also, which gives us better resolution as long as the time increment is small enough.

What I found sort of interesting about this problem was that when we start with the -1200v pulse or startup voltage, we have to assume the cap voltage is zero. After we apply the -1200v pulse or wait a long time, the cap voltage is again zero. That tells us we don't even have to consider the initial voltage of -1200v at all. I thought that was kind of ironic because we start with vc=0 and we end up with vc=0 when it comes time to apply the +1200v signal to get the transient response. That means the -1200v and the 20amp source balance each other out at the last node. That must have been part of the plan that the author had in mind.

In any case I think the original starter of this thread did a pretty good job except in translating the schematic from the problem spec to the simulator.
 

WBahn

Joined Mar 31, 2012
32,702
If you are doing something in which an "error" that amounts to a single pixel in the displayed waveform is a waveform of a single pixel on is important, then you are virtually guaranteed to be doing something very wrong to the extent that your conclusions, good or bad, hold very little, if any, weight.

Remember that simulations are only an approximation to the actual circuit's behavior. For a very long time, SPICE engines weren't charge-conserving. Even today, they are only charge-conserving if the device models used are compatible with that mode, and many legacy or simple models are not.
 

Thread Starter

itsamiracle

Joined Mar 16, 2026
4
Look very carefully at the following two circuits from your first post:

View attachment 364745

View attachment 364747

Are those really the same circuit?

We all have a tendency to see what we expect to see, even when it doesn't match what is actually right in front of us.
Ah, I see. My SPICE simulation has the current source attached to your node B, not node C. Rerunning my simulation with the same pulse gives a capacitor voltage ranging from 0 to 600 volts as I originally solved.

Hi,

I got the same result for the capacitor voltage you call v_c(t), but in the simulation along with having the current source connected wrong, you also assumed that a pulse of -1200v for 4 seconds would be enough to represent the state of the circuit just before the +1200v source is applied. In your simulation that happens at t=4 seconds. This brings in two issues.

The first is that when you look at the graph, when you see the solution for v_c(t)=500v, it will be advanced by that 4 seconds so you would have to subtract that 4 seconds. If you got 30 seconds for example, you would have to subtract 4 seconds to get 26 seconds (if that was the right result).
The way these problems are usually done is we solve for the initial conditions first before applying the next topology. Doing that, the graph would have come out to the right value at the actual right time when the voltage had reached 500v.
The reason we do this is because that is the way we handle initial conditions. First we solve for them, then proceed from there. That helps get the initial conditions correct. If we don't do that, we might end up getting the wrong initial conditions. For example, if the initial voltage was -1100v instead of -1200v, you would have had a hard time finding the right result graphically for the time value when vc=500v. It's better to do it in two steps unless you can be certain that the initial conditions will be the same with the -1200v pulse as they would with a constant -1200v for a very long time. 4 seconds is not a very long time.

So the second thing is, how did you determine that the -1200v pulse for 4 seconds would be enough. Why not 8 seconds, or 2 seconds, or 100 seconds? This is very important. It's the time when the initial conditions come to steady state.
This is something that did cross my mind- I assumed that if the voltage from t=0 to 4 was a flat line, then it should be the stable state that the problem intended. The time I picked was fairly arbitrary, and I think it happened to work out in this case. That being said, I do see that it's more rigorous to have ran a simulation just for the initial conditions first.

If you are doing something in which an "error" that amounts to a single pixel in the displayed waveform is a waveform of a single pixel on is important, then you are virtually guaranteed to be doing something very wrong to the extent that your conclusions, good or bad, hold very little, if any, weight.

Remember that simulations are only an approximation to the actual circuit's behavior. For a very long time, SPICE engines weren't charge-conserving. Even today, they are only charge-conserving if the device models used are compatible with that mode, and many legacy or simple models are not.
Could you elaborate on this first sentence? Why would a small important error in the precision of the graph cause our conclusions to be weightless?

Thank you to all those who've replied, not only for helping work through this problem, but also for pointing out the importance of running multiple simulations!
 

WBahn

Joined Mar 31, 2012
32,702
Could you elaborate on this first sentence? Why would a small important error in the precision of the graph cause our conclusions to be weightless?
Let's say that your graph axis covers a vertical span of 10 V and it is displayed over a vertical span of 1000 pixels. Each pixel represents 10 mV.

Now let's say that you are given a bunch of (x,y) data points to plot on a graph. Your graph paper is a set of grid points (e.g., pixels on a screen), but your (x,y) values are, in general, not multiples of the grid spacing. This means that you have to determine the closest pixel location for each data point using some algorithm, which may or may not take into account nearby values so as to perform interpretation of some kind.

Now let's say that you need to know what the value of the waveform is at a particular time and if it is more than 5 mV (i.e., a total error tolerance of one pixel) off from what it needs to be, that that is too much error.

Can you really have any confidence that if the waveform at that time is at the desired pixel, that it really is within the required range? By the same token, if it is one pixel either side of the desired output, can you really have confidence that there really is too much error?

If your results are displayed such that a single pixel shift of the waveform is important, then you have done a poor job of either setting up the simulation or of displaying the results.

And it's not just a matter of zooming in on waveform, either. Simulations are approximations. Before you start putting a lot of credence in the values assuming that they are both very accurate and precise, you need to establish just how accurate and precise that values can reasonably be assumed to be.
 

Thread Starter

itsamiracle

Joined Mar 16, 2026
4
Let's say that your graph axis covers a vertical span of 10 V and it is displayed over a vertical span of 1000 pixels. Each pixel represents 10 mV.

Now let's say that you are given a bunch of (x,y) data points to plot on a graph. Your graph paper is a set of grid points (e.g., pixels on a screen), but your (x,y) values are, in general, not multiples of the grid spacing. This means that you have to determine the closest pixel location for each data point using some algorithm, which may or may not take into account nearby values so as to perform interpretation of some kind.

Now let's say that you need to know what the value of the waveform is at a particular time and if it is more than 5 mV (i.e., a total error tolerance of one pixel) off from what it needs to be, that that is too much error.

Can you really have any confidence that if the waveform at that time is at the desired pixel, that it really is within the required range? By the same token, if it is one pixel either side of the desired output, can you really have confidence that there really is too much error?

If your results are displayed such that a single pixel shift of the waveform is important, then you have done a poor job of either setting up the simulation or of displaying the results.

And it's not just a matter of zooming in on waveform, either. Simulations are approximations. Before you start putting a lot of credence in the values assuming that they are both very accurate and precise, you need to establish just how accurate and precise that values can reasonably be assumed to be.
Thanks for the example, it helped clear this up. Needing the waveform to be exact to the pixel raises a lot of questions about the error tolerance/necessity of precision. I am curious though, is this issue more conceptual in nature or does it arise often in practice as well?


If you are doing something in which an "error" that amounts to a single pixel in the displayed waveform is a waveform of a single pixel on is important, then you are virtually guaranteed to be doing something very wrong to the extent that your conclusions, good or bad, hold very little, if any, weight.

Remember that simulations are only an approximation to the actual circuit's behavior. For a very long time, SPICE engines weren't charge-conserving. Even today, they are only charge-conserving if the device models used are compatible with that mode, and many legacy or simple models are not.
Okay, so the "something very wrong" here is an issue with the simulation, not with the theoretical solution?
 

MrAl

Joined Jun 17, 2014
13,667
[A.]
This is something that did cross my mind- I assumed that if the voltage from t=0 to 4 was a flat line, then it should be the stable state that the problem intended. The time I picked was fairly arbitrary, and I think it happened to work out in this case. That being said, I do see that it's more rigorous to have ran a simulation just for the initial conditions first.

[B.]
Could you elaborate on this first sentence? Why would a small important error in the precision of the graph cause our conclusions to be weightless?
[Somehow this reply came in all bold chars]

Hello again,

[A.]
Yes, and you know from your hand calculation that the time constant is 15 seconds, and you also know that the final values is within 1 percent with 5 time constants which would be 75 seconds, so if you ran the -1200v input for 75 seconds you should be close to a good approximation of the final value, which is the initial value of the transient part of the problem with +1200v.
The rule is:
5 time constants: better than 1 percent (0.01)
6 time constants: better than 0.3 percent (0.003)
7 time constants: better than 0.1 percent (0.001)
or use:
TC=floor(-ln(pc)+err)
where pc is the fractional percent value you'd like to use, and err can be 0.50 to 0.99 depending on how close you want to be to the right integer value for the time constant TC.

[B.]
Graphical representations are always approximations. If we have straight line graph that runs from y=0 to 10 for x=0 to 10, for x(1) we might see y=1.1, 1.01,1.001, etc., with the raw calculation. If that small amount matters, then you have to pay attention to it.

In a lot of cases you can zoom in, but then you have to make sure the step size is small enough to support the extra resolution. The way we do it with differential equation solvers is we either use a higher order calculation, or we go to a half-step size. If the step size is 1ms then we note the result at the point in time we are looking at, then decrease the step size to 0.5ms and check at the same point in time. If the result did not change much when we went from 1ms to 0.5ms then we have some idea if the result is decent enough. If still not sure, decrease to 0.25ms and repeat.
In some cases this may trigger a "step size too small" error and then we have to try going up a little like to 0.30ma and try again, or find another way to get higher resolution. In most cases I've done this with, the zoom function works pretty good as long as we have enough steps over the period of interest. I've matched hand calculations to very high precision in the past, to many digits in some cases, which makes me more confident that the result I am looking at is correct. Since you have the equation you need (your math result expression) you can check that easily.
 

MrAl

Joined Jun 17, 2014
13,667
If you are doing something in which an "error" that amounts to a single pixel in the displayed waveform is a waveform of a single pixel on is important, then you are virtually guaranteed to be doing something very wrong to the extent that your conclusions, good or bad, hold very little, if any, weight.
Hello,

Yes, that is what I was pointing out.
 
Top