A step toward generalizing the phasor dynamics examples.#338
A step toward generalizing the phasor dynamics examples.#338PhilipFackler wants to merge 3 commits intodevelopfrom
Conversation
a3f8024 to
c8f2e0d
Compare
pelesh
left a comment
There was a problem hiding this comment.
- Using CSV files as reference and output data is good!
- 3-bus example is much cleaner and can be used as a template for refactoring other examples.
- Utilities for processing and comparing data in CSV files simplify examples implementation.
I suggest @abirchfield and @lukelowry review and provide feedback before it is merged.
The code fails to build on my machine. Make sure tests pass in CI pipeline.
|
I am getting linker error when linking Logger with file utilities: DetailsI suggest implementing file utilities in a source file, building it as a standalone object and linking it to logger. It looks as if some of the include directives include code that needs to be linked to |
|
Once I pass the building woes, the result verification in simplified examples fails: |
699f389 to
ea4e668
Compare
ea4e668 to
a7b3408
Compare
|
I am not sure how the following test passes: We are either signaling error where there is none or we are writing/reading from unallocated address and getting away with it. This seems to be out of scope of this PR, though. CC @nkoukpaizan |
| monitor_->set(Variable::omega, [this] | ||
| { return y_[1]; }); | ||
| monitor_->set(Variable::speed, [this] | ||
| { return 1.0 + y_[1]; }); |
There was a problem hiding this comment.
@abirchfield, do we need outputs for omega (deviation from nominal speed) and speed?
I'll let @PhilipFackler chime in, but looks like that is the expected behavior of the |
Description
This updates the ThreeBusBasicJson example to compare the output of the monitored variables with the reference solution (rather that the result of the custom callback). I created a reference solution from the original
ThreeBusBasic.hppfile and stored it asThreeBusBasic.ref.csv.Closes #337
Checklist
-Wall -Wpedantic -Wconversion -Wextra.Further comments
In this iteration, the code depends on a hard-coded file name. It expects the monitored variable output to be stored in
mon.csv. This is specified in the example json file so it makes sense from the perspective that this is still a specific example with its own source code.As we move toward a generalized application for these, we can have a command-line option specifying which output files to compare (optionally, of course, since we may not be testing the output).