Solving an RC circuit using explicit euler

In summary, the conversation discusses using the Explicit Euler method to solve a simple RC circuit with a battery voltage of 10 V, R = 1 Ω, C = 1 F and a switch. The individual attempts to rewrite the circuit into a form that can be checked for stability, and a discussion ensues about the difference between a stable and good solution. The conversation also mentions the availability of an analytical solution and the wide gap between a "good" Δt and the instability criterion. Finally, there is a mention of an integrator program that may be used for solving the circuit.
  • #1
yugeci
61
0

Homework Statement



Hi there. I have a simple RC circuit with a battery voltage of 10 V, R = 1 Ω, C = 1 F and a switch. I want to use the Explicit Euler (forward divided difference) to solve the equation and check for stability, rather than using a ODE. I am finding the equation for when the capacitor is fully charged and then the battery removed, standard situation etc.

Homework Equations



C. dv/dt + V(t)/R = 0 (loop equation for the circuit)

The Attempt at a Solution


[/B]
The first thing I attempted to do was rewrite / rearrange the circuit in the form v(tnew) = v(told)(1 + a.Δt)n then check what value of t the equation would be unstable for.

dv/dt + V(t)/RC = 0

Rewriting dv/dt as (Vf - Vi)/Δt,

(Vf - Vi)/t + V(t)/RC = 0
... leads to

Vf = Vi - Δt/RC
Vf = Vi(1 - Δt/RC) ----- equation 1

So a = -1/RC = -1, giving

v(t) = Vi(1 - Δt)
v(t) = 10(1 - Δt)

For v(t) to be unstable, |1 - Δt| > 1 ∴ t should be 2sec or more.

However, logically speaking shouldn't the equation be unstable at values of t > 1 sec. Because if you plug Δt = 1 sec, the final voltage is always 0. Where have I made a mistake?
 
Physics news on Phys.org
  • #2
You mix up stable and good. Δt = 1 sec gives a stable solution all right !
 
  • Like
Likes yugeci
  • #3
OK for t = 1 sec, V is constantly zero which is still OK I guess, but for t = 1.1 sec, equation 1 gives -1V. This shouldn't be possible?
 
  • #4
What you mean is: that isn't good. But it is still stable: V does not exceed any bound for growing t.
[Iedit] I should correct that: the error does not exceed any bound.
 
  • Like
Likes yugeci
  • #5
So unstable would be if the final voltage kept increasing at some exponential rate, much higher than the original value of 10 V?
 
  • #6
Yes. Unstable is when the error can exceed any fixed bound. Doesn't have to be exponential.
 
  • Like
Likes yugeci
  • #7
Alright. Thank you so much for the quick response. :)
 
  • #8
Note that your differential equation has a very decently behaving analytical solution.Perhaps that's why the gap between a 'good' Δt (*) and the unstability criterion is rather wide.
[edit] I think that I have to withdraw that. No basis for such a statement, I suppose

(*) Just play around with excel and check that a 1 mV upper bound on the error requires Δt < 0.5 msec or thereabouts

PS I suppose with "a ODE" you mean some wrapped integrator that comes with your program ? (Not shrink wrapped, because then you might see that it could well be an explicit Euler too... :smile: )
 

1. What is an RC circuit?

An RC circuit is an electrical circuit made up of a resistor (R) and a capacitor (C) connected in series. It is commonly used in electronic devices to control the flow of electric current.

2. How does explicit Euler method work in solving an RC circuit?

The explicit Euler method is a numerical technique used to solve differential equations, such as those found in RC circuits. It involves approximating the solution at a future time by using the current solution and the derivative at that time. This process is repeated iteratively until the desired time is reached.

3. What are the advantages of using explicit Euler method in solving an RC circuit?

One advantage of using explicit Euler method is that it is relatively simple and easy to implement. It also provides a good estimation of the solution for a wide range of time steps. However, it may not be as accurate as other numerical methods and can be unstable for certain types of circuits.

4. Are there any limitations to using explicit Euler method in solving an RC circuit?

Yes, there are some limitations to using explicit Euler method. It may not give accurate results for complex circuits or for large time steps. It also has a tendency to accumulate errors over time, which can lead to inaccurate solutions.

5. Can explicit Euler method be used to solve other types of circuits?

Yes, explicit Euler method can be used to solve other types of circuits, such as RL (resistor-inductor) and RLC (resistor-inductor-capacitor) circuits. It is a general numerical method that can be applied to a wide range of differential equations.

Similar threads

  • Introductory Physics Homework Help
Replies
2
Views
812
Replies
19
Views
3K
  • Introductory Physics Homework Help
Replies
3
Views
1K
  • Introductory Physics Homework Help
Replies
4
Views
1K
  • Introductory Physics Homework Help
Replies
5
Views
6K
  • Introductory Physics Homework Help
Replies
9
Views
3K
  • Introductory Physics Homework Help
Replies
4
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
581
  • Introductory Physics Homework Help
Replies
9
Views
1K
  • Introductory Physics Homework Help
Replies
20
Views
3K
Back
Top