This repository contains the source code NisI: Non-Ideal System Identification using Particle Swarm Optimization (PSO) for the identification of systems with high parametric sensitivity in regions of chaotic operation.
In experimental studies of non-ideal dynamic models, typically due to physical or sensor limitations, only one state of the system is observed. In this context, NisI can perform the parametric identification of N unknown variables. The algorithm operates with each PSO particle acting as a fourth-order Runge-Kutta integrator, seeking the best approximation of the simulated model to the experimental data.
NisI provides an installation script to simplify its installation and usage. Some prerequisites are essential before preparing the environment.
Next, the script setting up the environment can be utilized.
$ make prepare-env
$ source venv/bin/activate
Now the environment with the nisi library is available. An example can be executed using the generic command provided below:
(venv)$ python examples/$(DYN_SYS_EXAMPLE)
Please replace the name
$(DYN_SYS_EXAMPLE)
with one of the examples or with a new script written by the user."
To demonstrate the parametric identification of a system in a chaotic regime, we will present the dynamic system of the Duffing oscillator.
So, the Non-Ideal model is described below:
where:
model parameter | value |
---|---|
non-ideal term | |
non-ideal term | |
0.5 | |
1.0 | |
-1.0 | |
unknown value | |
unknown value |
Dynamic Non-Ideal Model is define by the EqSystem
class:
class EqSystem(Model):
def __init__(self, params=None):
super().__init__(params)
self._params = params
def model(self, t, x, *args):
k = self.unknown_const
alpha = 0.5
beta = 1
delta = -1
omega = k[0]
F = k[1]
dx = np.zeros(len(self.x0),)
dx[0] = x[1]
dy[1] = -alpha*y[1] -delta*y[0] -beta*y[0]**3 + F*np.cos(y[2] + a_0*np.sin(b_0*y[2]+c_0))
dx[2] = omega
return dx
Next the parameter configurations need to provide:
params = {'optmizer': {'lowBound': [0.1 , 0.1],
'upBound': [5.0, 0.5],
'maxVelocity': 2,
'minVelocity': -2,
'nPop': 10,
'nVar': 2,
'social_weight': 2.0,
'cognitive_weight': 1.0,
'w': 0.9,
'beta': 0.1,
'w_damping': 0.999,
'escape_min_vel_percent': 0.0005,
'escape_min_error': 2e-3},
'dyn_system': {'model_path': '',
'external': None,
'state_mask' : [True, False, False],
'loss': 'rmse',
'x0': [0., 0., 0.],
't': [0,50,500]
}
}
Note, only one state was observed of system:
# x_0 x_1 x_2
state_mask: [True, False, False]
So, to run this example, please follow the steps above:
$(venv)$ python ./examples/duffing_oscilator_two_unknown_variables_one_state_observed.py
The simulation of the experimental system has the parameters
e: [8.7e-06], predict: [100000017 0.38499979]
An
modified_oscillator
model has been added to theexamples/
folder.
Please cite our work if you use it.
@article{Lima2024,
title = {NisI: A Tool for Non-Ideal System Identification},
DOI = {10.36227/techrxiv.170630655.56990506/v1},
publisher = {Institute of Electrical and Electronics Engineers (IEEE)},
author = {Lima, Jeferson José de and Kaster, Mauricio S and Martins, Marcella S R and Ribeiro, Mauricio A and Tusset, Angelo M and Balthazar, José M},
year = {2024},
month = jan
}
Please report bugs and request features using the issues