text stringlengths 0 828 |
|---|
V₂ Z₂ |
── = ── |
V₁ Z₁ |
Let us substitute a default value of 1 for terms Z1 and Z2: |
>>> sp.pprint(subs_default(H, ['Z1', 'Z2'], 1)) |
V₂ |
── = 1 |
V₁ |
Now, let us specify a default value of 1 for terms Z1 and Z2, but provide |
an overriding value for Z1: |
>>> sp.pprint(subs_default(H, ['Z1', 'Z2'], 1, Z1=4)) |
V₂ |
── = 1/4 |
V₁ |
Note that keyword arguments for terms not specified in the list of symbol |
names are ignored: |
>>> sp.pprint(subs_default(H, ['Z1', 'Z2'], 1, Z1=4, Q=7)) |
V₂ |
── = 1/4 |
V₁ |
''' |
if mode == 'subs': |
swap_f = _subs |
default_swap_f = _subs |
elif mode == 'limit': |
swap_f = _limit |
default_swap_f = _subs |
elif mode == 'limit_default': |
swap_f = _subs |
default_swap_f = _limit |
else: |
raise ValueError('''Unsupported mode. `mode` must be one of: ''' |
'''('subs', 'limit').''') |
result = equation |
for s in symbol_names: |
if s in kwargs: |
if isinstance(kwargs[s], Iterable): |
continue |
else: |
result = swap_f(result, s, kwargs[s]) |
else: |
result = default_swap_f(result, s, default) |
return result" |
182,"def z_transfer_functions(): |
r''' |
Return a symbolic equality representation of the transfer function of RMS |
voltage measured by either control board analog feedback circuits. |
According to the figure below, the transfer function describes the |
following relationship:: |
# Hardware V1 # # Hardware V2 # |
V₂ V₁ V₂ Z₁ |
── = ─────── ── = ── |
Z₂ Z₁ + Z₂ V₁ Z₂ |
where $V_{1}$ denotes the high-voltage actuation signal from the amplifier |
output and $V_{2}$ denotes the signal sufficiently attenuated to fall |
within the measurable input range of the analog-to-digital converter |
*(approx. 5V)*. The feedback circuits for control board **hardware version |
1** and **hardware version 2** are shown below. |
.. code-block:: none |
# Hardware V1 # # Hardware V2 # |
V_1 @ frequency V_1 @ frequency |
┯ ┯ |
┌─┴─┐ ┌─┴─┐ ┌───┐ |
│Z_1│ │Z_1│ ┌─┤Z_2├─┐ |
└─┬─┘ └─┬─┘ │ └───┘ │ |
├───⊸ V_2 │ │ │╲ ├───⊸ V_2 |
┌─┴─┐ └────┴──│-╲__│ |
│Z_2│ ┌──│+╱ |
└─┬─┘ │ │╱ |
═╧═ │ |
¯ ═╧═ |
¯ |
Notes |
----- |
- The symbolic equality can be solved for any symbol, _e.g.,_ $V_{1}$ or |
$V_{2}$. |
- A symbolically solved representation can be converted to a Python function |
using `sympy.utilities.lambdify.lambdify`_, to compute results for |
specific values of the remaining parameters. |
.. _`sympy.utilities.lambdify.lambdify`: http://docs.sympy.org/dev/modules/utilities/lambdify.html |
''' |
# Define transfer function as a symbolic equality using SymPy. |
V1, V2, Z1, Z2 = sp.symbols('V1 V2 Z1 Z2') |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.