Modelling a system with an ionistor
This example will demonstrate the modelling 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 causes the voltage across the ionistor to gradually decrease. When the 4V threshold is reached, a protection circuit is triggered, disconnecting the load. At 10 seconds, the generator is switched on and power is supplied to both the load and the capacitor to recharge it.
Schematic diagram of the model:

Define the function to load and run the model:
function start_model_engee()
try
engee.close("ultracapacitor_converter", force=true) # закрытие модели
catch err # в случае, если нет модели, которую нужно закрыть и engee.close() не выполняется, то будет выполнена её загрузка после catch
m = engee.load("$(@__DIR__)/ultracapacitor_converter.engee") # загрузка модели
end;
try
engee.run(m, verbose=true) # запуск модели
catch err # в случае, если модель не загружена и engee.run() не выполняется, то будут выполнены две нижние строки после catch
m = engee.load("$(@__DIR__)/ultracapacitor_converter.engee") # загрузка модели
engee.run(m, verbose=true) # запуск модели
end
end
Running the simulation
start_model_engee();
Write simulation data to variables:
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[:]
Data visualisation
using Plots
plot(t, load_voltage, linewidth=2, label="Нагрузка")
plot!(t, ultracapacitor_voltage, linewidth=2, label="Ионистор", xlabel="Время, с", ylabel="Напражение, В")
plot(t, load_current, linewidth=2, label="Нагрузка")
plot!(t, ultracapacitor_current, linewidth=2, label="Ионистор")
plot!(t, generator_current, linewidth=2, label="Генератор", xlabel="Время, с", ylabel="Ток, А")
Conclusions:
In this example, we have considered an ionistor model with an inverter. The DC-DC converter provides power to the load. The low charge protection circuit disconnects the load when the voltage on the ionistor drops below 4V. At the 10th second, the generator is switched on, which starts to power the load and charge the ionistor.