Replies: 3 comments 4 replies
-
I think you're pretty much on the right track: looking at this again, I agree that for And yes, this can absolutely be done symbolically. Instead of re-implementing |
Beta Was this translation helpful? Give feedback.
-
Thanks so much for the response! Yes, the logic on line 730 never activates in practice, but with thresh=0.1 (default) there is filtering on line 733. I'll play with thresh=0 and assuming it all works fine will proceed from there re-implementing My linear algebra is a little rusty so will need to revise that, but ultimately it'd be nice to switch to sympy built-ins etc once I've got a handle on Appendix
|
Beta Was this translation helpful? Give feedback.
-
I've written a brief summary of the algorithm together with a not-so-brief example of its application. That might be a better starting point for implementing it in another environment than the Julia implementation here. |
Beta Was this translation helpful? Give feedback.
-
Thank you very much for making this library available, it's been very instructive for me learning about state-space methods. As a learning excerise, I've been re-implementing myself using python/sympy (a symbolic analysis library). I've started by implemented the linear version (just for some simple RC filters) using discrete time system eqn 13a in [1]. This is straightforward as there is a unique solution for the linear matrix problem, and sympy has a symbolic
LUsolve
routine so I can solve this symbolically (i.e. without component values being subbed in yet). This works as expected, and I've verified against analytical solutions, other solvers etc.Now thinking about the nonlinear case, I've been reading the code for
gensolve
routine. If I understand,BigInt
is used to avoid worrying about round-off errors during the initial solve (i.e. whengensolve
is called in the setup phase frommodel_matrices(...)
). However in thegensolve
routine, there is still apparently a threshold/tolerance generated, and a reliance on floating point arithmetic.https://github.com/HSU-ANT/ACME.jl/blob/main/src/ACME.jl#L730
https://github.com/HSU-ANT/ACME.jl/blob/main/src/ACME.jl#L733
So a couple of questions:
Q: Given the use of BigInt, are these tolerance filtering stages strictly neccesarily and/or is it because you'll run into problems when using the solution matrices and converting to floating point arithmetic later?
Q: (possible rephrasing of the above) - can we technically solve for the solution set purely symbolically, i.e. without component values for the matrices$D_v$ , $D_i$ etc in:
(I'm already doing so for the linear/unique solution case, so I might expect this also to be the case for the nonlinear/under-determined case).
FInally in [2], there is the quote, which is where I'm getting the idea that tolerances might not be needed (due to exact arithmetic):
I'm still getting my head around it all so apologies if this is phrased badly or doesn't make sense!
[1] "A generalized method for the derivation of non-linear state-space models from circuit schematics"
[2] "Automatic Decomposition of Non-linear Equation Systems in Audio Effect Circuit Simulation"
Beta Was this translation helpful? Give feedback.
All reactions