Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
urbanij committed May 10, 2021
2 parents 03b6e2a + c053bfa commit 08e1a48
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 47 deletions.
85 changes: 42 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

<!-- Index of Jupyter (IPython) Notebooks -->

|Title |
|----------------------------------------------------------------------------------------------------------------|
|Jupyter Notebooks |
|-----------------------------------------------------------------------------------------------------------------------------------------------|
|<a href="https://github.com/urbanij/matching-network/blob/master/aux/L-section_matching_calculations.ipynb">L-section_matching_calculations</a>|
|<a href="https://github.com/urbanij/matching-network/blob/master/aux/calculations.ipynb">Calculations</a> |
|<a href="https://github.com/urbanij/matching-network/blob/master/aux/demo_matching_network.ipynb">Demo</a> |



---
Expand All @@ -24,48 +22,12 @@ pip install matching_network
```


Documentation
Usage
=============


```python
>>> import matching_network as mn
>>>
>>> impedance_you_have = 90 + 32j # Ω
>>> impedance_you_want_to_have = 175 # Ω
>>>
>>> frequency = 900e6 # Hz
>>>
>>> mn.L_section_matching(impedance_you_have, impedance_you_want_to_have, frequency).match()
From (90+32j) Ω to 175 Ω

normalized starting impedance = (90+32j/175Ω = 0.51429+0.18286j

#solutions: 2

series-shunt
Series Inductor:
X = 55.464 Ω ⇔ B = -18.03 mS
L = 9.8082 nH (@ 900 MHz)
Shunt Capacitor:
X = -180.07 Ω ⇔ B = 5.5533 mS
C = 982.04 fF (@ 900 MHz)

series-shunt
Series Capacitor:
X = -119.46 Ω ⇔ B = 8.3707 mS
C = 1.4803 pF (@ 900 MHz)
Shunt Inductor:
X = 180.07 Ω ⇔ B = -5.5533 mS
L = 31.844 nH (@ 900 MHz)

>>>
```


Or, straight from the CLI:
#### From the CLI
```bash
$ python -c "import matching_network as mn; print(mn.L_section_matching(100, 20+43j, 1e9).match());"
$ matching_network --from 100 --to 20+43j --freq 1e9
```
```
From 100 Ω to (20+43j) Ω
Expand Down Expand Up @@ -103,3 +65,40 @@ series-shunt
X = 44.929 Ω ⇔ B = -22.257 mS
L = 7.1507 nH (@ 1 GHz)
```

#### Inside Python

```python
>>> import matching_network as mn
>>>
>>> impedance_you_have = 90 + 32j # Ω
>>> impedance_you_want_to_have = 175 # Ω
>>>
>>> frequency = 900e6 # Hz
>>>
>>> mn.L_section_matching(impedance_you_have, impedance_you_want_to_have, frequency).match()
From (90+32j) Ω to 175 Ω

normalized starting impedance = (90+32j/175Ω = 0.51429+0.18286j

#solutions: 2

series-shunt
Series Inductor:
X = 55.464 Ω ⇔ B = -18.03 mS
L = 9.8082 nH (@ 900 MHz)
Shunt Capacitor:
X = -180.07 Ω ⇔ B = 5.5533 mS
C = 982.04 fF (@ 900 MHz)

series-shunt
Series Capacitor:
X = -119.46 Ω ⇔ B = 8.3707 mS
C = 1.4803 pF (@ 900 MHz)
Shunt Inductor:
X = 180.07 Ω ⇔ B = -5.5533 mS
L = 31.844 nH (@ 900 MHz)

>>>
```

4 changes: 2 additions & 2 deletions matching_network/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"""Matching network module"""

__title__ = 'matching_network'
__version__ = '0.1.0'
__version__ = '0.1.5'
__author__ = u"Francesco Urbani"

from .main import L_section_matching
from .notmain import L_section_matching
35 changes: 35 additions & 0 deletions matching_network/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# import sys
# import click

# @click.group()
# @click.version_option("0.1.1")
# def main():
# """A Lumped Parameters LC matching networks CLI solver.

# urbanij.github.io/projects/matching_networks/

# urbanij.github.io/syRF
# """
# print("Hye")
# pass


import click
import matching_network as mn


@click.command()
# @click.argument('keyword', required=False)
@click.option('--from', '-f', 'from_', required=True, type=complex)
@click.option('--to', '-t', 'to', required=True, type=complex)
@click.option('--frequency', '--freq', 'frequency', required=False, type=float)
def cli(from_, to, frequency):
print(
mn.L_section_matching(
input_impedance=from_,
output_impedance=to,
frequency=frequency
).match()
)

cli()
File renamed without changes.
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
[tool.poetry]
name = "matching_network"
version = "0.1.0"
version = "0.1.5"
description = 'Design lumped-parameters matching networks (L-sections)'
license = "MIT"
readme = "README.md"
homepage = "https://pypi.org/project/matching-network/"
repository = "https://github.com/urbanij/matching-network"
# documentation = "https://github.com/urbanij/matching-network"
keywords = ["matching networks", "l-section-matching", "lumped-parameters-matching"]
keywords = ["matching network", "matching networks", "l-section-matching", "lumped-parameters-matching"]
authors = ["Francesco Urbani <[email protected]>"]

[tool.poetry.dependencies]
python = "^3.6"
quantiphy = "^2.13.0"
click = "^7.1.2"

[tool.poetry.dev-dependencies]
pytest = "^5.2"

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"

[tool.poetry.scripts]
matching_network = "matching_network.__main__:cli"

0 comments on commit 08e1a48

Please sign in to comment.