Line Modeling simulation with PowerSimulationsDynamics.jl
Originally Contributed by: José Daniel Lara
This tutorial will introduce the modeling of an inverter with Virtual Innertia in a multi-machine model of the system. We will load the data directly from PSS/e dynamic files
The tutorial uses a modified 14-bus system on which all the synchronous machines have been substitued by generators with ESAC1A AVR's and no Turbine Governors.
In the first portion of the tutorial we will simulate the system with the original data and cause a line trip between Buses 2 and 4. In the second part of the simulation, we will switch generator 6 with a battery using an inverter and perform the same fault.
Load the packages
using SIIPExamples # Only needed for the tutorial, comment if you want to run
import DisplayAs # Only needed for the tutorial
using PowerSimulationsDynamics
PSID = PowerSimulationsDynamics
using PowerSystems
using Logging
using Sundials
using Plots
gr()
Plots.GRBackend()
Create the system
file_dir = joinpath(
dirname(dirname(pathof(SIIPExamples))),
"script",
"4_PowerSimulationsDynamics_examples",
"Data",
)
sys = System(joinpath(file_dir, "14bus.raw"), joinpath(file_dir, "dyn_data.dyr"))
[ Info: The PSS(R)E parser currently supports buses, loads, shunts, generators, branches, transformers, and dc lines [ Info: The following fields in GENERATOR are missing: O2, F2, O3, F3, O4, F4, WMOD, WPF [ Info: The following fields in GENERATOR are missing: O2, F2, O3, F3, O4, F4, WMOD, WPF [ Info: The following fields in GENERATOR are missing: O2, F2, O3, F3, O4, F4, WMOD, WPF [ Info: The following fields in GENERATOR are missing: O2, F2, O3, F3, O4, F4, WMOD, WPF [ Info: The following fields in GENERATOR are missing: O2, F2, O3, F3, O4, F4, WMOD, WPF [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: angmin and angmax values are 0, widening these values on branch 4 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 1 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 12 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 20 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 2 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 6 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 11 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 13 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 5 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 15 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 16 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 14 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 7 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 8 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 17 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 10 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 19 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 9 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 18 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 3 to +/- 60.0 deg. [ Info: this code only supports positive rate_a values, changing the value on branch 4 to 651.7693 [ Info: this code only supports positive rate_a values, changing the value on branch 1 to 1943.3753 [ Info: this code only supports positive rate_a values, changing the value on branch 12 to 1340.1421 [ Info: this code only supports positive rate_a values, changing the value on branch 20 to 686.916 [ Info: this code only supports positive rate_a values, changing the value on branch 2 to 527.2551 [ Info: this code only supports positive rate_a values, changing the value on branch 6 to 658.7239 [ Info: this code only supports positive rate_a values, changing the value on branch 11 to 1099.9023 [ Info: this code only supports positive rate_a values, changing the value on branch 13 to 404.9974 [ Info: this code only supports positive rate_a values, changing the value on branch 5 to 661.3166 [ Info: this code only supports positive rate_a values, changing the value on branch 15 to 406.1471 [ Info: this code only supports positive rate_a values, changing the value on branch 16 to 312.073 [ Info: this code only supports positive rate_a values, changing the value on branch 14 to 579.3328 [ Info: this code only supports positive rate_a values, changing the value on branch 7 to 2739.0808 [ Info: this code only supports positive rate_a values, changing the value on branch 8 to 548.9677 [ Info: this code only supports positive rate_a values, changing the value on branch 17 to 578.6164 [ Info: this code only supports positive rate_a values, changing the value on branch 10 to 828.1844 [ Info: this code only supports positive rate_a values, changing the value on branch 19 to 480.1216 [ Info: this code only supports positive rate_a values, changing the value on branch 9 to 426.3491 [ Info: this code only supports positive rate_a values, changing the value on branch 18 to 217.5559 [ Info: this code only supports positive rate_a values, changing the value on branch 3 to 594.6825 ┌ Info: Constructing System from Power Models │ data["name"] = "14bus" └ data["source_type"] = "pti" [ Info: Reading bus data [ Info: Reading generator data ┌ Warning: Invalid range │ valid_info.struct_name = "ThermalStandard" │ field_name = "active_power_limits" │ field_value = -399.96 │ valid_range = Dict{String,Any} with 2 entries: … │ valid_info.ist_struct = │ generator-6-1 (ThermalStandard): │ name: generator-6-1 │ available: true │ status: true │ bus: BUS 06 (Bus) │ active_power: 0.15 │ reactive_power: 0.14800000000000002 │ rating: 99.99028802838804 │ active_power_limits: (min = -99.99, max = 99.99) │ reactive_power_limits: (min = -0.06, max = 0.24) │ ramp_limits: (up = 0.9998999999999999, down = 0.9998999999999999) │ operation_cost: ThreePartCost │ base_power: 25.0 │ time_limits: nothing │ prime_mover: PrimeMovers.OT = 19 │ fuel: ThermalFuels.OTHER = 14 │ services: 0-element Array{Service,1} │ time_at_status: 1.0e6 │ dynamic_injector: nothing │ ext: Dict{String,Any}("z_source" => (r = 0.0, x = 0.12)) │ time_series_container: InfrastructureSystems.TimeSeriesContainer: 0 │ InfrastructureSystems.SystemUnitsSettings: │ base_value: 100.0 │ unit_system: UnitSystem.SYSTEM_BASE = 0 └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:228 ┌ Warning: Invalid range │ valid_info.struct_name = "ThermalStandard" │ field_name = "active_power_limits" │ field_value = -16.258536585365853 │ valid_range = Dict{String,Any} with 2 entries: … │ valid_info.ist_struct = │ generator-1-1 (ThermalStandard): │ name: generator-1-1 │ available: true │ status: true │ bus: BUS 01 (Bus) │ active_power: 1.9333000000000002 │ reactive_power: 0.01121 │ rating: 100.48880584423323 │ active_power_limits: (min = -99.99, max = 99.99) │ reactive_power_limits: (min = -10.0, max = 10.0) │ ramp_limits: (up = 0.9998999999999999, down = 0.9998999999999999) │ operation_cost: ThreePartCost │ base_power: 615.0 │ time_limits: nothing │ prime_mover: PrimeMovers.OT = 19 │ fuel: ThermalFuels.OTHER = 14 │ services: 0-element Array{Service,1} │ time_at_status: 1.0e6 │ dynamic_injector: nothing │ ext: Dict{String,Any}("z_source" => (r = 0.0, x = 0.23)) │ time_series_container: InfrastructureSystems.TimeSeriesContainer: 0 │ InfrastructureSystems.SystemUnitsSettings: │ base_value: 100.0 │ unit_system: UnitSystem.SYSTEM_BASE = 0 └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:228 ┌ Warning: Invalid range │ valid_info.struct_name = "ThermalStandard" │ field_name = "active_power_limits" │ field_value = -399.96 │ valid_range = Dict{String,Any} with 2 entries: … │ valid_info.ist_struct = │ generator-8-1 (ThermalStandard): │ name: generator-8-1 │ available: true │ status: true │ bus: BUS 08 (Bus) │ active_power: 0.1 │ reactive_power: 0.22292 │ rating: 99.99028802838804 │ active_power_limits: (min = -99.99, max = 99.99) │ reactive_power_limits: (min = -0.06, max = 0.24) │ ramp_limits: (up = 0.9998999999999999, down = 0.9998999999999999) │ operation_cost: ThreePartCost │ base_power: 25.0 │ time_limits: nothing │ prime_mover: PrimeMovers.OT = 19 │ fuel: ThermalFuels.OTHER = 14 │ services: 0-element Array{Service,1} │ time_at_status: 1.0e6 │ dynamic_injector: nothing │ ext: Dict{String,Any}("z_source" => (r = 0.0, x = 0.12)) │ time_series_container: InfrastructureSystems.TimeSeriesContainer: 0 │ InfrastructureSystems.SystemUnitsSettings: │ base_value: 100.0 │ unit_system: UnitSystem.SYSTEM_BASE = 0 └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:228 ┌ Warning: Invalid range │ valid_info.struct_name = "ThermalStandard" │ field_name = "active_power_limits" │ field_value = -166.65 │ valid_range = Dict{String,Any} with 2 entries: … │ valid_info.ist_struct = │ generator-2-1 (ThermalStandard): │ name: generator-2-1 │ available: true │ status: true │ bus: BUS 02 (Bus) │ active_power: 0.3 │ reactive_power: 0.27015999999999996 │ rating: 99.99125011719775 │ active_power_limits: (min = -99.99, max = 99.99) │ reactive_power_limits: (min = -0.4, max = 0.5) │ ramp_limits: (up = 0.9998999999999999, down = 0.9998999999999999) │ operation_cost: ThreePartCost │ base_power: 60.0 │ time_limits: nothing │ prime_mover: PrimeMovers.OT = 19 │ fuel: ThermalFuels.OTHER = 14 │ services: 0-element Array{Service,1} │ time_at_status: 1.0e6 │ dynamic_injector: nothing │ ext: Dict{String,Any}("z_source" => (r = 0.0, x = 0.13)) │ time_series_container: InfrastructureSystems.TimeSeriesContainer: 0 │ InfrastructureSystems.SystemUnitsSettings: │ base_value: 100.0 │ unit_system: UnitSystem.SYSTEM_BASE = 0 └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:228 ┌ Warning: Invalid range │ valid_info.struct_name = "ThermalStandard" │ field_name = "active_power_limits" │ field_value = -166.65 │ valid_range = Dict{String,Any} with 2 entries: … │ valid_info.ist_struct = │ generator-3-1 (ThermalStandard): │ name: generator-3-1 │ available: true │ status: true │ bus: BUS 03 (Bus) │ active_power: 0.2 │ reactive_power: 0.21719000000000002 │ rating: 99.99080007680706 │ active_power_limits: (min = -99.99, max = 99.99) │ reactive_power_limits: (min = 0.0, max = 0.4) │ ramp_limits: (up = 0.9998999999999999, down = 0.9998999999999999) │ operation_cost: ThreePartCost │ base_power: 60.0 │ time_limits: nothing │ prime_mover: PrimeMovers.OT = 19 │ fuel: ThermalFuels.OTHER = 14 │ services: 0-element Array{Service,1} │ time_at_status: 1.0e6 │ dynamic_injector: nothing │ ext: Dict{String,Any}("z_source" => (r = 0.0, x = 0.13)) │ time_series_container: InfrastructureSystems.TimeSeriesContainer: 0 │ InfrastructureSystems.SystemUnitsSettings: │ base_value: 100.0 │ unit_system: UnitSystem.SYSTEM_BASE = 0 └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:228 [ Info: Reading branch data ┌ Warning: Rate 651.77 MW for BUS 02-BUS 04-i_4 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 1943.38 MW for BUS 01-BUS 02-i_1 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 1340.14 MW for BUS 09-BUS 10-i_12 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 527.26 MW for BUS 01-BUS 05-i_2 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 658.72 MW for BUS 03-BUS 04-i_6 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 1099.9 MW for BUS 07-BUS 09-i_11 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 405.0 MW for BUS 09-BUS 14-i_13 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 661.32 MW for BUS 02-BUS 05-i_5 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 406.15 MW for BUS 12-BUS 13-i_15 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 312.07 MW for BUS 13-BUS 14-i_16 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 579.33 MW for BUS 10-BUS 11-i_14 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 2739.08 MW for BUS 04-BUS 05-i_7 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 548.97 MW for BUS 06-BUS 11-i_8 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 828.18 MW for BUS 06-BUS 13-i_10 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 426.35 MW for BUS 06-BUS 12-i_9 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 594.68 MW for BUS 02-BUS 03-i_3 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 [ Info: Reading branch data [ Info: Reading DC Line data [ Info: Reading storage data [ Info: Generators provided in .dyr, without a generator in .raw file will be skipped. ┌ Warning: struct DynamicGenerator does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51 ┌ Warning: struct DynamicGenerator does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51 ┌ Warning: struct DynamicGenerator does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51 ┌ Warning: struct DynamicGenerator does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51 ┌ Warning: struct DynamicGenerator does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51
Base Power: 100.0
Num components: 77
ConcreteType | SuperTypes | |
---|---|---|
String | String | |
1 | Arc | Topology <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
2 | Area | AggregationTopology <: Topology <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
3 | Bus | Topology <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
4 | DynamicGenerator{RoundRotorQuadratic,SingleMass,ESAC1A,GasTG,PSSFixed} | DynamicInjection <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
5 | DynamicGenerator{RoundRotorQuadratic,SingleMass,ESAC1A,TGFixed,PSSFixed} | DynamicInjection <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
6 | Line | ACBranch <: Branch <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
7 | LoadZone | AggregationTopology <: Topology <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
8 | PowerLoad | StaticLoad <: ElectricLoad <: StaticInjection <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
9 | TapTransformer | ACBranch <: Branch <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
10 | ThermalStandard | ThermalGen <: Generator <: StaticInjection <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
11 | Transformer2W | ACBranch <: Branch <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
Components with time series data: 0
Total StaticTimeSeries: 0
Total Forecasts: 0
Resolution: 0 seconds
Define Simulation Problem with a 20 second simulation period and the branch trip at t = 1.0
sim = PSID.Simulation(
file_dir, #path for the simulation output
sys, #system
(0.0, 20.0), #time span
BranchTrip(1.0, "BUS 02-BUS 04-i_4");
console_level = Logging.Info,
)
[ Info: Serialized time series data to /var/folders/27/2jr8c7gn4j72fvrg4qt81zrw8w_711/T/jl_Ynz8dS/sys_time_series_storage.h5. [ Info: Serialized System to /var/folders/27/2jr8c7gn4j72fvrg4qt81zrw8w_711/T/jl_Ynz8dS/sys.json [ Info: Loaded time series from storage file existing=sys_time_series_storage.h5 new=/var/folders/27/2jr8c7gn4j72fvrg4qt81zrw8w_711/T/jl_39VPVV ┌ Warning: Rate 2739.08 MW for BUS 04-BUS 05-i_7 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 406.15 MW for BUS 12-BUS 13-i_15 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 661.32 MW for BUS 02-BUS 05-i_5 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 527.26 MW for BUS 01-BUS 05-i_2 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 579.33 MW for BUS 10-BUS 11-i_14 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 828.18 MW for BUS 06-BUS 13-i_10 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 405.0 MW for BUS 09-BUS 14-i_13 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 594.68 MW for BUS 02-BUS 03-i_3 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 548.97 MW for BUS 06-BUS 11-i_8 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 651.77 MW for BUS 02-BUS 04-i_4 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 658.72 MW for BUS 03-BUS 04-i_6 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 312.07 MW for BUS 13-BUS 14-i_16 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 426.35 MW for BUS 06-BUS 12-i_9 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 1340.14 MW for BUS 09-BUS 10-i_12 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 1099.9 MW for BUS 07-BUS 09-i_11 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 1943.38 MW for BUS 01-BUS 02-i_1 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: struct DynamicGenerator does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51 ┌ Warning: struct DynamicGenerator does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51 ┌ Warning: struct DynamicGenerator does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51 ┌ Warning: struct DynamicGenerator does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51 ┌ Warning: struct DynamicGenerator does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51 ┌ Warning: Invalid range │ valid_info.struct_name = "ThermalStandard" │ field_name = "active_power_limits" │ field_value = -166.65 │ valid_range = Dict{String,Any} with 2 entries: … │ valid_info.ist_struct = │ generator-3-1 (ThermalStandard): │ name: generator-3-1 │ available: true │ status: true │ bus: BUS 03 (Bus) │ active_power: 0.2 │ reactive_power: 0.21719000000000002 │ rating: 99.99080007680706 │ active_power_limits: (min = -99.99, max = 99.99) │ reactive_power_limits: (min = 0.0, max = 0.4) │ ramp_limits: (up = 0.9998999999999999, down = 0.9998999999999999) │ operation_cost: ThreePartCost │ base_power: 60.0 │ time_limits: nothing │ prime_mover: PrimeMovers.OT = 19 │ fuel: ThermalFuels.OTHER = 14 │ services: 0-element Array{Service,1} │ time_at_status: 1.0e6 │ dynamic_injector: generator-3-1 (DynamicGenerator{RoundRotorQuadratic,SingleMass,ESAC1A,TGFixed,PSSFixed}) │ ext: Dict{String,Any}("z_source" => Dict{String,Any}("x" => 0.13,"r" => 0)) │ time_series_container: InfrastructureSystems.TimeSeriesContainer: 0 │ InfrastructureSystems.SystemUnitsSettings: │ base_value: 100.0 │ unit_system: UnitSystem.SYSTEM_BASE = 0 └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:228 ┌ Warning: struct DynamicGenerator does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51 ┌ Warning: Invalid range │ valid_info.struct_name = "ThermalStandard" │ field_name = "active_power_limits" │ field_value = -399.96 │ valid_range = Dict{String,Any} with 2 entries: … │ valid_info.ist_struct = │ generator-8-1 (ThermalStandard): │ name: generator-8-1 │ available: true │ status: true │ bus: BUS 08 (Bus) │ active_power: 0.1 │ reactive_power: 0.22292 │ rating: 99.99028802838804 │ active_power_limits: (min = -99.99, max = 99.99) │ reactive_power_limits: (min = -0.06, max = 0.24) │ ramp_limits: (up = 0.9998999999999999, down = 0.9998999999999999) │ operation_cost: ThreePartCost │ base_power: 25.0 │ time_limits: nothing │ prime_mover: PrimeMovers.OT = 19 │ fuel: ThermalFuels.OTHER = 14 │ services: 0-element Array{Service,1} │ time_at_status: 1.0e6 │ dynamic_injector: generator-8-1 (DynamicGenerator{RoundRotorQuadratic,SingleMass,ESAC1A,TGFixed,PSSFixed}) │ ext: Dict{String,Any}("z_source" => Dict{String,Any}("x" => 0.12,"r" => 0)) │ time_series_container: InfrastructureSystems.TimeSeriesContainer: 0 │ InfrastructureSystems.SystemUnitsSettings: │ base_value: 100.0 │ unit_system: UnitSystem.SYSTEM_BASE = 0 └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:228 ┌ Warning: struct DynamicGenerator does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51 ┌ Warning: Invalid range │ valid_info.struct_name = "ThermalStandard" │ field_name = "active_power_limits" │ field_value = -16.258536585365853 │ valid_range = Dict{String,Any} with 2 entries: … │ valid_info.ist_struct = │ generator-1-1 (ThermalStandard): │ name: generator-1-1 │ available: true │ status: true │ bus: BUS 01 (Bus) │ active_power: 1.9333000000000002 │ reactive_power: 0.01121 │ rating: 100.48880584423323 │ active_power_limits: (min = -99.99, max = 99.99) │ reactive_power_limits: (min = -10.0, max = 10.0) │ ramp_limits: (up = 0.9998999999999999, down = 0.9998999999999999) │ operation_cost: ThreePartCost │ base_power: 615.0 │ time_limits: nothing │ prime_mover: PrimeMovers.OT = 19 │ fuel: ThermalFuels.OTHER = 14 │ services: 0-element Array{Service,1} │ time_at_status: 1.0e6 │ dynamic_injector: generator-1-1 (DynamicGenerator{RoundRotorQuadratic,SingleMass,ESAC1A,GasTG,PSSFixed}) │ ext: Dict{String,Any}("z_source" => Dict{String,Any}("x" => 0.23,"r" => 0)) │ time_series_container: InfrastructureSystems.TimeSeriesContainer: 0 │ InfrastructureSystems.SystemUnitsSettings: │ base_value: 100.0 │ unit_system: UnitSystem.SYSTEM_BASE = 0 └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:228 ┌ Warning: struct DynamicGenerator does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51 ┌ Warning: Invalid range │ valid_info.struct_name = "ThermalStandard" │ field_name = "active_power_limits" │ field_value = -166.65 │ valid_range = Dict{String,Any} with 2 entries: … │ valid_info.ist_struct = │ generator-2-1 (ThermalStandard): │ name: generator-2-1 │ available: true │ status: true │ bus: BUS 02 (Bus) │ active_power: 0.3 │ reactive_power: 0.27015999999999996 │ rating: 99.99125011719775 │ active_power_limits: (min = -99.99, max = 99.99) │ reactive_power_limits: (min = -0.4, max = 0.5) │ ramp_limits: (up = 0.9998999999999999, down = 0.9998999999999999) │ operation_cost: ThreePartCost │ base_power: 60.0 │ time_limits: nothing │ prime_mover: PrimeMovers.OT = 19 │ fuel: ThermalFuels.OTHER = 14 │ services: 0-element Array{Service,1} │ time_at_status: 1.0e6 │ dynamic_injector: generator-2-1 (DynamicGenerator{RoundRotorQuadratic,SingleMass,ESAC1A,TGFixed,PSSFixed}) │ ext: Dict{String,Any}("z_source" => Dict{String,Any}("x" => 0.13,"r" => 0)) │ time_series_container: InfrastructureSystems.TimeSeriesContainer: 0 │ InfrastructureSystems.SystemUnitsSettings: │ base_value: 100.0 │ unit_system: UnitSystem.SYSTEM_BASE = 0 └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:228 ┌ Warning: struct DynamicGenerator does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51 ┌ Warning: Invalid range │ valid_info.struct_name = "ThermalStandard" │ field_name = "active_power_limits" │ field_value = -399.96 │ valid_range = Dict{String,Any} with 2 entries: … │ valid_info.ist_struct = │ generator-6-1 (ThermalStandard): │ name: generator-6-1 │ available: true │ status: true │ bus: BUS 06 (Bus) │ active_power: 0.15 │ reactive_power: 0.14800000000000002 │ rating: 99.99028802838804 │ active_power_limits: (min = -99.99, max = 99.99) │ reactive_power_limits: (min = -0.06, max = 0.24) │ ramp_limits: (up = 0.9998999999999999, down = 0.9998999999999999) │ operation_cost: ThreePartCost │ base_power: 25.0 │ time_limits: nothing │ prime_mover: PrimeMovers.OT = 19 │ fuel: ThermalFuels.OTHER = 14 │ services: 0-element Array{Service,1} │ time_at_status: 1.0e6 │ dynamic_injector: generator-6-1 (DynamicGenerator{RoundRotorQuadratic,SingleMass,ESAC1A,TGFixed,PSSFixed}) │ ext: Dict{String,Any}("z_source" => Dict{String,Any}("x" => 0.12,"r" => 0)) │ time_series_container: InfrastructureSystems.TimeSeriesContainer: 0 │ InfrastructureSystems.SystemUnitsSettings: │ base_value: 100.0 │ unit_system: UnitSystem.SYSTEM_BASE = 0 └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:228 ┌ Warning: struct DynamicGenerator does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51 [ Info: Unit System changed to UnitSystem.DEVICE_BASE = 1 [ Info: The System has no islands [ Info: Initializing Simulation States [ Info: Unit System changed to UnitSystem.SYSTEM_BASE = 0 [ Info: The System has no islands [ Info: PowerFlow solve converged, the results have been stored in the system [ Info: Unit System changed to UnitSystem.DEVICE_BASE = 1 [ Info: Attaching Perturbations [ Info: Completed Build Successfully. Simulations status = BUILT
Simulation()
Now that the system is initialized, we can verify the system states for potential issues.
print_device_states(sim)
Voltage Variables ==================== BUS 01 ==================== Vm 1.06 θ 0.0 ==================== BUS 02 ==================== Vm 1.04 θ -0.0711 ==================== BUS 03 ==================== Vm 1.01 θ -0.1787 ==================== BUS 04 ==================== Vm 1.0129 θ -0.1458 ==================== BUS 05 ==================== Vm 1.0165 θ -0.1235 ==================== BUS 06 ==================== Vm 1.06 θ -0.1949 ==================== BUS 07 ==================== Vm 1.0438 θ -0.1812 ==================== BUS 08 ==================== Vm 1.08 θ -0.1656 ==================== BUS 09 ==================== Vm 1.0263 θ -0.2102 ==================== BUS 10 ==================== Vm 1.0245 θ -0.2125 ==================== BUS 11 ==================== Vm 1.0384 θ -0.2059 ==================== BUS 12 ==================== Vm 1.0436 θ -0.2105 ==================== BUS 13 ==================== Vm 1.0372 θ -0.2119 ==================== BUS 14 ==================== Vm 1.0126 θ -0.2291 ==================== ==================== Differential States generator-1-1 ==================== eq_p 1.0604 ed_p -0.0111 ψ_kd 1.0563 ψ_kq 0.1134 δ 0.1684 ω 1.0 Vm 1.06 Vr1 0.0049 Vr2 1.951 Ve 1.4049 Vr3 -0.0585 x_g1 0.3144 x_g2 0.3144 x_g3 0.3144 ==================== Differential States generator-3-1 ==================== eq_p 1.0649 ed_p 0.1243 ψ_kd 0.9872 ψ_kq 0.2132 δ 0.034 ω 1.0 Vm 1.01 Vr1 0.006 Vr2 2.419 Ve 1.791 Vr3 -0.0726 ==================== Differential States generator-8-1 ==================== eq_p 1.2657 ed_p 0.0462 ψ_kd 1.1584 ψ_kq 0.1748 δ 0.019 ω 1.0 Vm 1.08 Vr1 0.0097 Vr2 3.9162 Ve 2.8839 Vr3 -0.1175 ==================== Differential States generator-2-1 ==================== eq_p 1.1038 ed_p 0.1491 ψ_kd 1.003 ψ_kq 0.2748 δ 0.1963 ω 1.0 Vm 1.04 Vr1 0.0071 Vr2 2.8613 Ve 2.1338 Vr3 -0.0858 ==================== Differential States generator-6-1 ==================== eq_p 1.167 ed_p 0.0955 ψ_kd 1.08 ψ_kq 0.3084 δ 0.1387 ω 1.0 Vm 1.06 Vr1 0.0082 Vr2 3.2875 Ve 2.4472 Vr3 -0.0986 ====================
We execute the simulation with an additional tolerance for the solver set at 1e-8.
PSID.execute!(sim, IDA(); abstol = 1e-8)
Using PowerSimulationsDynamics
tools for exploring the results, we can plot all the voltage
results for the buses
p = plot()
for b in get_components(Bus, sys)
voltage_series = get_voltagemag_series(sim, get_number(b))
plot!(
p,
voltage_series;
xlabel = "Time",
ylabel = "Voltage Magnitude [pu]",
label = "Bus - $(get_name(b))",
)
end
img = DisplayAs.PNG(p) # This line is only needed because of literate use display(p) when running locally
We can also explore the frequency of the different generators
p2 = plot()
for g in get_components(ThermalStandard, sys)
state_series = get_state_series(sim, (get_name(g), :ω))
plot!(
p2,
state_series;
xlabel = "Time",
ylabel = "Speed [pu]",
label = "$(get_name(g)) - ω",
)
end
img = DisplayAs.PNG(p2) # This line is only needed because of literate use display(p2) when running locally
It is also possible to explore the small signal stability of this system we created. However, Since a simulation has already taken place, we need to reset the model.
res = small_signal_analysis(sim; reset_simulation = true)
[ Info: Rebuilding the simulation after reset [ Info: Unit System changed to UnitSystem.DEVICE_BASE = 1 [ Info: The System has no islands [ Info: Initializing Simulation States [ Info: Unit System changed to UnitSystem.SYSTEM_BASE = 0 [ Info: The System has no islands [ Info: PowerFlow solve converged, the results have been stored in the system [ Info: Unit System changed to UnitSystem.DEVICE_BASE = 1 [ Info: Attaching Perturbations [ Info: Completed Build Successfully. Simulations status = BUILT [ Info: Simulation reset to status BUILT ┌ Warning: No Infinite Bus found. Confirm stability directly checking eigenvalues. │ If all eigenvalues are on the left-half plane and only one eigenvalue is zero, the system is small signal stable. └ @ PowerSimulationsDynamics ~/.julia/packages/PowerSimulationsDynamics/HqcnV/src/base/small_signal.jl:89 ┌ Info: Eigenvalues are: │ -1000.0000000000014 + 0.0im │ -1000.0000000000009 + 0.0im │ -1000.0000000000002 + 0.0im │ -999.9999999999998 + 0.0im │ -999.9999999999994 + 0.0im │ -51.807502094887305 + 0.0im │ -51.66123303723068 + 0.0im │ -51.49196116847845 + 0.0im │ -51.48204797296263 + 0.0im │ -51.38460395958913 + 0.0im │ -43.606770822347016 + 0.0im │ -36.89352970900156 + 0.0im │ -33.31097212895758 + 0.0im │ -30.40864223348849 + 0.0im │ -28.01655761625278 + 0.0im │ -23.88123468187301 + 0.0im │ -20.770613941795236 + 0.0im │ -18.298812818468587 + 0.0im │ -15.817280799219855 + 0.0im │ -12.4535351731598 + 0.0im │ -7.386324091020085 + 0.0im │ -6.703133543800532 + 0.0im │ -5.276882204482481 + 0.0im │ -4.5126237915183145 + 0.0im │ -4.473060547983035 - 10.72465167518535im │ -4.473060547983035 + 10.72465167518535im │ -3.7758166100050334 - 10.229252854125122im │ -3.7758166100050334 + 10.229252854125122im │ -3.742914873327555 - 9.915880591116311im │ -3.742914873327555 + 9.915880591116311im │ -2.6700435249538588 - 8.718145502364601im │ -2.6700435249538588 + 8.718145502364601im │ -2.413324071441693 - 7.998019427009456im │ -2.413324071441693 + 7.998019427009456im │ -2.3466700384540498 - 8.544936857679344im │ -2.3466700384540498 + 8.544936857679344im │ -2.2736098985790534 - 8.930102316891308im │ -2.2736098985790534 + 8.930102316891308im │ -1.921996374355548 + 0.0im │ -1.6595628314344688 + 0.0im │ -1.568604674011719 - 1.9420692161219602im │ -1.568604674011719 + 1.9420692161219602im │ -1.304344028522091 - 8.826562169098914im │ -1.304344028522091 + 8.826562169098914im │ -1.2863044260315994 + 0.0im │ -1.189196636506337 - 0.12712066641976974im │ -1.189196636506337 + 0.12712066641976974im │ -0.9782745903713628 - 0.06936177246604834im │ -0.9782745903713628 + 0.06936177246604834im │ -0.8488982894117668 - 0.498701658187088im │ -0.8488982894117668 + 0.498701658187088im │ -0.6457299452858358 - 0.19425247186886496im │ -0.6457299452858358 + 0.19425247186886496im │ -0.49499928165816176 + 0.0im │ -0.4167034353505496 + 0.0im │ -0.33954022474042556 - 7.568615170969771im │ -0.33954022474042556 + 7.568615170969771im └ 0.0 + 0.0im
The system is small signal stable
The eigenvalues can be explored visually
scatter(res.eigenvalues; legend = false)
Reload the system for this example
sys = System(joinpath(file_dir, "14bus.raw"), joinpath(file_dir, "dyn_data.dyr"))
[ Info: The PSS(R)E parser currently supports buses, loads, shunts, generators, branches, transformers, and dc lines [ Info: The following fields in GENERATOR are missing: O2, F2, O3, F3, O4, F4, WMOD, WPF [ Info: The following fields in GENERATOR are missing: O2, F2, O3, F3, O4, F4, WMOD, WPF [ Info: The following fields in GENERATOR are missing: O2, F2, O3, F3, O4, F4, WMOD, WPF [ Info: The following fields in GENERATOR are missing: O2, F2, O3, F3, O4, F4, WMOD, WPF [ Info: The following fields in GENERATOR are missing: O2, F2, O3, F3, O4, F4, WMOD, WPF [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: The following fields in BRANCH are missing: O2, F2, O3, F3, O4, F4 [ Info: angmin and angmax values are 0, widening these values on branch 4 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 1 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 12 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 20 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 2 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 6 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 11 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 13 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 5 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 15 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 16 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 14 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 7 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 8 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 17 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 10 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 19 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 9 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 18 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 3 to +/- 60.0 deg. [ Info: this code only supports positive rate_a values, changing the value on branch 4 to 651.7693 [ Info: this code only supports positive rate_a values, changing the value on branch 1 to 1943.3753 [ Info: this code only supports positive rate_a values, changing the value on branch 12 to 1340.1421 [ Info: this code only supports positive rate_a values, changing the value on branch 20 to 686.916 [ Info: this code only supports positive rate_a values, changing the value on branch 2 to 527.2551 [ Info: this code only supports positive rate_a values, changing the value on branch 6 to 658.7239 [ Info: this code only supports positive rate_a values, changing the value on branch 11 to 1099.9023 [ Info: this code only supports positive rate_a values, changing the value on branch 13 to 404.9974 [ Info: this code only supports positive rate_a values, changing the value on branch 5 to 661.3166 [ Info: this code only supports positive rate_a values, changing the value on branch 15 to 406.1471 [ Info: this code only supports positive rate_a values, changing the value on branch 16 to 312.073 [ Info: this code only supports positive rate_a values, changing the value on branch 14 to 579.3328 [ Info: this code only supports positive rate_a values, changing the value on branch 7 to 2739.0808 [ Info: this code only supports positive rate_a values, changing the value on branch 8 to 548.9677 [ Info: this code only supports positive rate_a values, changing the value on branch 17 to 578.6164 [ Info: this code only supports positive rate_a values, changing the value on branch 10 to 828.1844 [ Info: this code only supports positive rate_a values, changing the value on branch 19 to 480.1216 [ Info: this code only supports positive rate_a values, changing the value on branch 9 to 426.3491 [ Info: this code only supports positive rate_a values, changing the value on branch 18 to 217.5559 [ Info: this code only supports positive rate_a values, changing the value on branch 3 to 594.6825 ┌ Info: Constructing System from Power Models │ data["name"] = "14bus" └ data["source_type"] = "pti" [ Info: Reading bus data [ Info: Reading generator data ┌ Warning: Invalid range │ valid_info.struct_name = "ThermalStandard" │ field_name = "active_power_limits" │ field_value = -399.96 │ valid_range = Dict{String,Any} with 2 entries: … │ valid_info.ist_struct = │ generator-6-1 (ThermalStandard): │ name: generator-6-1 │ available: true │ status: true │ bus: BUS 06 (Bus) │ active_power: 0.15 │ reactive_power: 0.14800000000000002 │ rating: 99.99028802838804 │ active_power_limits: (min = -99.99, max = 99.99) │ reactive_power_limits: (min = -0.06, max = 0.24) │ ramp_limits: (up = 0.9998999999999999, down = 0.9998999999999999) │ operation_cost: ThreePartCost │ base_power: 25.0 │ time_limits: nothing │ prime_mover: PrimeMovers.OT = 19 │ fuel: ThermalFuels.OTHER = 14 │ services: 0-element Array{Service,1} │ time_at_status: 1.0e6 │ dynamic_injector: nothing │ ext: Dict{String,Any}("z_source" => (r = 0.0, x = 0.12)) │ time_series_container: InfrastructureSystems.TimeSeriesContainer: 0 │ InfrastructureSystems.SystemUnitsSettings: │ base_value: 100.0 │ unit_system: UnitSystem.SYSTEM_BASE = 0 └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:228 ┌ Warning: Invalid range │ valid_info.struct_name = "ThermalStandard" │ field_name = "active_power_limits" │ field_value = -16.258536585365853 │ valid_range = Dict{String,Any} with 2 entries: … │ valid_info.ist_struct = │ generator-1-1 (ThermalStandard): │ name: generator-1-1 │ available: true │ status: true │ bus: BUS 01 (Bus) │ active_power: 1.9333000000000002 │ reactive_power: 0.01121 │ rating: 100.48880584423323 │ active_power_limits: (min = -99.99, max = 99.99) │ reactive_power_limits: (min = -10.0, max = 10.0) │ ramp_limits: (up = 0.9998999999999999, down = 0.9998999999999999) │ operation_cost: ThreePartCost │ base_power: 615.0 │ time_limits: nothing │ prime_mover: PrimeMovers.OT = 19 │ fuel: ThermalFuels.OTHER = 14 │ services: 0-element Array{Service,1} │ time_at_status: 1.0e6 │ dynamic_injector: nothing │ ext: Dict{String,Any}("z_source" => (r = 0.0, x = 0.23)) │ time_series_container: InfrastructureSystems.TimeSeriesContainer: 0 │ InfrastructureSystems.SystemUnitsSettings: │ base_value: 100.0 │ unit_system: UnitSystem.SYSTEM_BASE = 0 └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:228 ┌ Warning: Invalid range │ valid_info.struct_name = "ThermalStandard" │ field_name = "active_power_limits" │ field_value = -399.96 │ valid_range = Dict{String,Any} with 2 entries: … │ valid_info.ist_struct = │ generator-8-1 (ThermalStandard): │ name: generator-8-1 │ available: true │ status: true │ bus: BUS 08 (Bus) │ active_power: 0.1 │ reactive_power: 0.22292 │ rating: 99.99028802838804 │ active_power_limits: (min = -99.99, max = 99.99) │ reactive_power_limits: (min = -0.06, max = 0.24) │ ramp_limits: (up = 0.9998999999999999, down = 0.9998999999999999) │ operation_cost: ThreePartCost │ base_power: 25.0 │ time_limits: nothing │ prime_mover: PrimeMovers.OT = 19 │ fuel: ThermalFuels.OTHER = 14 │ services: 0-element Array{Service,1} │ time_at_status: 1.0e6 │ dynamic_injector: nothing │ ext: Dict{String,Any}("z_source" => (r = 0.0, x = 0.12)) │ time_series_container: InfrastructureSystems.TimeSeriesContainer: 0 │ InfrastructureSystems.SystemUnitsSettings: │ base_value: 100.0 │ unit_system: UnitSystem.SYSTEM_BASE = 0 └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:228 ┌ Warning: Invalid range │ valid_info.struct_name = "ThermalStandard" │ field_name = "active_power_limits" │ field_value = -166.65 │ valid_range = Dict{String,Any} with 2 entries: … │ valid_info.ist_struct = │ generator-2-1 (ThermalStandard): │ name: generator-2-1 │ available: true │ status: true │ bus: BUS 02 (Bus) │ active_power: 0.3 │ reactive_power: 0.27015999999999996 │ rating: 99.99125011719775 │ active_power_limits: (min = -99.99, max = 99.99) │ reactive_power_limits: (min = -0.4, max = 0.5) │ ramp_limits: (up = 0.9998999999999999, down = 0.9998999999999999) │ operation_cost: ThreePartCost │ base_power: 60.0 │ time_limits: nothing │ prime_mover: PrimeMovers.OT = 19 │ fuel: ThermalFuels.OTHER = 14 │ services: 0-element Array{Service,1} │ time_at_status: 1.0e6 │ dynamic_injector: nothing │ ext: Dict{String,Any}("z_source" => (r = 0.0, x = 0.13)) │ time_series_container: InfrastructureSystems.TimeSeriesContainer: 0 │ InfrastructureSystems.SystemUnitsSettings: │ base_value: 100.0 │ unit_system: UnitSystem.SYSTEM_BASE = 0 └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:228 ┌ Warning: Invalid range │ valid_info.struct_name = "ThermalStandard" │ field_name = "active_power_limits" │ field_value = -166.65 │ valid_range = Dict{String,Any} with 2 entries: … │ valid_info.ist_struct = │ generator-3-1 (ThermalStandard): │ name: generator-3-1 │ available: true │ status: true │ bus: BUS 03 (Bus) │ active_power: 0.2 │ reactive_power: 0.21719000000000002 │ rating: 99.99080007680706 │ active_power_limits: (min = -99.99, max = 99.99) │ reactive_power_limits: (min = 0.0, max = 0.4) │ ramp_limits: (up = 0.9998999999999999, down = 0.9998999999999999) │ operation_cost: ThreePartCost │ base_power: 60.0 │ time_limits: nothing │ prime_mover: PrimeMovers.OT = 19 │ fuel: ThermalFuels.OTHER = 14 │ services: 0-element Array{Service,1} │ time_at_status: 1.0e6 │ dynamic_injector: nothing │ ext: Dict{String,Any}("z_source" => (r = 0.0, x = 0.13)) │ time_series_container: InfrastructureSystems.TimeSeriesContainer: 0 │ InfrastructureSystems.SystemUnitsSettings: │ base_value: 100.0 │ unit_system: UnitSystem.SYSTEM_BASE = 0 └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:228 [ Info: Reading branch data ┌ Warning: Rate 651.77 MW for BUS 02-BUS 04-i_4 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 1943.38 MW for BUS 01-BUS 02-i_1 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 1340.14 MW for BUS 09-BUS 10-i_12 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 527.26 MW for BUS 01-BUS 05-i_2 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 658.72 MW for BUS 03-BUS 04-i_6 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 1099.9 MW for BUS 07-BUS 09-i_11 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 405.0 MW for BUS 09-BUS 14-i_13 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 661.32 MW for BUS 02-BUS 05-i_5 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 406.15 MW for BUS 12-BUS 13-i_15 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 312.07 MW for BUS 13-BUS 14-i_16 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 579.33 MW for BUS 10-BUS 11-i_14 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 2739.08 MW for BUS 04-BUS 05-i_7 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 548.97 MW for BUS 06-BUS 11-i_8 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 828.18 MW for BUS 06-BUS 13-i_10 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 426.35 MW for BUS 06-BUS 12-i_9 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 594.68 MW for BUS 02-BUS 03-i_3 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 [ Info: Reading branch data [ Info: Reading DC Line data [ Info: Reading storage data [ Info: Generators provided in .dyr, without a generator in .raw file will be skipped. ┌ Warning: struct DynamicGenerator does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51 ┌ Warning: struct DynamicGenerator does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51 ┌ Warning: struct DynamicGenerator does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51 ┌ Warning: struct DynamicGenerator does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51 ┌ Warning: struct DynamicGenerator does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51
Base Power: 100.0
Num components: 77
ConcreteType | SuperTypes | |
---|---|---|
String | String | |
1 | Arc | Topology <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
2 | Area | AggregationTopology <: Topology <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
3 | Bus | Topology <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
4 | DynamicGenerator{RoundRotorQuadratic,SingleMass,ESAC1A,GasTG,PSSFixed} | DynamicInjection <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
5 | DynamicGenerator{RoundRotorQuadratic,SingleMass,ESAC1A,TGFixed,PSSFixed} | DynamicInjection <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
6 | Line | ACBranch <: Branch <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
7 | LoadZone | AggregationTopology <: Topology <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
8 | PowerLoad | StaticLoad <: ElectricLoad <: StaticInjection <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
9 | TapTransformer | ACBranch <: Branch <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
10 | ThermalStandard | ThermalGen <: Generator <: StaticInjection <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
11 | Transformer2W | ACBranch <: Branch <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
Components with time series data: 0
Total StaticTimeSeries: 0
Total Forecasts: 0
Resolution: 0 seconds
We want to remove the generator 6 and the dynamic component attached to it.
thermal_gen = get_component(ThermalStandard, sys, "generator-6-1")
remove_component!(sys, get_dynamic_injector(thermal_gen))
remove_component!(sys, thermal_gen)
We can now define our storage device and add it to the system
storage = GenericBattery(
name = "Battery",
bus = get_component(Bus, sys, "BUS 06"),
available = true,
prime_mover = PrimeMovers.BA,
active_power = 0.6,
reactive_power = 0.16,
rating = 1.1,
base_power = 25.0,
initial_energy = 50.0,
state_of_charge_limits = (min = 5.0, max = 100.0),
input_active_power_limits = (min = 0.0, max = 1.0),
output_active_power_limits = (min = 0.0, max = 1.0),
reactive_power_limits = (min = -1.0, max = 1.0),
efficiency = (in = 0.80, out = 0.90),
)
add_component!(sys, storage)
A good sanity check it running a power flow on the system to make sure all the components
are properly scaled and that the system is properly balanced. We can use PowerSystems
to
perform this check. We can get the results back and perform a sanity check
res = solve_powerflow(sys)
res["bus_results"]
[ Info: Unit System changed to UnitSystem.SYSTEM_BASE = 0 [ Info: The System has no islands [ Info: PowerFlow solve converged, the results are exported in DataFrames [ Info: Voltages are exported in pu. Powers are exported in MW/MVAr. [ Info: Unit System changed to UnitSystem.SYSTEM_BASE = 0
bus_number | Vm | θ | P_gen | P_load | P_net | Q_gen | Q_load | Q_net | |
---|---|---|---|---|---|---|---|---|---|
Int64 | Float64 | Float64 | Float64 | Float64 | Float64 | Float64 | Float64 | Float64 | |
1 | 1 | 1.06 | 0.0 | 193.33 | 0.0 | 193.33 | 1.12086 | 0.0 | 1.12086 |
2 | 2 | 1.04 | -0.0711029 | 30.0 | 21.7 | 8.3 | 27.0157 | 12.7 | 14.3157 |
3 | 3 | 1.01 | -0.178704 | 20.0 | 94.2 | -74.2 | 21.719 | 19.0 | 2.71896 |
4 | 4 | 1.01285 | -0.145825 | 0.0 | 47.8 | -47.8 | 0.0 | 0.0 | 0.0 |
5 | 5 | 1.01648 | -0.123536 | 0.0 | 7.6 | -7.6 | 0.0 | 1.6 | -1.6 |
6 | 6 | 1.06 | -0.194906 | 15.0 | 11.2 | 3.8 | 14.8004 | 7.5 | 7.3004 |
7 | 7 | 1.04377 | -0.181188 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
8 | 8 | 1.08 | -0.165561 | 10.0 | 0.0 | 10.0 | 22.2916 | 0.0 | 22.2916 |
9 | 9 | 1.02628 | -0.210231 | 0.0 | 29.5 | -29.5 | 0.0 | 16.6 | -16.6 |
10 | 10 | 1.02453 | -0.212546 | 0.0 | 9.0 | -9.0 | 0.0 | 5.8 | -5.8 |
11 | 11 | 1.03837 | -0.205887 | 0.0 | 3.5 | -3.5 | 0.0 | 1.8 | -1.8 |
12 | 12 | 1.04362 | -0.210542 | 0.0 | 6.1 | -6.1 | 0.0 | 1.6 | -1.6 |
13 | 13 | 1.03723 | -0.211859 | 0.0 | 13.5 | -13.5 | 0.0 | 5.8 | -5.8 |
14 | 14 | 1.01263 | -0.229125 | 0.0 | 14.9 | -14.9 | 0.0 | 5.0 | -5.0 |
After verifying that the system works, we can define our inverter dynamics and add it to the battery that has already been stored in the system.
inverter = DynamicInverter(
name = get_name(storage),
ω_ref = 1.0, # ω_ref,
converter = AverageConverter(rated_voltage = 138.0, rated_current = 100.0),
outer_control = OuterControl(
VirtualInertia(Ta = 2.0, kd = 400.0, kω = 20.0),
ReactivePowerDroop(kq = 0.2, ωf = 1000.0),
),
inner_control = CurrentControl(
kpv = 0.59, #Voltage controller proportional gain
kiv = 736.0, #Voltage controller integral gain
kffv = 0.0, #Binary variable enabling the voltage feed-forward in output of current controllers
rv = 0.0, #Virtual resistance in pu
lv = 0.2, #Virtual inductance in pu
kpc = 1.27, #Current controller proportional gain
kic = 14.3, #Current controller integral gain
kffi = 0.0, #Binary variable enabling the current feed-forward in output of current controllers
ωad = 50.0, #Active damping low pass filter cut-off frequency
kad = 0.2,
),
dc_source = FixedDCSource(voltage = 600.0),
freq_estimator = KauraPLL(
ω_lp = 500.0, #Cut-off frequency for LowPass filter of PLL filter.
kp_pll = 0.084, #PLL proportional gain
ki_pll = 4.69, #PLL integral gain
),
filter = LCLFilter(lf = 0.08, rf = 0.003, cf = 0.074, lg = 0.2, rg = 0.01),
)
add_component!(sys, inverter, storage)
┌ Warning: struct DynamicInverter does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51
These are the current system components:
sys
Base Power: 100.0
Num components: 77
ConcreteType | SuperTypes | |
---|---|---|
String | String | |
1 | Arc | Topology <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
2 | Area | AggregationTopology <: Topology <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
3 | Bus | Topology <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
4 | DynamicGenerator{RoundRotorQuadratic,SingleMass,ESAC1A,GasTG,PSSFixed} | DynamicInjection <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
5 | DynamicGenerator{RoundRotorQuadratic,SingleMass,ESAC1A,TGFixed,PSSFixed} | DynamicInjection <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
6 | DynamicInverter{AverageConverter,OuterControl{VirtualInertia,ReactivePowerDroop},CurrentControl,FixedDCSource,KauraPLL,LCLFilter} | DynamicInjection <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
7 | GenericBattery | Storage <: StaticInjection <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
8 | Line | ACBranch <: Branch <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
9 | LoadZone | AggregationTopology <: Topology <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
10 | PowerLoad | StaticLoad <: ElectricLoad <: StaticInjection <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
11 | TapTransformer | ACBranch <: Branch <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
12 | ThermalStandard | ThermalGen <: Generator <: StaticInjection <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
13 | Transformer2W | ACBranch <: Branch <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any |
Components with time series data: 0
Total StaticTimeSeries: 0
Total Forecasts: 0
Resolution: 0 seconds
Define Simulation problem using the same parameters:
sim = PSID.Simulation(
file_dir, #path for the simulation output
sys, #system
(0.0, 20.0), #time span
BranchTrip(1.0, "BUS 02-BUS 04-i_4");
console_level = Logging.Info,
)
[ Info: Serialized time series data to /var/folders/27/2jr8c7gn4j72fvrg4qt81zrw8w_711/T/jl_zMinxm/sys_time_series_storage.h5. [ Info: Serialized System to /var/folders/27/2jr8c7gn4j72fvrg4qt81zrw8w_711/T/jl_zMinxm/sys.json [ Info: Loaded time series from storage file existing=sys_time_series_storage.h5 new=/var/folders/27/2jr8c7gn4j72fvrg4qt81zrw8w_711/T/jl_uPswqc ┌ Warning: Rate 2739.08 MW for BUS 04-BUS 05-i_7 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 406.15 MW for BUS 12-BUS 13-i_15 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 661.32 MW for BUS 02-BUS 05-i_5 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 527.26 MW for BUS 01-BUS 05-i_2 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 579.33 MW for BUS 10-BUS 11-i_14 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 828.18 MW for BUS 06-BUS 13-i_10 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 405.0 MW for BUS 09-BUS 14-i_13 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 594.68 MW for BUS 02-BUS 03-i_3 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 548.97 MW for BUS 06-BUS 11-i_8 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 651.77 MW for BUS 02-BUS 04-i_4 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 658.72 MW for BUS 03-BUS 04-i_6 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 312.07 MW for BUS 13-BUS 14-i_16 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 426.35 MW for BUS 06-BUS 12-i_9 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 1340.14 MW for BUS 09-BUS 10-i_12 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 1099.9 MW for BUS 07-BUS 09-i_11 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 1943.38 MW for BUS 01-BUS 02-i_1 is larger than the max expected in the range of (min = 12.0, max = 13.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: struct DynamicInverter does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51 ┌ Warning: struct DynamicGenerator does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51 ┌ Warning: struct DynamicGenerator does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51 ┌ Warning: struct DynamicGenerator does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51 ┌ Warning: struct DynamicGenerator does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51 ┌ Warning: struct DynamicInverter does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51 ┌ Warning: Invalid range │ valid_info.struct_name = "ThermalStandard" │ field_name = "active_power_limits" │ field_value = -166.65 │ valid_range = Dict{String,Any} with 2 entries: … │ valid_info.ist_struct = │ generator-3-1 (ThermalStandard): │ name: generator-3-1 │ available: true │ status: true │ bus: BUS 03 (Bus) │ active_power: 0.2 │ reactive_power: 0.21719000000000002 │ rating: 99.99080007680706 │ active_power_limits: (min = -99.99, max = 99.99) │ reactive_power_limits: (min = 0.0, max = 0.4) │ ramp_limits: (up = 0.9998999999999999, down = 0.9998999999999999) │ operation_cost: ThreePartCost │ base_power: 60.0 │ time_limits: nothing │ prime_mover: PrimeMovers.OT = 19 │ fuel: ThermalFuels.OTHER = 14 │ services: 0-element Array{Service,1} │ time_at_status: 1.0e6 │ dynamic_injector: generator-3-1 (DynamicGenerator{RoundRotorQuadratic,SingleMass,ESAC1A,TGFixed,PSSFixed}) │ ext: Dict{String,Any}("z_source" => Dict{String,Any}("x" => 0.13,"r" => 0)) │ time_series_container: InfrastructureSystems.TimeSeriesContainer: 0 │ InfrastructureSystems.SystemUnitsSettings: │ base_value: 100.0 │ unit_system: UnitSystem.SYSTEM_BASE = 0 └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:228 ┌ Warning: struct DynamicGenerator does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51 ┌ Warning: Invalid range │ valid_info.struct_name = "ThermalStandard" │ field_name = "active_power_limits" │ field_value = -399.96 │ valid_range = Dict{String,Any} with 2 entries: … │ valid_info.ist_struct = │ generator-8-1 (ThermalStandard): │ name: generator-8-1 │ available: true │ status: true │ bus: BUS 08 (Bus) │ active_power: 0.1 │ reactive_power: 0.22292 │ rating: 99.99028802838804 │ active_power_limits: (min = -99.99, max = 99.99) │ reactive_power_limits: (min = -0.06, max = 0.24) │ ramp_limits: (up = 0.9998999999999999, down = 0.9998999999999999) │ operation_cost: ThreePartCost │ base_power: 25.0 │ time_limits: nothing │ prime_mover: PrimeMovers.OT = 19 │ fuel: ThermalFuels.OTHER = 14 │ services: 0-element Array{Service,1} │ time_at_status: 1.0e6 │ dynamic_injector: generator-8-1 (DynamicGenerator{RoundRotorQuadratic,SingleMass,ESAC1A,TGFixed,PSSFixed}) │ ext: Dict{String,Any}("z_source" => Dict{String,Any}("x" => 0.12,"r" => 0)) │ time_series_container: InfrastructureSystems.TimeSeriesContainer: 0 │ InfrastructureSystems.SystemUnitsSettings: │ base_value: 100.0 │ unit_system: UnitSystem.SYSTEM_BASE = 0 └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:228 ┌ Warning: struct DynamicGenerator does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51 ┌ Warning: Invalid range │ valid_info.struct_name = "ThermalStandard" │ field_name = "active_power_limits" │ field_value = -16.258536585365853 │ valid_range = Dict{String,Any} with 2 entries: … │ valid_info.ist_struct = │ generator-1-1 (ThermalStandard): │ name: generator-1-1 │ available: true │ status: true │ bus: BUS 01 (Bus) │ active_power: 1.9333000000000002 │ reactive_power: 0.01121 │ rating: 100.48880584423323 │ active_power_limits: (min = -99.99, max = 99.99) │ reactive_power_limits: (min = -10.0, max = 10.0) │ ramp_limits: (up = 0.9998999999999999, down = 0.9998999999999999) │ operation_cost: ThreePartCost │ base_power: 615.0 │ time_limits: nothing │ prime_mover: PrimeMovers.OT = 19 │ fuel: ThermalFuels.OTHER = 14 │ services: 0-element Array{Service,1} │ time_at_status: 1.0e6 │ dynamic_injector: generator-1-1 (DynamicGenerator{RoundRotorQuadratic,SingleMass,ESAC1A,GasTG,PSSFixed}) │ ext: Dict{String,Any}("z_source" => Dict{String,Any}("x" => 0.23,"r" => 0)) │ time_series_container: InfrastructureSystems.TimeSeriesContainer: 0 │ InfrastructureSystems.SystemUnitsSettings: │ base_value: 100.0 │ unit_system: UnitSystem.SYSTEM_BASE = 0 └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:228 ┌ Warning: struct DynamicGenerator does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51 ┌ Warning: Invalid range │ valid_info.struct_name = "ThermalStandard" │ field_name = "active_power_limits" │ field_value = -166.65 │ valid_range = Dict{String,Any} with 2 entries: … │ valid_info.ist_struct = │ generator-2-1 (ThermalStandard): │ name: generator-2-1 │ available: true │ status: true │ bus: BUS 02 (Bus) │ active_power: 0.3 │ reactive_power: 0.27015999999999996 │ rating: 99.99125011719775 │ active_power_limits: (min = -99.99, max = 99.99) │ reactive_power_limits: (min = -0.4, max = 0.5) │ ramp_limits: (up = 0.9998999999999999, down = 0.9998999999999999) │ operation_cost: ThreePartCost │ base_power: 60.0 │ time_limits: nothing │ prime_mover: PrimeMovers.OT = 19 │ fuel: ThermalFuels.OTHER = 14 │ services: 0-element Array{Service,1} │ time_at_status: 1.0e6 │ dynamic_injector: generator-2-1 (DynamicGenerator{RoundRotorQuadratic,SingleMass,ESAC1A,TGFixed,PSSFixed}) │ ext: Dict{String,Any}("z_source" => Dict{String,Any}("x" => 0.13,"r" => 0)) │ time_series_container: InfrastructureSystems.TimeSeriesContainer: 0 │ InfrastructureSystems.SystemUnitsSettings: │ base_value: 100.0 │ unit_system: UnitSystem.SYSTEM_BASE = 0 └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:228 ┌ Warning: struct DynamicGenerator does not exist in validation configuration file, validation skipped └ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/v75Hd/src/validation.jl:51 [ Info: Unit System changed to UnitSystem.DEVICE_BASE = 1 [ Info: The System has no islands [ Info: Initializing Simulation States [ Info: Unit System changed to UnitSystem.SYSTEM_BASE = 0 [ Info: The System has no islands [ Info: PowerFlow solve converged, the results have been stored in the system [ Info: Unit System changed to UnitSystem.DEVICE_BASE = 1 ┌ Warning: Initialization failed, initial conditions do not meet conditions for an stable equilibrium. │ Trying to solve again reducing numeric tolerance from 1.0e-9: └ @ PowerSimulationsDynamics ~/.julia/packages/PowerSimulationsDynamics/HqcnV/src/base/simulation_initialization.jl:117 [ Info: Initialization succeeded with a relaxed tolerance of 1.0e-6. Saving solution [ Info: Attaching Perturbations [ Info: Completed Build Successfully. Simulations status = BUILT
Simulation()
We can verify the small signal stability of the system before running the simulation:
res = small_signal_analysis(sim)
┌ Warning: No Infinite Bus found. Confirm stability directly checking eigenvalues. │ If all eigenvalues are on the left-half plane and only one eigenvalue is zero, the system is small signal stable. └ @ PowerSimulationsDynamics ~/.julia/packages/PowerSimulationsDynamics/HqcnV/src/base/small_signal.jl:89 ┌ Info: Eigenvalues are: │ -2274.2469750440414 - 6834.9069586386095im │ -2274.2469750440414 + 6834.9069586386095im │ -2102.367936395657 - 6526.604770463303im │ -2102.367936395657 + 6526.604770463303im │ -1605.2366971863967 - 292.6664161689679im │ -1605.2366971863967 + 292.6664161689679im │ -1000.0000000000009 + 0.0im │ -1000.0000000000003 + 0.0im │ -1000.0 + 0.0im │ -999.9999999999989 + 0.0im │ -984.449461144326 + 0.0im │ -499.9999999999987 + 0.0im │ -471.10004434838106 + 0.0im │ -223.53403479862283 + 0.0im │ -56.90163909202578 - 289.00694522337295im │ -56.90163909202578 + 289.00694522337295im │ -51.85095741537765 + 0.0im │ -51.53608624290841 + 0.0im │ -51.468087206497316 + 0.0im │ -51.39649987307159 + 0.0im │ -50.3524399583718 + 0.0im │ -50.28019655121397 + 0.0im │ -43.11041954380906 + 0.0im │ -36.86624356267333 + 0.0im │ -33.28289754683637 + 0.0im │ -29.7275731664875 + 0.0im │ -24.864038336061544 + 0.0im │ -20.759543837404244 + 0.0im │ -17.549135305830006 + 0.0im │ -13.170128547508595 + 0.0im │ -11.310043467840698 + 0.0im │ -11.176980179041552 + 0.0im │ -6.959056395568068 - 0.36524519711982284im │ -6.959056395568068 + 0.36524519711982284im │ -6.628223110733827 - 26.402111215751454im │ -6.628223110733827 + 26.402111215751454im │ -5.3125797666175085 - 0.14269957459448374im │ -5.3125797666175085 + 0.14269957459448374im │ -4.534720935357964 + 0.0im │ -3.847678181440572 - 9.993362504739203im │ -3.847678181440572 + 9.993362504739203im │ -3.615696930288592 - 10.480595189658755im │ -3.615696930288592 + 10.480595189658755im │ -2.5406664001369528 - 8.665901831268302im │ -2.5406664001369528 + 8.665901831268302im │ -2.4252661187203746 - 8.084946273995225im │ -2.4252661187203746 + 8.084946273995225im │ -2.1789359528755945 - 8.963911206888236im │ -2.1789359528755945 + 8.963911206888236im │ -1.9125339762107467 + 0.0im │ -1.5879211373085478 - 8.860537538480695im │ -1.5879211373085478 + 8.860537538480695im │ -1.5216689060985993 - 2.1166258806082263im │ -1.5216689060985993 + 2.1166258806082263im │ -1.448103829269238 + 0.0im │ -1.3105897902209567 + 0.0im │ -1.0674736791174282 - 0.1695193932714451im │ -1.0674736791174282 + 0.1695193932714451im │ -1.036594223264721 - 0.45335996937030665im │ -1.036594223264721 + 0.45335996937030665im │ -0.7286140353934802 + 0.0im │ -0.49998604215908005 + 0.0im │ -0.39218035801249895 - 7.452795054063343im │ -0.39218035801249895 + 7.452795054063343im │ -0.3145728821134344 + 0.0im └ 0.0 + 0.0im
The system is small signal stable
scatter(res.eigenvalues)
We execute the simulation
PSID.execute!(sim, IDA(); abstol = 1e-8)
[ Info: Rebuilding the simulation after reset [ Info: Unit System changed to UnitSystem.DEVICE_BASE = 1 [ Info: The System has no islands [ Info: Initializing Simulation States [ Info: Unit System changed to UnitSystem.SYSTEM_BASE = 0 [ Info: The System has no islands [ Info: PowerFlow solve converged, the results have been stored in the system [ Info: Unit System changed to UnitSystem.DEVICE_BASE = 1 ┌ Warning: Initialization failed, initial conditions do not meet conditions for an stable equilibrium. │ Trying to solve again reducing numeric tolerance from 1.0e-9: └ @ PowerSimulationsDynamics ~/.julia/packages/PowerSimulationsDynamics/HqcnV/src/base/simulation_initialization.jl:117 [ Info: Initialization succeeded with a relaxed tolerance of 1.0e-6. Saving solution [ Info: Attaching Perturbations [ Info: Completed Build Successfully. Simulations status = BUILT [ Info: Simulation reset to status BUILT
Using PowerSimulationsDynamics
tools for exploring the results, we can plot all the voltage
results for the buses
p = plot()
for b in get_components(Bus, sys)
voltage_series = get_voltagemag_series(sim, get_number(b))
plot!(
p,
voltage_series;
xlabel = "Time",
ylabel = "Voltage Magnitude [pu]",
label = "Bus - $(get_name(b))",
)
end
img = DisplayAs.PNG(p) # This line is only needed because of literate use display(p) when running locally
We can also explore the frequency of the different static generators and storage
p2 = plot()
for g in get_components(ThermalStandard, sys)
state_series = get_state_series(sim, (get_name(g), :ω))
plot!(
p2,
state_series;
xlabel = "Time",
ylabel = "Speed [pu]",
label = "$(get_name(g)) - ω",
)
end
state_series = get_state_series(sim, ("Battery", :ω_oc))
plot!(p2, state_series; xlabel = "Time", ylabel = "Speed [pu]", label = "Battery - ω")
img = DisplayAs.PNG(p2) # This line is only needed because of literate use display(p2) when running locally
This notebook was generated using Literate.jl.