Difference between revisions of "Ngspice/C2/Operating-point-analysis-in-NGspice/English-timed"
From Script | Spoken-Tutorial
PoojaMoolya (Talk | contribs) |
|||
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
{| border=1 | {| border=1 | ||
Line 11: | Line 6: | ||
|- | |- | ||
| 00:01 | | 00:01 | ||
− | | Dear Friends, Welcome to this spoken tutorial on “'''Operating point analysis'''" in | + | | Dear Friends, Welcome to this '''spoken tutorial''' on “'''Operating point analysis'''" in NGspice. |
+ | |||
|- | |- | ||
| 00:08 | | 00:08 | ||
− | | | + | | In this tutorial, we will learn: |
|- | |- | ||
− | | | + | | 00:10 |
− | | | + | | To perform '''operating point analysis''' |
|- | |- | ||
− | | | + | | 00:13 |
− | | To verify '''Kirchoff's | + | |To verify '''Kirchoff's voltage law''', using '''ngspice''' in-'''interactive mode command-line interface''' and '''commandscript''' included in netlist file. |
|- | |- | ||
| 00:24 | | 00:24 | ||
− | | '''Ubuntu''' | + | | '''Ubuntu 12.04''' is the '''operating system''' used with '''ngspice''' version 23 installed. |
|- | |- | ||
− | | | + | | 00:33 |
− | | | + | | Basic knowledge of '''electronic circuits''' is a prerequisite for this tutorial. |
|- | |- | ||
− | | | + | | 00:38 |
− | | Basic knowledge of '''Ubuntu | + | | Basic knowledge of '''Ubuntu Linux''' and '''shell commands''' is also required. |
|- | |- | ||
− | | | + | | 00:43 |
− | | | + | | We will use the example '''circuit''' shown. |
|- | |- | ||
− | | | + | | 00:47 |
− | | The | + | | The circuit consists of three prominent '''nodes'''- |
|- | |- | ||
| 00:52 | | 00:52 | ||
− | | | + | |'''a''', '''b''' |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
|- | |- | ||
− | | | + | | 00:55 |
− | | and | + | | and '''c'''. |
|- | |- | ||
| 00:57 | | 00:57 | ||
− | | In addition, a fourth '''node''' called as '''reference''' or the '''datum | + | | In addition, a fourth '''node''' called as '''reference''' or the '''datum node''' must be marked as node “0”. |
|- | |- | ||
− | | | + | | 01:06 |
− | | This is mandatory for any | + | | This is mandatory for any circuit. |
|- | |- | ||
− | | | + | | 01:09 |
− | | | + | | Let us open the '''ngspice netlist''' "example1.cir" file, corresponding to the '''circuit schematic''' shown before, in a '''text editor.''' |
|- | |- | ||
− | | | + | | 01:19 |
− | | I have already opened this in '''gedit''' '''text | + | | I have already opened this in '''gedit''' '''text editor.''' |
|- | |- | ||
− | | | + | | 01:27 |
− | | Note that the | + | | Note that the netlist file is saved with ".cir" '''extension'''. |
|- | |- | ||
| 01:32 | | 01:32 | ||
− | | We can see all the | + | | We can see all the components like '''voltage source, resistors''' and '''current source'''. |
|- | |- | ||
| 01:41 | | 01:41 | ||
− | | Also the information about | + | | Also, the information about nodes connecting them together. |
|- | |- | ||
| 01:46 | | 01:46 | ||
− | | ''' .op command''' included in | + | | ''' ".op" command''', included in netlist file, is used to perform '''operating point analysis'''. |
|- | |- | ||
| 01:54 | | 01:54 | ||
− | | Now we will '''simulate''' this | + | | Now we will '''simulate''' this circuit and verify '''Kirchoff's voltage law''' using the '''interactive mode-command-line interface.''' |
|- | |- | ||
| 02:02 | | 02:02 | ||
− | | | + | | Let us open '''ngspice''' through '''terminal.''' |
|- | |- | ||
| 02:06 | | 02:06 | ||
− | | Go to top left corner of '''Ubuntu | + | | Go to top left corner of '''Ubuntu''' desktop '''screen.''' |
|- | |- | ||
Line 106: | Line 98: | ||
|- | |- | ||
| 02:13 | | 02:13 | ||
− | | In the '''search bar,''' write '''terminal''' and press '''Enter.''' | + | | In the '''search bar,''' write "'''terminal'''" and press '''Enter.''' |
|- | |- | ||
| 02:22 | | 02:22 | ||
− | | This will open '''Terminal | + | | This will open '''Terminal window.''' |
|- | |- | ||
| 02:26 | | 02:26 | ||
− | | Let me resize this window | + | | Let me '''resize''' this window. |
|- | |- | ||
| 02:30 | | 02:30 | ||
− | | Now I will go to the | + | | Now, I will go to the folder where the netlist file "'''example1.cir'''" is saved. |
|- | |- | ||
Line 126: | Line 118: | ||
|- | |- | ||
| 02:40 | | 02:40 | ||
− | | On | + | | On terminal, I will type: '''cd space Desktop slash op hyphen analysis ''' and press '''Enter.''' |
|- | |- | ||
| 02:55 | | 02:55 | ||
− | | Now let us '''simulate''' the | + | | Now, let us '''simulate''' the ngspice file. |
|- | |- | ||
Line 138: | Line 130: | ||
|- | |- | ||
| 03:01 | | 03:01 | ||
− | | On | + | | On terminal, type: '''ngspice space example1.cir''' and press '''Enter.''' |
|- | |- | ||
| 03:17 | | 03:17 | ||
− | | Here you will notice that we have entered into the '''ngspice''' '''command | + | | Here, you will notice that we have entered into the '''ngspice''' '''command line interface'''. |
|- | |- | ||
| 03:23 | | 03:23 | ||
− | | Type | + | | Type: "run" and press '''Enter'''. |
|- | |- | ||
| 03:28 | | 03:28 | ||
− | | This will '''simulate''' the | + | | This will '''simulate''' the circuit and store the results. |
|- | |- | ||
Line 157: | Line 149: | ||
|- | |- | ||
− | | | + | | 03:39 |
− | | | + | | According to '''Kirchoff's voltage law,''' '''voltage''' around outer loop should be equal to the value of the '''dc voltage source V1'''. |
|- | |- | ||
− | | | + | | 03:51 |
− | | Calculate | + | | Calculate voltage around the outer '''loop.''' |
|- | |- | ||
− | | | + | | 03:54 |
| For this, let us do the following: | | For this, let us do the following: | ||
|- | |- | ||
− | | | + | | 03:59 |
− | | | + | | In the '''ngspice''' '''command line interface''', on the terminal, |
|- | |- | ||
− | | | + | | 04:03 |
− | | | + | | type: '''print space v of a comma b plus v of b comma c plus v of c''' and press '''Enter''' key. |
|- | |- | ||
− | | | + | | 04:21 |
− | | Here '''v of a comma b''' denotes the''' voltage drop''' between the | + | | Here, '''v of a comma b''' denotes the''' voltage drop''' between the nodes 'a' and 'b' and so on. |
|- | |- | ||
− | | | + | | 04:29 |
− | | '''print | + | | '''print''' command displays the results of the calculation mentioned to its right side. |
|- | |- | ||
− | | | + | | 04:36 |
− | | Notice the result of the | + | | Notice the result of the calculation on the terminal. |
|- | |- | ||
− | | | + | | 04:39 |
− | | It is 30 '''volt''' as shown | + | | It is 30 '''volt''' as shown. |
|- | |- | ||
− | | | + | | 04:42 |
− | | Now | + | | Now, calculate the value of '''DC voltage source V1''' that is v(a). |
|- | |- | ||
− | | | + | | 04:50 |
− | | Type '''print space v of a ''' and press '''Enter''' | + | | Type: '''print space v of a ''' and press '''Enter'''. |
|- | |- | ||
| 05:00 | | 05:00 | ||
− | | Notice the result of the | + | | Notice the result of the calculation on the terminal. |
|- | |- | ||
− | | | + | | 05:04 |
| If both the results are equal then '''Kirchoff's voltage law''' is verified. | | If both the results are equal then '''Kirchoff's voltage law''' is verified. | ||
|- | |- | ||
− | | | + | | 05:10 |
− | | | + | | Since both voltage values are equal, the '''Kirchhoff's Voltage law''' is verified for outer loop- a, b, c and 0. |
|- | |- | ||
| 05:21 | | 05:21 | ||
− | | Now we will '''simulate''' this | + | | Now, we will '''simulate''' this circuit and verify '''Kirchoff's voltage law''', using the '''command script''' included in the netlist file. |
|- | |- | ||
| 05:31 | | 05:31 | ||
− | | Modified | + | | Modified netlist file '''example hyphen modified dot cir''' is as shown. |
|- | |- | ||
| 05:40 | | 05:40 | ||
− | | As you can see all the | + | | As you can see, all the commands we executed in '''command-line interface''' are included in this '''netlist''' as '''control statements.''' |
|- | |- | ||
Line 230: | Line 222: | ||
|- | |- | ||
| 05:57 | | 05:57 | ||
− | | '''Echo''' command will '''echo''' the text written to its right side, on the '''terminal | + | | '''Echo''' command will '''echo''' the text written to its right side, on the '''terminal window.''' |
|- | |- | ||
Line 238: | Line 230: | ||
|- | |- | ||
| 06:10 | | 06:10 | ||
− | | Now we execute the modified '''netlist | + | | Now, we execute the modified '''netlist''' file. |
|- | |- | ||
| 06:14 | | 06:14 | ||
− | | '''source''' command is used to '''simulate''' the '''netlist''' from within the '''ngspice simulator environment''' | + | | '''source''' command is used to '''simulate''' the '''netlist''' from within the '''ngspice simulator environment'''. |
|- | |- | ||
| 06:22 | | 06:22 | ||
− | | On the | + | | On the terminal, type: '''source space example hyphen modified dot cir''' and press the'''Enter''' key. |
|- | |- | ||
| 06:37 | | 06:37 | ||
− | | This will run the '''simulation''' and directly show the results for '''KVL''' verification. | + | | This will '''run''' the '''simulation''' and directly show the results for '''KVL''' verification. |
|- | |- | ||
Line 266: | Line 258: | ||
|- | |- | ||
| 07:00 | | 07:00 | ||
− | | Now let us summarize what we learnt in this tutorial. | + | | Now, let us summarize what we learnt in this tutorial. |
|- | |- | ||
| 07:03 | | 07:03 | ||
− | | In this tutorial we learnt | + | | In this tutorial, we learnt- |
|- | |- | ||
Line 278: | Line 270: | ||
|- | |- | ||
| 07:09 | | 07:09 | ||
− | | To verify '''Kirchhoff's voltage law''' using '''ngspice''' through '''interactive mode-command line interface ''', ''' | + | | To verify '''Kirchhoff's voltage law''' using '''ngspice''' through '''interactive mode-command line interface ''', '''command script''' included in the '''netlist''' file. |
|- | |- | ||
| 07:20 | | 07:20 | ||
− | | Watch the video available at the following link | + | | Watch the video available at the following link. |
|- | |- | ||
| 07:24 | | 07:24 | ||
− | | It | + | | It summarizes the '''Spoken Tutorial''' project. |
|- | |- | ||
| 07:28 | | 07:28 | ||
− | | If you do not have good bandwidth, you can download and watch it | + | | If you do not have good bandwidth, you can download and watch it. |
|- | |- | ||
| 07:32 | | 07:32 | ||
− | | The Spoken Tutorial | + | | The Spoken Tutorial project team: |
|- | |- | ||
| 07:34 | | 07:34 | ||
− | | Conducts workshops using spoken tutorials | + | |Conducts workshops using spoken tutorials. |
|- | |- | ||
| 07:38 | | 07:38 | ||
− | | Gives certificates for those who pass an online test | + | | Gives certificates for those who pass an online test. |
|- | |- | ||
| 07:41 | | 07:41 | ||
− | | For more details, please write to '''contact at spoken hyphen tutorial dot org ''' | + | | For more details, please write to:'''contact at spoken hyphen tutorial dot org ''' |
|- | |- | ||
| 07:47 | | 07:47 | ||
− | | Spoken Tutorial Project is a part of the Talk to a Teacher project | + | | '''Spoken Tutorial''' Project is a part of the '''Talk to a Teacher''' project. |
|- | |- | ||
Line 318: | Line 310: | ||
|- | |- | ||
| 07:59 | | 07:59 | ||
− | | More information on this | + | | More information on this mission is available at: |
|- | |- | ||
| 08:02 | | 08:02 | ||
− | | spoken hyphen tutorial dot org slash NMEICT hyphen Intro | + | | '''spoken hyphen tutorial dot org slash NMEICT hyphen Intro'''. |
|- | |- | ||
Line 334: | Line 326: | ||
|- | |- | ||
| 08:13 | | 08:13 | ||
− | | This script is contributed by Abhishek Pawar and this is Rupak Rokade from IIT Bombay signing off. | + | | This script is contributed by Abhishek Pawar and this is Rupak Rokade from '''IIT Bombay''', signing off. |
|- | |- |
Latest revision as of 14:41, 10 March 2017
Time | Narration |
00:01 | Dear Friends, Welcome to this spoken tutorial on “Operating point analysis" in NGspice. |
00:08 | In this tutorial, we will learn: |
00:10 | To perform operating point analysis |
00:13 | To verify Kirchoff's voltage law, using ngspice in-interactive mode command-line interface and commandscript included in netlist file. |
00:24 | Ubuntu 12.04 is the operating system used with ngspice version 23 installed. |
00:33 | Basic knowledge of electronic circuits is a prerequisite for this tutorial. |
00:38 | Basic knowledge of Ubuntu Linux and shell commands is also required. |
00:43 | We will use the example circuit shown. |
00:47 | The circuit consists of three prominent nodes- |
00:52 | a, b |
00:55 | and c. |
00:57 | In addition, a fourth node called as reference or the datum node must be marked as node “0”. |
01:06 | This is mandatory for any circuit. |
01:09 | Let us open the ngspice netlist "example1.cir" file, corresponding to the circuit schematic shown before, in a text editor. |
01:19 | I have already opened this in gedit text editor. |
01:27 | Note that the netlist file is saved with ".cir" extension. |
01:32 | We can see all the components like voltage source, resistors and current source. |
01:41 | Also, the information about nodes connecting them together. |
01:46 | ".op" command, included in netlist file, is used to perform operating point analysis. |
01:54 | Now we will simulate this circuit and verify Kirchoff's voltage law using the interactive mode-command-line interface. |
02:02 | Let us open ngspice through terminal. |
02:06 | Go to top left corner of Ubuntu desktop screen. |
02:10 | Click on theDash home. |
02:13 | In the search bar, write "terminal" and press Enter. |
02:22 | This will open Terminal window. |
02:26 | Let me resize this window. |
02:30 | Now, I will go to the folder where the netlist file "example1.cir" is saved. |
02:38 | I do this as follows: |
02:40 | On terminal, I will type: cd space Desktop slash op hyphen analysis and press Enter. |
02:55 | Now, let us simulate the ngspice file. |
02:59 | Let us see how this can be done. |
03:01 | On terminal, type: ngspice space example1.cir and press Enter. |
03:17 | Here, you will notice that we have entered into the ngspice command line interface. |
03:23 | Type: "run" and press Enter. |
03:28 | This will simulate the circuit and store the results. |
03:33 | We will verify Kirchoff's voltage law using the above simulation results. |
03:39 | According to Kirchoff's voltage law, voltage around outer loop should be equal to the value of the dc voltage source V1. |
03:51 | Calculate voltage around the outer loop. |
03:54 | For this, let us do the following: |
03:59 | In the ngspice command line interface, on the terminal, |
04:03 | type: print space v of a comma b plus v of b comma c plus v of c and press Enter key. |
04:21 | Here, v of a comma b denotes the voltage drop between the nodes 'a' and 'b' and so on. |
04:29 | print command displays the results of the calculation mentioned to its right side. |
04:36 | Notice the result of the calculation on the terminal. |
04:39 | It is 30 volt as shown. |
04:42 | Now, calculate the value of DC voltage source V1 that is v(a). |
04:50 | Type: print space v of a and press Enter. |
05:00 | Notice the result of the calculation on the terminal. |
05:04 | If both the results are equal then Kirchoff's voltage law is verified. |
05:10 | Since both voltage values are equal, the Kirchhoff's Voltage law is verified for outer loop- a, b, c and 0. |
05:21 | Now, we will simulate this circuit and verify Kirchoff's voltage law, using the command script included in the netlist file. |
05:31 | Modified netlist file example hyphen modified dot cir is as shown. |
05:40 | As you can see, all the commands we executed in command-line interface are included in this netlist as control statements. |
05:50 | That is, the statements in between the dot control and the dot endc statements. |
05:57 | Echo command will echo the text written to its right side, on the terminal window. |
06:04 | You can see that we have included the print statements in the netlist. |
06:10 | Now, we execute the modified netlist file. |
06:14 | source command is used to simulate the netlist from within the ngspice simulator environment. |
06:22 | On the terminal, type: source space example hyphen modified dot cir and press theEnter key. |
06:37 | This will run the simulation and directly show the results for KVL verification. |
06:43 | You can see that results are the same as seen earlier. |
06:48 | This brings us to the end of this tutorial. |
06:52 | Quit the ngspice simulator by typing quit and press the Enter key. |
07:00 | Now, let us summarize what we learnt in this tutorial. |
07:03 | In this tutorial, we learnt- |
07:05 | To perform operating point analysis of a given circuit. |
07:09 | To verify Kirchhoff's voltage law using ngspice through interactive mode-command line interface , command script included in the netlist file. |
07:20 | Watch the video available at the following link. |
07:24 | It summarizes the Spoken Tutorial project. |
07:28 | If you do not have good bandwidth, you can download and watch it. |
07:32 | The Spoken Tutorial project team: |
07:34 | Conducts workshops using spoken tutorials. |
07:38 | Gives certificates for those who pass an online test. |
07:41 | For more details, please write to:contact at spoken hyphen tutorial dot org |
07:47 | Spoken Tutorial Project is a part of the Talk to a Teacher project. |
07:52 | It is supported by the National Mission on Education through ICT, MHRD, Government of India. |
07:59 | More information on this mission is available at: |
08:02 | spoken hyphen tutorial dot org slash NMEICT hyphen Intro. |
08:09 | Thank you for joining. |
08:11 | Hope you found this tutorial useful. |
08:13 | This script is contributed by Abhishek Pawar and this is Rupak Rokade from IIT Bombay, signing off. |
08:19 | Thank You. |