Engee documentation
Notebook

A power system model with a simplified synchronous generator

In this example, we will consider a synchronous generator (power_ssm.engee model) P=20 kW U= 24 kV, on the buses of which a base load (P= 10 kW and Q=100 Var) and a switching load (P=10 kW and Q=100 Var) are connected at time 0.1 (model power_ssm.engee).

Implementation of the model launch using software control:

In [ ]:
Pkg.add(["Statistics"])
In [ ]:
using Plots
using DataFrames
using Statistics
gr();

Loading the model:

In [ ]:
model_name = "power_ssm"
model_name in [m.name for m in engee.get_all_models()] ? engee.open(model_name) : engee.load( "$(@__DIR__)/$(model_name).engee");

Launching the uploaded model:

In [ ]:
results = engee.run(model_name)
Out[0]:
Dict{String, DataFrame} with 8 entries:
  "Q"   => 4001×2 DataFrame…
  "i_b" => 4001×2 DataFrame…
  "i_c" => 4001×2 DataFrame…
  "P"   => 4001×2 DataFrame…
  "v_b" => 4001×2 DataFrame…
  "v_a" => 4001×2 DataFrame…
  "i_a" => 4001×2 DataFrame…
  "v_c" => 4001×2 DataFrame

Reading data on instantaneous current and voltage values:

In [ ]:
t = results["i_a"].time;
i_a = results["i_a"].value;
i_b = results["i_b"].value;
i_c = results["i_c"].value;
v_a = results["v_a"].value;
v_b = results["v_b"].value;
v_c = results["v_c"].value;

Downloading and visualizing the data obtained during the simulation

Output of a graph of the dependence of instantaneous current values on time:

In [ ]:
plot(t, [i_a i_b i_c], label=["Ток фазы А" "Ток фазы В" "Ток фазы С"])
plot!(title = "Результаты моделирования в Engee", ylabel = "Мгновенное значение тока, А", xlabel="Время, c")
Out[0]:

Output of a graph of the dependence of instantaneous voltage values on time:

In [ ]:
plot(t, [v_a v_b v_c], label=["Напряжение фазы А" "Напряжение фазы В" "Напряжение фазы С"])
plot!(title = "Результаты моделирования в Engee", ylabel = "Мгновенное значение напряжения, В", xlabel="Время, c")
Out[0]:

Conclusions:

In this example, tools for command management of the Engee model were used. The model demonstrates the operation of a synchronous generator on a load that varies by leaps and bounds. The simulation results were imported into an interactive script, visualized using interactive graphs from the Plots library, and analyzed.