Debian Codegraph @

doc/source/examples/interactive/Interactive Coaxial Properties.ipynb

raw
1 {
2 "cells": [
3 {
4 "cell_type": "markdown",
5 "metadata": {},
6 "source": [
7 "## Transmission Line Properties"
8 ]
9 },
10 {
11 "cell_type": "code",
12 "execution_count": null,
13 "metadata": {},
14 "outputs": [],
15 "source": [
16 "import matplotlib.pyplot as plt\n",
17 "import numpy as np\n",
18 "\n",
19 "import skrf as rf\n",
20 "\n",
21 "%matplotlib inline\n",
22 "\n",
23 "from skrf import Frequency\n",
24 "from skrf.media import DistributedCircuit\n",
25 "\n",
26 "rf.stylely()\n",
27 "\n",
28 "# define a frequency object\n",
29 "freq = Frequency.from_f(np.logspace(0,6,101), unit='Hz')\n",
30 "\n",
31 "def func(C=93,I=273, R=0, G=0):\n",
32 " coax = DistributedCircuit(frequency = freq,\n",
33 " C =C*1e-12,#F/m\n",
34 " I =I*1e-9, #H/m\n",
35 " R =10**(-R),#53e-3, #Ohm/m\n",
36 " G =G, #S/m\n",
37 " )\n",
38 " freq.plot(coax.gamma.imag,label=r'$ \\beta$')\n",
39 " freq.plot(coax.gamma.real, label=r'$ \\alpha$')\n",
40 " plt.ylabel('Propagation Constant (rad/m)')\n",
41 " plt.ylim(1e-8,1e2)\n",
42 " plt.loglog()# impose log-log scaling\n",
43 " plt.legend()"
44 ]
45 },
46 {
47 "cell_type": "code",
48 "execution_count": null,
49 "metadata": {},
50 "outputs": [],
51 "source": [
52 "from ipywidgets import interact\n",
53 "\n",
54 "interact(func, C=(0,100,10), I=(100,400,10), R =(0,10),G=(0,10));"
55 ]
56 },
57 {
58 "cell_type": "code",
59 "execution_count": null,
60 "metadata": {},
61 "outputs": [],
62 "source": []
63 }
64 ],
65 "metadata": {
66 "anaconda-cloud": {},
67 "kernelspec": {
68 "display_name": "Python 3 (ipykernel)",
69 "language": "python",
70 "name": "python3"
71 },
72 "language_info": {
73 "codemirror_mode": {
74 "name": "ipython",
75 "version": 3
76 },
77 "file_extension": ".py",
78 "mimetype": "text/x-python",
79 "name": "python",
80 "nbconvert_exporter": "python",
81 "pygments_lexer": "ipython3",
82 "version": "3.8.10"
83 }
84 },
85 "nbformat": 4,
86 "nbformat_minor": 1
87 }