saving . . . saved
How to plot voltage Vs current through a diode (Diode chara.)

I have created a circuit which contains a dc voltage source, a resistor and a diode all connected in series. The negative terminal of the source as well as the n terminal of the diode are grounded. I want to plot the voltage across the diode Vs the current through it. How can I do that?

eSim 23-10-15, 11:21 a.m. kavyamanohar




To plot voltage vs current, you can use following command in ngspice terminal-

plot v(node name) vs i(branch current)

eg: plot v(out) vs i(v_iout1)

For more ngspice commands go to this link -

23-10-15, 11:31 a.m. Gaurav_Supal

Sorry it did not help me to plot the expected diode characteristics.
In the circuit mentioned above, while going through the step of Kicad to Ngspice convertion I chose the analysis type as DC, where I have varied the source voltage from 0 to 5 volts in steps of 0.1 volts. It then asks for the parameter values under the heading Source Details. What specific value is being expected there, as the source is a variable one? I left that cell blank during conversion. Might that be the issue?

23-10-15, 11:44 a.m. kavyamanohar

Login to add comment



can you send me that example, so i can check that issue.

23-10-15, 11:49 a.m. Gaurav_Supal

I am sending the project file with schematic diagram to

23-10-15, 12:09 p.m. kavyamanohar


23-10-15, 12:12 p.m. Gaurav_Supal

Login to add comment



You have to give some source details value, if you keep blank then it takes as 0v dc source. You also have to use proper diode model to get expected values. I have tried your example it gives me linear graph using diode model D1N750.

23-10-15, 12:28 p.m. Gaurav_Supal

Should I create/add new diode model for that?

24-10-15, 9:39 a.m. kavyamanohar

You can try by adding new diode model.

24-10-15, 10:22 a.m. Gaurav_Supal

Login to add comment


It is very easy to draw the 2D plot. There are simple commands for this purpose.
You have to use the plot command and the your variable in the braces with this.
In one plot command mention the both variables which are voltage and current in your case.
In those variables you must store the same length of the values for two dimension plot.

05-11-15, 10:56 p.m. NoemiRuan

Log-in to answer to this question.