Learn how to work with the notebooks by accessing the extensive information under **Help** in the navigation bar.
As a first starting point you might refer to **Help>Notebook Reference**, where you can find **Notebook Examples** in the user documentation. Important basics are covered in the following sections:
- Notebook Basics
- Running Code
- Markdown Cells
### Python
If you need an introduction to the Python language, the **Beginners Guide** under **Help>Python Reference** links to lots of tutorials depending on your previous knowledge.
### IPython
As a more advanced user, you can benefit from the fact that Jupyter Notebooks run an **IPython** kernel, which comes with additional features with respect to the standard **Python** kernel. To learn more about these features, you can follow under **Help>IPython Reference** the link **IPython documentation** and have a look into **Tutorial>Introducing IPython**.
"Derive the admittance matrix G and the source vector A applied in nodal analysis using the matrix stamp approach. Note here that there are two approaches to stamp the voltage source:\n",
"1. **NA**: Stamp the voltage source as **real** voltage source with internal resistance R1 and transform it into a current source using Norton transformation --> 2 nodes + 1 reference node\n",
"2. **MNA**: Stamp the voltage source as **ideal** voltage source. --> 3 nodes + 1 reference node"
"Derive the admittance matrix G and the source vector A applied in nodal analysis using the matrix stamp approach. Note here, that there are in general two approaches to stamp a voltage source connected in series with a resistor:\n",
"\n",
"1. **NA**: Stamp the voltage source as **real** voltage source with the resistor as internal resistance (here R1) and transform it into a current source using Norton transformation (2 nodes involved).\n",
"2. **MNA**: Stamp the voltage source as **ideal** voltage source (3 nodes involved)\n",
Derive the admittance matrix G and the source vector A applied in nodal analysis using the matrix stamp approach. Note here that there are two approaches to stamp the voltage source:
1.**NA**: Stamp the voltage source as **real** voltage source with internal resistance R1 and transform it into a current source using Norton transformation --> 2 nodes + 1 reference node
2.**MNA**: Stamp the voltage source as **ideal** voltage source. --> 3 nodes + 1 reference node
Derive the admittance matrix G and the source vector A applied in nodal analysis using the matrix stamp approach. Note here, that there are in general two approaches to stamp a voltage source connected in series with a resistor:
1.**NA**: Stamp the voltage source as **real** voltage source with the resistor as internal resistance (here R1) and transform it into a current source using Norton transformation (2 nodes involved).
2.**MNA**: Stamp the voltage source as **ideal** voltage source (3 nodes involved)
In the following, we apply the second option.
%% Cell type:markdown id: tags:
## Modified Nodal Analysis
%% Cell type:code id: tags:
``` python
#Building source vector
A_src=np.array([[0],
[0],
[I_src],
[V_src]])
[I_1],
[V_0]])
#Building admitance matrix
G=np.array([[1/R1,-1/R1,0,1],
[-1/R1,(1/R1+1/R2+1/R3),-1/R3,0],
[0,-1/R3,(1/R3+1/R4),0],
[1,0,0,0]])
#System solution
e_nodes=np.matmul(np.linalg.inv(G),A_src)
```
%% Cell type:markdown id: tags:
### Problem formulation
%% Cell type:code id: tags:
``` python
print('Admitance matrix: \n'+str(G))
print('\nProblem size: 4x4')
print('\nNode Voltages: \n'+str(e_nodes[0:3,:]))
print('\nCurrent i_10 through the voltage source: \n'+str(-e_nodes[1,:]))
print('\nSource vector: \n'+str(A_src))
print('\nSize: 4x4')
```
%% Output
Admitance matrix:
[[ 1. -1. 0. 1. ]
[-1. 2.1 -0.1 0. ]
[ 0. -0.1 0.3 0. ]
[ 1. 0. 0. 0. ]]
Problem size: 4x4
Source vector:
[[ 0.]
[ 0.]
[ 1.]
[ 10.]]
Size: 4x4
%% Cell type:markdown id: tags:
### Problem solution
%% Cell type:code id: tags:
``` python
print('Node Voltages: \n'+str(e_nodes[0:3,:]))
print('\nCurrent i_10 through the voltage source: \n'+str(-e_nodes[1,:]))