Skip to content
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 reactive_power_sigma attribute #409

Merged
merged 44 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
a2c6a1d
add reactive_power_sigma attribute
mgovers Oct 19, 2023
fe83b9c
update docs
mgovers Oct 19, 2023
0cbab46
update docs
mgovers Oct 19, 2023
040e626
fix tests
mgovers Oct 19, 2023
ece11aa
update docs
mgovers Oct 19, 2023
2546126
minor
mgovers Oct 19, 2023
30c5d39
minor
mgovers Oct 19, 2023
89a19a4
update documentation
mgovers Oct 19, 2023
c7976c2
change reactive_power_sigma to p_sigma and q_sigma
mgovers Oct 19, 2023
6a6ca95
simplify docs
mgovers Oct 20, 2023
323103e
separate voltage and power sensor calc params
mgovers Oct 20, 2023
0ac2296
uniform complex random variable instead of complete calc param
mgovers Oct 25, 2023
04a68de
complex p, real p and q variances
mgovers Oct 27, 2023
74d03f0
partial fix build
mgovers Oct 27, 2023
e9bcebc
update all logic with asymmetric + split p and q variances
mgovers Oct 30, 2023
d740d24
fix tests pt1
mgovers Oct 30, 2023
d8460b0
Merge branch 'main' into feature/reactive-power-sigma
mgovers Oct 30, 2023
089bf02
Merge branch 'feature/reactive-power-sigma' of https://github.com/Pow…
mgovers Oct 30, 2023
6ebd35c
fix measurements tests
mgovers Oct 30, 2023
66d1f80
fix all tests
mgovers Oct 30, 2023
67c1062
test
mgovers Oct 31, 2023
c221f15
Merge branch 'main' into feature/reactive-power-sigma
mgovers Oct 31, 2023
48b09fc
Merge branch 'feature/reactive-power-sigma' of https://github.com/Pow…
mgovers Oct 31, 2023
38fe56a
fix all existing tests, add measured values tests
mgovers Nov 1, 2023
83a0ebb
Merge remote-tracking branch 'origin/main' into feature/reactive-powe…
mgovers Nov 1, 2023
09db890
Merge remote-tracking branch 'origin/feature/refactor-test-power-sens…
mgovers Nov 1, 2023
ce12a94
const correctness
mgovers Nov 1, 2023
3855384
make clang tidy happy
mgovers Nov 1, 2023
822f52f
also for voltage sensor
mgovers Nov 1, 2023
c206cd1
fix protected
mgovers Nov 1, 2023
3bf259d
fix more clang-tidy
mgovers Nov 1, 2023
5a92661
fix clang build
mgovers Nov 1, 2023
454b976
fix lifetime issue in eigen division
mgovers Nov 1, 2023
bf602c1
Merge branch 'main' into feature/reactive-power-sigma
TonyXiang8787 Nov 1, 2023
faafd04
tests for variance for different p and q sigma
mgovers Nov 1, 2023
8a5563d
Merge branch 'feature/reactive-power-sigma' of https://github.com/Pow…
mgovers Nov 1, 2023
8024b3e
fix sonar cloud
mgovers Nov 1, 2023
8c6e14e
resolve comments
mgovers Nov 2, 2023
3eb324e
efficient diagonal tensor multiplication
mgovers Nov 3, 2023
28a7352
pseudo abstract implementation for sensor
mgovers Nov 3, 2023
6ff436e
also ensure that it's not constructible from derived classes
mgovers Nov 3, 2023
bbc430b
correct optimization steps
mgovers Nov 3, 2023
fe5a30e
fix clang-tidy
mgovers Nov 3, 2023
8703d81
more clang-tidy
mgovers Nov 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions code_generation/data/attribute_classes/input.json
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,11 @@
"data_type": "double",
"names": "power_sigma",
"description": "sigma of error margin of power measurement"
},
{
"data_type": "double",
"names": "reactive_power_sigma",
"description": "sigma of error margin of reactive power measurement"
}
]
},
Expand Down
5 changes: 4 additions & 1 deletion docs/_static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@

.wy-nav-content {
max-width: none;
}
}
.wy-table-responsive table td, .wy-table-responsive table th {
white-space: inherit;
TonyXiang8787 marked this conversation as resolved.
Show resolved Hide resolved
}
9 changes: 5 additions & 4 deletions docs/user_manual/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,10 +468,11 @@ Because of this distribution, at least one appliance is required to be connected

