-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a new type of service TimeseriesService
#569
Comments
@cuihantao Hantao, if a new patch or minor version is not in hurry, I can finish this in 2~3 weeks. Then we can include this feature in the new version. |
Sure. There's already something similar. It allows one to load a series of data from CSV. See if that's what you need. |
Not the same. Let me further clarify my expectation in short. |
Do you mean dependent variables that do not need to be calculated in the DAE? It's also known as observed variables in the Julia ModelingToolkit. If would be great if we can have that feature! |
I checked the thing you mentioned, and I feel yes. The only drawback I can see right now, we might need manually remove dependent variables. Although I don't know if ModelingToolkit.jl can do it automatically, we can at least manually eliminate some dependent variables for better DAE calculation and storage. A quick follow up is, I expect to develop this class under the category of Reference: https://docs.sciml.ai/ModelingToolkit/stable/internals/#Observables-and-Variable-Elimination
|
Service is not designed to facilitate this purpose. Service does not store the values over time, which is what you are looking to address. The observed/dependent variables are like variables. They would benefit from having an address, so that one dimension is the variable values and the other dimension is time. This will require an overhaul of the address manager. The difference from DAR variables is that the dependent variables can be calculated after the simulation is completed (or not computed at all). |
Let me maybe do an initial draft first given your input. Then we can dive into more details. |
My idea is to use a Service and use a property method class OBService(BaseService):
def __init__(self):
self.v_str: str = v_str
...
@property
def v(self):
"""
Return the value of the observable service.
Returns
-------
array-like or a scalar
The value of the observable service
"""
# NOTE: do the calculation here
pass Comparison: Mine: Your: Conclusion: Maybe let me take a look with address manager |
Good summary! |
Hantao, after first step evaluation these two days, I feel this issue needs more efforts than I expected before. I can keep this in mind as a mid-term in mind and discuss with you after coming up with a more decent plan. Feel free to do a minor/patch release before we address this. |
Is your feature request related to a problem? Please describe.
N/A
Describe the solution you'd like
A new type of Service or Variable
TimeseriesService
to lazy evaluating given expression, for value accessing and plotting. This enhancement can reduce unnecessary calculation burden in DAE.For example,
GENROU.Pe
is now anAlgeb
being calculated in DAE, but it is mainly used in plotting after simulation.andes/andes/models/synchronous/genbase.py
Lines 245 to 248 in 5ab784b
Describe alternatives you've considered
@cuihantao Welcome your further suggestion
The major point is this type does not have internal storage and does not involve DAE. The values are presented given predefined
e_str
when calling only.A possible implementation can be:
Additional context
N/A
The text was updated successfully, but these errors were encountered: