I am unable to plot the solution to this differential equation in Mathematica representing the current in a RLC circuit with a sinusoidal input.
L*y''[t] == -R*y'[t] - C*y[t];
(*V\[Equal]Sin[t];*)
soln = DSolve[{L*y''[t] == -R*y'[t] - C*y[t], y[0] == 0, y'[0] == V},
y[t], t][[1]] // Simplify;
With[{expr = y[t] /. soln},
Manipulate[
Plot[expr, {t, 0, 2*Pi},
PlotRange -> {{0, 10}, {-5, 5}}], {{L, 1*^-3}, 0,
10*^-3}, {{R, 3*^3}, 1*^3, 10*^3}, {{C, 3*^5}, 0, 10*^5}, {{V, 5},
0, 10}]]
I think my problem is either in defining my Differential equation or plotting. Any ideas?
Plot
to work I try substitutingTable
. ThisManipulate[ expr=y[t]/. DSolve[{L*y''[t]==-R*y'[t]-C*y[t], y[0]==0, y'[0]==V}, y[t], t][[1]]; Table[N[expr], {t,0,10}], {{L,1*^-3},0,10*^-3}, {{R,3*^3},1*^3,10*^3}, {{C,3*^5},0,10*^5}, {{V,5},0,10}]
might let you know why yourPlotRange->{{0,10},{-5,5}}]
isn't showing you anything. $\endgroup$