I’m attempting to very slightly extend the example given [here](https://mtk.sciml.ai/dev/tutorials/acausal_components/) to include a constant phase element. The constant phase element simulation in the time domain can be modelled as a current dependent voltage source, with the voltage gain/drop given by the convolution integral
To model this using the framework in the link above, I need to find some way of tracking the history of both the time and current state variables for each CPE modelled. If I was working in Python, the function I’d pass to the ODE solver would be wrapped in a class that could record the state variables passed to it. However, this does not seem to be compatible with the Julia philosophy, so I was wondering what the preferred solution would be?
Ok, after some thought, in the meantime I would like to try and implement this as a current-controlled voltage source. Is it possible to provide an equation to the symbolic toolkit (such as
eqs =[
v~ v+CCVS_gain()
])
and then provide the function to calculate CCVS_gain() from the current and time state variable history to ODAEProblem()?
Additionally, apologies if this is a foolish question, but if there are multiple @named elements with the same component (e.g. multiple capacitors with a C parameter), would those multiple instances of the C parameter be treated as the same when calling structural_simplify()?