Equations:

dVc/dt=(-1/C)*Il+(1/C)Is

dIl/dt=(1/L)*Vc-(R/L)*Il

I have been given the values of L=1e-3, R=50, Is=10.0A and C is to be designed by trial and error.

I have been able to write out the function, by assigning Vc=x(1) and Il=x(2), and then I wrote dxdt= [dVc/dt;dIl/dt];

But when I have my script, I'm having trouble in how to define the initial conditions. The task says that all currents and voltages are zero at the beginning and I have therefore written that x1=0 and x2=0.

However, when I plot the result, the current value is way lower than what is expected.

I suspect there is a problem in the way I am defining the initial conditions.

Any help would be greatly appreciated.