-
Notifications
You must be signed in to change notification settings - Fork 46
/
TODO
235 lines (133 loc) · 6.3 KB
/
TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
Schematics
==========
1. Automatically add wires with node splitting to avoid explicit wires.
2. Add drawing methods to TwoPorts.
3. Automatically separate parallel components when drawing (except
open circuits). The tricky part is adding enough space for the
labels.
4. Warn if have disjoint components.
5. Add user configuration file.
6. Convert voltage and current labels for s-models. v(t) -> V(s), etc.
7. Independent namespaces for SVG files so they can be loaded into Jupyter notebook.
8. If component has invisible attribute, do not count the connections.
9. Fix scaling of bipoles; the current method also scales the nodes.
10. Perhaps use dvipng?
11. Get SymPy to use \ud for derivatives. Perhaps define macro, say as:
\makeatletter
\@ifundefined{ud}{\newcommand{\ud}{\mathrm{d}}}{}
\makeatother
12. Enable/disable units
13. Search for loops
14. Fix ladder layout for three R-L branches all in parallel
15. Use better heuristics for component spacing when drawing networks.
16. Show values with SI unit prefixes (f, p, n, u, m, k, M, G, T)
17. Tidy mutual inductances
Circuit analysis
================
1. Add Vsin and Isin components for better Spice compatibility.
2. Generalise two-port representation to avoid transformations from a
singular matrix.
3. Remove dangling sources
4. Handle controlled sources for loop and mesh analysis
Infrastructure
==============
1. Improve handling symbols of same name with different assumptions.
The problem arises when SymPy creates a symbol since it uses different
assumptions to Lcapy. Ideally have a hook in sym.sympify.
2. Support more Fourier/Laplace transformations, say using a table
driven approach.
3. Speed up residue calculation (perhaps can try without taking limit...).
4. Warn user when calculations may take a while, say when inverting a
large matrix.
5. Add || operator to SymPy but this will require Python mods!
6. Use better assumptions propagation.
7. Redo Matrix classes that does not lose the class information
for each element. See matrix branch.
8. Improve context switching to avoid sharing of symbols between
different netlists. Could use Python context manager with __enter__
and __exit__ methods so that can use with statement.
9. expr('A*t/T*u(t)*u(T-t)+A*u(t-T)')(s)(t) The problem is that
u(t) * u(T - t) == u(t) - u(t - T) but SymPy does not know this.
10. Teach sifting theorem for Dirac delta.
11. Warn about coupled inductors at DC? LT methods will blindly give
an answer that appears valid for DC.
12. Simplify convolutions.
13. Simplify i_equation/v_equation nonsense.
14. Compatibility with PySpice
15. Untangle Netlist stuff
16. Test NetlistNamespace
17. Ponder what ac attribute should return; a dictionary as present or a time expr?
18. Allow resistance, etc., for other domains.
18. Return x.resistance() as resistance class?
19. Warn if try to multiply impedance impulse response with current in time-domain, etc.
20. H(f) prints as u(f) for a user defined function. Perhaps need a mechanism to override interpretion of H as Heaviside function?
21. Fix expand and other funcs by converting Lcapy expressions in kwargs.
22. Fix (R(10e-3) + L(90e-3)).Z(t).plot()
23. Test response method.
24. TwoPort should only inherit a subset of Network
25. Add sifting theorem to simplify_dirac_delta
26. Fix simplify_sin_cos for multiple cos and sin
27. Expand cosh, sinh, for inverse Laplace
28. Defer two-port evaluation and use AST
29. Handle responses such as (1 - exp(-s * T)) / A(s).
30. ILT(cosh(d*s/(2*c))/cosh(d*s/c))
31. Convert class if integrate over domain variable
32. Fix noise expression products
33. ImpulseResponse, StepResponse classes? This will fix label if calculate step response from TransferFunction.
34. Add warning if S has unknown kind
35. Handle DC plus transient. When convert to Laplace domain, loose
causality since both parts lumped together.
36. Warn if no DC path to ground for DC analysis
37. Limit for sinc. SymPy needs _as_leading_term() method.
38. Implement Matrix class since SymPy is deprecating storing non SymPy objects in a SymPy Matrix.
39. Avoid pole-zero cancellation for a transfer function derived from a differential or difference equation.
40. Defer evaluation of twoports.
Testing
=======
1. Write more unit tests to improve code coverage.
Documentation
=============
1. Add more example notebooks.
2. Restructure user manual.
3. Document underlying philosophy.
4. Fix shape node labels.
5. Document quirks.
6. Update the examples.
7. Have more worked examples.
8. Switch math markup to LaTeX
Additional features
===================
1. Expand two-ports, xtals, opamps, etc. cct = cct.expand() Perhaps
have arg to expand to select components and/or types of component to
expand?
When expanding, still need to know original nodes for determining
voltage, say across a capacitor when it expanded into a series
comb. of an impedance and voltage source. Perhaps retain the
component in the netlist but prefix it with some symbol, such as @,
to create a phanton component. For example, C1 2 1 5 2 expands to
C#1 2 dummy 5
V#1 dummy 1 2
@C1 2 1 5 2
Here the @symbol says not to draw or analyse cpt. But the name C1
will be added to the directories for the current and voltage. This
will be useful for noisy models.
SymPy
=====
1. Advocate for SymPy to consider lower limit of Laplace transform
integral to sneak past 0 so that DiracDelta(t) -> 1 instead of 0.5.
This seems to have changed with SymPy-1.9.
2. Contribute Fourier/Laplace code to SymPy.
3. Contribute z-transform code to SymPy.
4. Support unit impulse (or KroneckerDelta with single arg).
Discrete-time
=============
1. Rewrite rational functions in terms of z^-1. This will require modifications to SymPy or a separate printer.
2. Symbol for z^-1, say invz or iz? Would need special casing to handle invz * z etc. Better to not allow mixed expressions with z and invz. Would need special handling to have invz correctly printed.
3. Unit lag operator L() ?
4. Difference operator D() for first-order differences?
5. Coerce sympy to print ordered sum of delayed impulses.
6. Fourier series?
Transforms
==========
1. (1 / (f - 5j)**2) cannot do IFT
2. SymPy takes forever to find limit of (-2*f + 10*I)*(f - 5*I)**2/(f**2 - 10*I*f - 25)**2 + (2*f - 10*I)/(f**2 - 10*I*f - 25) at f=5*I Note, this expression simplifies to 0.