Given an RC circuit that is charged from a battery when a switch is closed, we have the following equation:
eqn1 = (Vb - Vc[t])/R == C Vc'[t]
Given R = 5kOhm, C = 10uF, we get a family of equations that show that the capacitor either charges/discharges to a steady state value determined by the battery voltage.
genSol = DSolve[eqn1, Vc[t], t]
familyOfSolns = Table[genSol /. C[_] -> i, {i, -10, 10, 1}] // Flatten
(*Plot family of Solns given particular values for R,C, and Vb*)
rule1 = {Vb -> 9, R -> 5000, C -> .00001};
\[Tau] = rule1[[2, 2]]*rule1[[3, 2]];
#[[2]] /. rule1 & /@ familyOfSolns
Plot[#[[2]] /. rule1 & /@ familyOfSolns, {t, 0, 3*\[Tau]}, PlotRange -> All]
This makes complete sense to me, until I look at the Direction Field in the same range of time (t=0 to 150ms):
streamPlotEqn = Flatten[Solve[eqn1, Vc'[t]]][[1, 2]] /. rule1; StreamPlot[{t,
streamPlotEqn}, {t, 0,.15}, {Vc[t], 0, 20}, StreamPoints -> Fine]
I was expecting to see a bunch of stream lines where you could imagine the solutions plotted above fitting in between. Ultimately, I would like to take these two plots and combine them to show that the actual solutions do fit nicely together in the direction field.
What am I missing?
After modifying the direction field per @Rahul's comment, I found that, although sparse, the direction field matched as expected:






{1, streamPlotEqn}because the two components are $\mathrm dt/\mathrm dt$ and $\mathrm dV_c/\mathrm dt$. – Jan 01 '17 at 22:58