Hello all, Hope everyone here is well I have a basic doubt from xschem can anyone suggest me that ...
v
Hello all, Hope everyone here is well I have a basic doubt from xschem can anyone suggest me that how can I give the sine input voltage source in xschem circuit ?
s
Here it is. Use the standard
vsource.sym
. In case of expressions with spaces use quotes:
value="sin(....)"
šŸ‘ 1
v
IMG_20230307_180050.jpg
But in mine sine wave is not coming it's showing waveform like this as I am trying to running the opamp as a comparator but it's not showing sine waveform . It's showing waveform only straight line
@Stefan Schippers sir can you please suggest me the problem and solution that's why the sine waveform is not coming ?
j
Isn't the third parameter the frequency? You seem to have 0.1mHz, which would have one cycle every 100 seconds
v
It's still not working , it's still showing the same waveform that is that straight line . How to solve it now ?
4.1.2
v
Tried this one also, as given in the ngspice manual but it's still showing that same waveform of straight line
s
Use only 4 parameters in the sin function: Offset, Amplitude, Frequency, Delay:
value="sin(0.9 0.9 100MEG 5n)"
In your last example the last parameter is a damping factor, which damps the voltage source to its offset value (0 in your case). A value of 1e10 damps the sine waveform to 0 within ~0.5ns
j
also, if you want to see a 100MHz sine wave it would be better to use ".tran 3n 10n" instead
or an even smaller time step than 3ns
but as Stefan said, if you don't damp it so quickly (it is a pulse lasting only a fraction of a cycle with your parameters) then even simulating a millisecond you would see something
s
@vanshika tanwar, @Jecel Assumpção Jr comment is also very important. If you want to see a 100MHz waveform you can not simulate 1ms with 3ms timestep (!) as suggested use
.tran 3n 10n
EDIT: use
.tran 3n 100n
so you see 10 cycles of your 100MHz waveform.
v
Thank you sir I have tried this and sine wave have come but now can you please tell me that sir , why my output is coming in negative ?
IMG_20230309_000015.jpg,IMG_20230309_000046.jpg
s
Please read the ngspice user manual. In the
sin(...)
function the first parameter is the offset. If you want a positive sine waveform you must add an offset value to make it all positive, like in:
sin(1.5 1.5 50MEG 0.5n)
Your
vss
node is also set to -1.8V This is certainly wrong.set the v3 voltage source to 0V
v
Ok sir šŸ‘
101 Views