Closed marcin-golebiowski closed 4 years ago
I believe the issue is: do we want SafePow()
in SimpleParser
? It can't be used as a parser for components because it's not capable of calculating derivatives. The usecase for SimpleParser
is completely different.
The reason I want it is that simulation for the netlist posted in #4 doesn't finish with the result but with "NaN"
With that change I have correct results I believe.
The example you linked to seems to use ExpressionTreeDerivativeParser
. The other parser that would require SafePow()
is SimpleDerivativeParser
. I may be wrong, but I believe I implemented a "safe" pow() method for both of them.
In SpiceSharpParser I also use SimpleParser for initial values.
Could you elaborate on that? How do you deal with custom variables, parameters, functions, etc.? What do you use the initial values for?
No problem but in the evening.
/Marcin
I use SimpleParser for:
1) Getting list of variables from expressions. For example: R1 0 1 {a+b+c} . I need then to update value of property (besides behavioral components, there is second mechanism for property updates for other components)
2) Evaluating .IF clauses. For example: .IF (a == 0) .ENDIF
3) Evaluating values of custom functions.
@svenboulanger I've changed the SpiceSharpParser to use only one type of parser: SimpleDerivativeParser
I will publish PR later today.