##### Input

| name | data type | unit | description | required | update | valid values |
| ------------------------ | ----------------------------------------------------------------------------- | ---------------- | --------------------------------------------------------------------------------------------------------------- | :--------------------------------: | :------: | :--------------------------------------------------: |
| `measured_terminal_type` | {py:class}`MeasuredTerminalType <power_grid_model.enum.MeasuredTerminalType>` | - | indicate if it measures an `appliance` or a `branch` | &#10004; | &#10060; | the terminal type should match the `measured_object` |
| `power_sigma` | `double` | volt-ampere (VA) | standard deviation of the measurement error. Usually this is the absolute measurement error range divided by 3. | &#10024; only for state estimation | &#10004; | `> 0` |
| name | data type | unit | description | required | update | valid values |
| ------------------------ | ----------------------------------------------------------------------------- | -------------------------- | --------------------------------------------------------------------------------------------------------------- | :-------------------------------------: | :------: | :--------------------------------------------------: |
| `measured_terminal_type` | {py:class}`MeasuredTerminalType <power_grid_model.enum.MeasuredTerminalType>` | - | indicate if it measures an `appliance` or a `branch` | &#10004; | &#10060; | the terminal type should match the `measured_object` |
| `power_sigma` | `double` | volt-ampere (VA) | standard deviation of the measurement error. Usually this is the absolute measurement error range divided by 3. | &#10024; only for state estimation | &#10004; | `> 0` |
| `reactive_power_sigma` | `double` | volt-ampere-reactive (var) | standard deviation of the measurement error. Usually this is the absolute measurement error range divided by 3. | &#10060; default equal to `power_sigma` | &#10004; | `> 0` |

#### Power Sensor Concrete Types

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ using AsymVoltageSensorInput = VoltageSensorInput<false>;
struct GenericPowerSensorInput : SensorInput {
MeasuredTerminalType measured_terminal_type; // type of measured terminal
double power_sigma; // sigma of error margin of power measurement
double reactive_power_sigma; // sigma of error margin of reactive power measurement
};

