sinusoidal current source in SPICE?

Thread Starter

MattCarp

Joined Mar 21, 2009
3
I was working on a drill problem and wanted to check my answer with SPICE, but I had a hard time determining what the SPICE code would be for a sinusoidal current source: 3 sin (2t - 60) (the "60" phase angle is in degrees and ω=2)

Any ideas?

Then for the analysis, I wouldn't have to sweep AC would I? Wouldn't this be sufficient:

.AC LIN 1 0.3183 0.3183

(of course, where freq = ω / 2 π = 0.3183 Hz)

Thanks.
 

Thread Starter

MattCarp

Joined Mar 21, 2009
3
ok,

I was able to find a better manual online. Here's the syntax for a current source:

I{name} {+node} {-node} [[DC] {value}] [AC {mag} [{phase}]]

So, in my example, the source would be

I1 1 2 AC 3 -60

Then I'd need an analysis statement with the frequency!

.AC LIN 1 0.318 0.318

all better now!
 
Top