# First-order differential equation without using a Thevenin (or Norton) equivalent circuit

$$\frac{V_c-V_2} {R_2} + C \cdot \frac{dV_c}{dt} + \frac{V_c} {R_3} = \frac{V_1-V_c}{R_1}$$ $$V_c(0) = V_2$$

I have tried to solve this with the help of MATLAB, but the answer from the book is apparently different from my answer. What's wrong with my differential equation?

Here is the answer from the book.

$$v_C(t) = Ke^{−t/\tau} + \tau f (t)$$ $$v_C(0) = Ke^0 + V_T$$ $$K = v_C(0) − V_T = V_2 − V_T$$ $$v_C(t) = (V_2 − V_T )e^{−t/R_T C} + V_T$$

• I can't speak for how you used matlab, but your initial statement is correct and your initial conditions are also correct. I started here: $\frac{V_c}{R_1}+\frac{V_c}{R_2}+\frac{V_c}{R_3}+C\frac{\text{d}}{\text{d}t}V_c=\frac{V_1}{R_1}+\frac{V_2}{R_2}$ and reached yours without trouble.
– jonk
Sep 11, 2022 at 18:07
• Show us how you tried to solve the equation, and what you got as a result. Also tell us what you believe is the correct solution. Sep 11, 2022 at 18:09
• Kile, you also should be able to solve this using a variety of different techniques for the solution of 1st order diff-eq. For example, using methods such as these: integrating factor or variation of parameters. If you are not able to independently solve these kinds of problems without the use of Matlab then that's a problem you need to work on. Being crippled by a dependence upon tools you little understand isn't a good thing. It's about as bad is depending upon a calculator to perform addition and subtraction and not being able to do a simple problem of either, yourself.
– jonk
Sep 11, 2022 at 18:20
• Hi Kile: Matlab often provide solutions in strange forms. It may just look different from the book. Both may be correct. Perhaps all you need to do is manipulate the Matlab output to match the book. Sep 11, 2022 at 19:09
• @kile It was more of a worry I was feeling, than advice. I'd like to see you write out a solution using an integrating factor and your known initial conditions or else using variation of parameters to work this out by hand. You should be able to achieve that. And if so, you will know who is right and who is wrong -- matlab or your book. (You've disclosed neither to us.) You correctly laid out the differential KCL and initial conditions. And I think that's the good news. I'm very glad you performed that so well. But it is the rest that I'm worried about, now. Can you solve this by hand? Or not?
– jonk
Sep 12, 2022 at 4:48

What's wrong with my differential equation?

Unless EE&O. Best use of EET & FACTS...

You just have to do:

Nothing seems wrong with your equation.

When I have a doubt, I do always, if possible at least, two "checkings".
One is easy. Simulation. microcap v12.
The other is a calculation with something like a Maple sheet.

What "solution" was found in the book? Can you compare "result" numerically with this?

I did the simulation. The switch is closed at 10 ms until 20 ms.

And here is the result of the calculation with OP equation ...
Exactly the same behavior. So, until the "book equation" is known ...

• Who downvoted, not very constructive ... has the answer of the book? Nor in OP question ... Sep 12, 2022 at 12:49