Skip to content

Commit dda78d5

Browse files
committed
readme
1 parent c489ca7 commit dda78d5

File tree

2 files changed

+71
-2
lines changed

2 files changed

+71
-2
lines changed

Images/Reflectionkeyword.png

-29 KB
Loading

README.md

Lines changed: 71 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ This project originated as an exploration of the interactive possibilities that
55

66
**Note**: Some of the features are experimental. They might not function fully as expected or could be subject to changes in future versions.
77

8+
**Note**: It is possible that currently there are too many keywords. Options are being considered to simplify some aspects.
9+
810
**Note**: Certain visual details of the Smith Chart may require further refinement to enhance aesthetic and overall visual quality.
911

1012
## Usage
@@ -37,9 +39,60 @@ DataInspector(fig)
3739
fig
3840
```
3941

42+
## Integration with Makie Utilities
43+
44+
This example showcases the seamless integration of the Smith chart with Makie.jl's interactive functionalities. It demonstrates a typical scenario used to teach impedance matching, where we aim to transform a source impedance of 1+2j to a load impedance of 1. To achieve this, we utilize a transmission line and a parallel stub, and control their lengths via sliders. By dynamically adjusting these lengths, users can observe how the source impedance seen by the load evolves on the Smith chart, visually illustrating the impedance matching process.
45+
46+
```julia
47+
48+
fig = Figure()
49+
ax = SmithAxis(fig[1, 1], title = "Stub Matching")
50+
51+
Ri = 1.0
52+
Xi = 2.0
53+
zi = Ri + Xi*im
54+
55+
function simline(z, l)
56+
bl = 2 * pi * l # Electrical length
57+
return (z + im * tan(bl)) / (1 + im * z * tan(bl))
58+
end
59+
60+
function simstub(z, l)
61+
bl = 2 * pi * l
62+
y_stub = im * tan(-bl)
63+
return 1 / ((1 / z) + y_stub)
64+
end
65+
66+
N = 101
67+
sg = SliderGrid(
68+
fig[2, 1],
69+
(label = "Line", range = range(0.0, 0.5, 151), format = "{:.3f}λ", startvalue = 0.0),
70+
(label = "Stub", range = range(0.0, 0.5, 151), format = "{:.3f}λ", startvalue = 0.0))
71+
72+
sliderobservables = [s.value for s in sg.sliders]
73+
z = lift(sliderobservables...) do slvalues...
74+
line_index, stub_index = [slvalues...]
75+
line_p = range(0.0, line_index, N)
76+
stub_p = range(0.0, stub_index, N)
77+
z_line = simline.(zi, line_p)
78+
z_stub = simstub.(z_line[end], stub_p)
79+
return [zi; z_line; z_stub]
80+
end
81+
82+
zend = lift(x->x[end], z)
83+
smithscatter!(zi)
84+
smithplot!(z)
85+
smithscatter!(zend)
86+
fig
87+
```
88+
89+
90+
## Plot Reflection Coefficientes
91+
4092
![SmithChartExample](Images/smithplot_color.png)
4193

42-
You can also draw reflection coefficients (S-parameters) with the `reflection = true` keyword.
94+
You can also draw reflection data with the `reflection = true` keyword. This is useful, for example, when you want to visualize the S-parameters of a simulation or measurement.
95+
4396
```julia
4497
zi = 3.8 - 1.9im
4598
function simline(z, l)
@@ -80,12 +133,28 @@ ax = SmithAxis(fig[1, 1]; subgrid = true, cutgrid = true, zoomupdate = true, tex
80133

81134
## Other Keywords
82135

83-
In the folder Images there are examples of some keywords.
136+
How some keywords modify visual aspects of the Smith Chart.
137+
138+
### Chart type and grid colors
139+
140+
It is possible to change the type of smith chart or modify the color of the grid or subgrid.
84141

85142
![keywordexample](Images/typeandcolor.png)
86143

144+
### Interior tick options
145+
146+
There are multiple keywords to modify the position of the ticks. Some of them are:
147+
87148
![keywordexample](Images/tickkeywords.png)
88149

150+
### Threshold keyword
151+
152+
`threshold` keyword controls the cut of the lines in the intersection with other arcs.
153+
89154
![keywordexample](Images/threshold.png)
90155

156+
### Subgrid split
157+
158+
The `splitminor` keyword controls the number of cuts of a space between ticks when there is no zoom. See also `splitgrid` to control the split when zooming.
159+
91160
![keywordexample](Images/splitminor.png)

0 commit comments

Comments
 (0)