RC Circuit with Ramp Up I am trying to calculate the inrush current into an RC circuit
With A DC input (step response) its pretty trivial
$V_{in}=R i(t)+ \frac{1}{C} \int i(t)dt$
$0=R \frac{di(t)}{dt}+ \frac{1}{C} i(t)$
Integrating factor $= e^{t/RC}$
(overkill using an IF I agree but I like the IF method as it holds for many ODE's)
$0=\frac{di(t)}{dt} e^{t/RC}+\frac{1}{RC} i(t) e^{t/RC}$
$i(t)=A e^{−t/RC}$
(A is constant of integration)
Now here's the thing, we need the initial condition to calculate A
I can compute with a step response so that when t=0, $I=V/R$
To arrive at
$i(t)=V/R e^{−t/RC}$
This isn't very realistic, its like the big bang! (everything sprang into existence in an instant!)
What I would like to do is add a risetime, so that when t=0
then $i=0$
I am unsure how to go about this but lets say we had a ramp up of the input (I would like this to be a variable) of 1 us until peak so the input is a straight line $\frac{Vpeak}{risetime}t$
Do I simply solve the equation again and add the two solutions together?, I believe I could do that
 A: Still stuck!
I can solve the simple RC as above
I then try and solve the same equation with a forcing function given by
F(t) = (Vpeak/risetime)*t
This looks like 
dy/dt + Py = Q
P =1/RC, Q = (1/R)*(Vpeak/risetime)
So that
y = C*(Vpeak/risetime)
Which is a contsatnt
I dont think this is right as Q is a constant not really a function of time
I dont even know if I am doing this the right way, can I just add the two solutions together?, I am doubting this method
A: The intuitive answer is that the response time of the circuit is $1/(RC)$  If your voltage ramp is fast compared to that, it might as well be a step function.  The voltage will get to maximum before the capacitor is charged significantly, and the inrush current will be $V/R$ as you calculated for a step.  If the ramp is slow compared to that, the capacitor will follow the ramp and the inrush current will be (almost) zero.  The only hard case is when the ramp time is about equal to $1/(RC)$.  
If your input voltage is a ramping power supply, so not dependent on the current drawn, we can just differentiate your initial equation.
$$V_{in}=R i(t)+ \frac{1}{C} \int i(t)dt\\
\dot {V_{in}}=R\frac {di}{dt}+\frac 1Ci$$
where $\dot {V_{in}}$ is a constant and this is an inhomogeneous differential equation that you can solve.  Once the voltage ramps up the left side becomes zero and you have the equation you have already solved.  The inrush will be somewhat attenuated because $C$ is charging as $V$ is rising.  You don't add the two solutions together, you put one after the other.  This equation applies during the ramp, then the one with $\dot{V_{in}}=0$ applies afterward.  After the ramp you have exponential decay of the input current with time constant $1/(RC)$.  You just start with a smaller input current because the charge on the capacitor is greater than zero. 
