I've made a spice netlist of a circuit I am designing. The input to the circuit is an AC signal source --> v1 1 0 dc 0 sin(0 34 60). Well I can do a transient analysis on this easily. But I also want to see what happens at the output as I vary the frequency of the AC signal source. Unfortunately using .AC simply doesnt work (to vary the frequency). I suspect that I defined my signal source incorrectly to be used with .AC.
Replace the variable in question with {AC}
Not .AC
.AC is the spice directive for AC measurement. If it doesn't have a value with {AC} in it in the circuit it has nothing to vary. From what little I know only voltage/current sources can be asigned {AC} Voltage/frequency/current
I've made a spice netlist of a circuit I am designing. The input to the circuit is an AC signal source --> v1 1 0 dc 0 sin(0 34 60). Well I can do a transient analysis on this easily. But I also want to see what happens at the output as I vary the frequency of the AC signal source. Unfortunately using .AC simply doesnt work (to vary the frequency). I suspect that I defined my signal source incorrectly to be used with .AC.
The .AC directive tells the simulator to perform an ac analysis in a frequency interval you have to specify. For example: .AC DEC 101 1 100k for the interval [1Hz, 100kHz].
You need to define an AC source, for example V1 1 0 DC 0 AC 1
By the way, which program are you using? if you get LTSpice from linear.com you can enter those parameters without editing the netlist manually.
Replace the variable in question with {AC}
Not .AC
.AC is the spice directive for AC measurement. If it doesn't have a value with {AC} in it in the circuit it has nothing to vary. From what little I know only voltage/current sources can be asigned {AC} Voltage/frequency/current
I'm a little comfused when you say "Replace the variable in question with {AC}". Does this mean I have to add an AC component to v1?
The .AC directive tells the simulator to perform an ac analysis in a frequency interval you have to specify. For example: .AC DEC 101 1 100k for the interval [1Hz, 100kHz].
You need to define an AC source, for example V1 1 0 DC 0 AC 1
By the way, which program are you using? if you get LTSpice from linear.com you can enter those parameters without editing the netlist manually.
I'm using spice opus. So I see that I dont have a source defined with AC. Is there a simple way to fix "v1 1 0 dc 0 sin(0 34 60)" while retaining the initial frequency and amplitude?
I'm a little comfused when you say "Replace the variable in question with {AC}". Does this mean I have to add an AC component to v1?
I'm using spice opus. So I see that I dont have a source defined with AC. Is there a simple way to fix "v1 1 0 dc 0 sin(0 34 60)" while retaining the initial frequency and amplitude?
Watch out for the difference between, peak, peak to peak and RMS voltage. SPICE uses peak voltage, if you want RMS then multiply it by √2, if you want peak to peak then multiply it by 2.
Watch out for the difference between, peak, peak to peak and RMS voltage. SPICE uses peak voltage, if you want RMS then multiply it by √2, if you want peak to peak then multiply it by 2.
I sure did. I get in excess of 6000v (which is absolutely not right) when I vary the freq using .AC . I get the same output with or without AC 1 added to my source.
Code:
PowerSupply
[b]v1 4 5 sin(0 34 60) AC 1[/b]
D1 4 2 1N4007
D2 0 5 1N4007
D3 5 2 1N4007
D4 0 4 1N4007
c1 2 0 1000u
c2 2 0 100n
cout out 0 100n
radj adj 0 5k
r1 out adj 240
x 2 adj out LM317
.include parts.lib
.control
set units=degree
destroy all
tran 0.01ms 100ms
plot v(4,5) v(out) vs (time*1000)
[b]destroy all
ac dec 10 60Hz 7000Hz
plot ac1.v(out) vs ac1.frequency[/b]
.endc
.end
If you want to simulate line rejection, get rid of the bridge and replace it with a battery of whatever DC value you want, with an AC source "in series".
v1 2 0 DC 32 AC 1
Run an AC sim (AC dec 100 10 10k).
If you want to simulate line rejection, get rid of the bridge and replace it with a battery of whatever DC value you want, with an AC source "in series".
v1 2 0 DC 32 AC 1
Run an AC sim (AC dec 100 10 10k).