Engee documentation
Notebook

Simulation of an ionistor system

This example will demonstrate a simulation of a system with an ionistor and a DC-DC converter designed to maintain a stable voltage across the load. Initially, the converter provides power to the load, which leads to a gradual decrease in voltage across the ionistor. When the 4 V threshold is reached, the protection circuit is activated, disconnecting the load. At 10 seconds, the generator turns on, and power is supplied to both the load and the capacitor to recharge it.

Model diagram:

ultracapacitor_converter--1743002263965.png

Defining the function to load and run the model:

In [ ]:
function start_model_engee()
    try
        engee.close("ultracapacitor_converter", force=true) # closing the model
        catch err # if there is no model to close and engee.close() is not executed, it will be loaded after catch.
            m = engee.load("$(@__DIR__)/ultracapacitor_converter.engee") # loading the model
        end;

    try
        engee.run(m, verbose=true) # launching the model
        catch err # if the model is not loaded and engee.run() is not executed, the bottom two lines after catch will be executed.
            m = engee.load("$(@__DIR__)/ultracapacitor_converter.engee") # loading the model
            engee.run(m, verbose=true) # launching the model
        end
end
Out[0]:
start_model_engee (generic function with 1 method)

Running the simulation

In [ ]:
start_model_engee();
Building...
Progress 0%
Progress 5%
Progress 11%
Progress 16%
Progress 21%
Progress 27%
Progress 33%
Progress 38%
Progress 43%
Progress 48%
Progress 53%
Progress 59%
Progress 64%
Progress 70%
Progress 75%
Progress 81%
Progress 86%
Progress 91%
Progress 97%
Progress 100%
Progress 100%

Writing simulation data to variables:

In [ ]:
t = simout["Load.i"].time[:]
load_current = simout["Load.i"].value[:]
ultracapacitor_current = simout["Ultra-capacitor.i"].value[:]
generator_current = simout["Generator/Diode.i"].value[:]
load_voltage = simout["Load.v"].value[:]
ultracapacitor_voltage = simout["Ultra-capacitor.v"].value[:]
Out[0]:
WorkspaceArray{Float64}("Ultra-capacitor.v").value

Data visualization

In [ ]:
using Plots
In [ ]:
plot(t, load_voltage, linewidth=2, label="Load")
plot!(t, ultracapacitor_voltage, linewidth=2, label="Ionistor", xlabel="Time, from", ylabel="For example, In")
Out[0]:
In [ ]:
plot(t, load_current, linewidth=2, label="Load")
plot!(t, ultracapacitor_current, linewidth=2, label="Ionistor")
plot!(t, generator_current, linewidth=2, label="The generator", xlabel="Time, from", ylabel="Current, A")
Out[0]:

Conclusions:

In this example, we have considered the model of an ionistor with a converter. The DC-DC converter provides power to the load. The low charge protection circuit turns off the load when the voltage across the ionistor drops below 4 V. At the 10th second, the generator turns on, which begins to power the load and charge the ionistor.