template <bool sym>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ struct get_attributes_list<GenericPowerSensorInput> {
{MetaAttributeImpl<GenericPowerSensorInput, &GenericPowerSensorInput::measured_object>{}, "measured_object"},
{MetaAttributeImpl<GenericPowerSensorInput, &GenericPowerSensorInput::measured_terminal_type>{}, "measured_terminal_type"},
{MetaAttributeImpl<GenericPowerSensorInput, &GenericPowerSensorInput::power_sigma>{}, "power_sigma"},
{MetaAttributeImpl<GenericPowerSensorInput, &GenericPowerSensorInput::reactive_power_sigma>{}, "reactive_power_sigma"},
};
}
};
Expand All @@ -355,6 +356,7 @@ struct get_attributes_list<PowerSensorInput<sym>> {
{MetaAttributeImpl<PowerSensorInput<sym>, &PowerSensorInput<sym>::measured_object>{}, "measured_object"},
{MetaAttributeImpl<PowerSensorInput<sym>, &PowerSensorInput<sym>::measured_terminal_type>{}, "measured_terminal_type"},
{MetaAttributeImpl<PowerSensorInput<sym>, &PowerSensorInput<sym>::power_sigma>{}, "power_sigma"},
{MetaAttributeImpl<PowerSensorInput<sym>, &PowerSensorInput<sym>::reactive_power_sigma>{}, "reactive_power_sigma"},
{MetaAttributeImpl<PowerSensorInput<sym>, &PowerSensorInput<sym>::p_measured>{}, "p_measured"},
{MetaAttributeImpl<PowerSensorInput<sym>, &PowerSensorInput<sym>::q_measured>{}, "q_measured"},
};
Expand Down Expand Up @@ -703,6 +705,7 @@ struct get_component_nan<GenericPowerSensorInput> {
set_nan(comp.measured_object);
set_nan(comp.measured_terminal_type);
set_nan(comp.power_sigma);
set_nan(comp.reactive_power_sigma);
return comp;
}
};
Expand All @@ -717,6 +720,7 @@ struct get_component_nan<PowerSensorInput<sym>> {
set_nan(comp.measured_object);
set_nan(comp.measured_terminal_type);
set_nan(comp.power_sigma);
set_nan(comp.reactive_power_sigma);
set_nan(comp.p_measured);
set_nan(comp.q_measured);
return comp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ PGM_API extern PGM_MetaAttribute const* const PGM_def_input_sym_power_sensor_id;
PGM_API extern PGM_MetaAttribute const* const PGM_def_input_sym_power_sensor_measured_object;
PGM_API extern PGM_MetaAttribute const* const PGM_def_input_sym_power_sensor_measured_terminal_type;
PGM_API extern PGM_MetaAttribute const* const PGM_def_input_sym_power_sensor_power_sigma;
PGM_API extern PGM_MetaAttribute const* const PGM_def_input_sym_power_sensor_reactive_power_sigma;
PGM_API extern PGM_MetaAttribute const* const PGM_def_input_sym_power_sensor_p_measured;
PGM_API extern PGM_MetaAttribute const* const PGM_def_input_sym_power_sensor_q_measured;
// component asym_power_sensor
Expand All @@ -229,6 +230,7 @@ PGM_API extern PGM_MetaAttribute const* const PGM_def_input_asym_power_sensor_id
PGM_API extern PGM_MetaAttribute const* const PGM_def_input_asym_power_sensor_measured_object;
PGM_API extern PGM_MetaAttribute const* const PGM_def_input_asym_power_sensor_measured_terminal_type;
PGM_API extern PGM_MetaAttribute const* const PGM_def_input_asym_power_sensor_power_sigma;
PGM_API extern PGM_MetaAttribute const* const PGM_def_input_asym_power_sensor_reactive_power_sigma;
PGM_API extern PGM_MetaAttribute const* const PGM_def_input_asym_power_sensor_p_measured;
PGM_API extern PGM_MetaAttribute const* const PGM_def_input_asym_power_sensor_q_measured;
// component fault
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ PGM_MetaAttribute const* const PGM_def_input_sym_power_sensor_id = PGM_meta_get_
PGM_MetaAttribute const* const PGM_def_input_sym_power_sensor_measured_object = PGM_meta_get_attribute_by_name(nullptr, "input", "sym_power_sensor", "measured_object");
PGM_MetaAttribute const* const PGM_def_input_sym_power_sensor_measured_terminal_type = PGM_meta_get_attribute_by_name(nullptr, "input", "sym_power_sensor", "measured_terminal_type");
PGM_MetaAttribute const* const PGM_def_input_sym_power_sensor_power_sigma = PGM_meta_get_attribute_by_name(nullptr, "input", "sym_power_sensor", "power_sigma");
PGM_MetaAttribute const* const PGM_def_input_sym_power_sensor_reactive_power_sigma = PGM_meta_get_attribute_by_name(nullptr, "input", "sym_power_sensor", "reactive_power_sigma");
PGM_MetaAttribute const* const PGM_def_input_sym_power_sensor_p_measured = PGM_meta_get_attribute_by_name(nullptr, "input", "sym_power_sensor", "p_measured");
PGM_MetaAttribute const* const PGM_def_input_sym_power_sensor_q_measured = PGM_meta_get_attribute_by_name(nullptr, "input", "sym_power_sensor", "q_measured");
// component asym_power_sensor
Expand All @@ -218,6 +219,7 @@ PGM_MetaAttribute const* const PGM_def_input_asym_power_sensor_id = PGM_meta_get
PGM_MetaAttribute const* const PGM_def_input_asym_power_sensor_measured_object = PGM_meta_get_attribute_by_name(nullptr, "input", "asym_power_sensor", "measured_object");
PGM_MetaAttribute const* const PGM_def_input_asym_power_sensor_measured_terminal_type = PGM_meta_get_attribute_by_name(nullptr, "input", "asym_power_sensor", "measured_terminal_type");
PGM_MetaAttribute const* const PGM_def_input_asym_power_sensor_power_sigma = PGM_meta_get_attribute_by_name(nullptr, "input", "asym_power_sensor", "power_sigma");
PGM_MetaAttribute const* const PGM_def_input_asym_power_sensor_reactive_power_sigma = PGM_meta_get_attribute_by_name(nullptr, "input", "asym_power_sensor", "reactive_power_sigma");
PGM_MetaAttribute const* const PGM_def_input_asym_power_sensor_p_measured = PGM_meta_get_attribute_by_name(nullptr, "input", "asym_power_sensor", "p_measured");
PGM_MetaAttribute const* const PGM_def_input_asym_power_sensor_q_measured = PGM_meta_get_attribute_by_name(nullptr, "input", "asym_power_sensor", "q_measured");
// component fault
Expand Down