My question is specifically linked to an exam problem where I had to find a function in terms of time for the current on a capacitor and a resistor. The circuit was very simple: A current time-variant current source in series with 2 subcircuits, each composed of a capacitor and a resistor connected in parallel. Please see the figure below:
So, if I want to simulate this circuit with a SPICE software, should I run a transient analysis, a DC linear analysis, or some other type of analysis?
If the current source was sinusoidal, I would use an AC analysis, but the current source runs a current numerically equivalent to t (in Amperes) where t is the time (in seconds) elapsed since the circuit started working.
Below I have written my netlist file. While it is not a valid SPICE netlist, it illustrates what I am trying to do, focus on the current source Iin:
CIRCUIT ANALYSIS
C2 0 2 20m
R2 0 2 3
Iin 0 1 {time}
R1 1 2 2
C1 1 2 50m
.TRAN 1us 100ms
.CONTROL
RUN
PLOT V(1)-V(2)
.ENDC
.END
If you tried to simulate this netlist, you would receive an error similar to the following (which I obtained using ngspice):
Original line no.: 4, new internal line no.: 5:
Undefined number [TIME]
Original line no.: 4, new internal line no.: 5:
Cannot compute substitute
Copies=9 Evals=9 Placeholders=1 Symbols=0 Errors=2
How can I achieve this type of analysis?