This example refers to a RLC low passive filter, where the input is represented by the voltage drop “V_in” while the output “V_out” is voltage across the resistor.

// Problem data
A = 1.0;
f = 1e+4;
R = 10;        // Resistor	[Ohm]
L = 1e-3;    // Inductor [H]
C = 1e-6;    // Capacitor [F]

// Problem  function
function zdot=RLCsystem(t, y)
    z1 = y(1);
    z2 = y(2);
    // Compute input
    Vin = A*sin(2*%pi*f*t);
    zdot(1) = z2;
    zdot(2) = (Vin - z1 - L*z2/R) /(L*C);
endfunction

// Simulation time [1 ms]
t = linspace(0,1e-3,1001);

// Initial conditions
y0 = [0;0]; t0 = t(1);

// Solving ode system
y = ode(y0,t0,t,RLCsystem);

// Plotting results
Vin = A*sin(2*%pi*f*t)';

// Plot data
scf(1); clf(1);
plot(t,[y(1,:)',Vin]);
legend(["Vout";"Vin"]);

Read the tutorial on scilab.io