The increasing global demand for energy, coupled with the environmental and societal challenges posed by extensive fossil fuel consumption, has accelerated the adoption of renewable energy sources. Among these, solar energy stands out due to its abundance and sustainability. A critical component in harnessing solar power for grid integration is the solar inverter, which performs the essential function of converting direct current (DC) generated by photovoltaic (PV) panels into alternating current (AC) suitable for the electrical grid. To optimize the performance, stability, and efficiency of grid-connected PV systems, a precise mathematical model of the solar inverter is indispensable. This necessitates accurate system identification, a process of building dynamic models from measured input-output data.
The core challenge in identifying solar inverter parameters lies in dealing with the system’s dynamic behavior under real-world operating conditions, which often involve measurement noise and time-varying characteristics. Traditional methods, such as the standard Least Squares (LS) algorithm, offer simplicity but suffer from biased estimates when the measurement noise is correlated (colored). The Generalized Least Squares (GLS) method addresses this by employing a whitening filter, yielding unbiased parameter estimates. However, its conventional batch-processing form lacks adaptability for real-time applications where data streams continuously. Conversely, the Recursive Least Squares (RLS) algorithm with a fixed forgetting factor provides real-time capability by discounting older data, but it may not handle non-stationary noise effectively and can struggle with tracking accuracy when system dynamics change.
This article presents a comprehensive methodology for the parameter identification of a solar inverter system. We treat the inverter as a linear multiple-input, multiple-output (MIMO) dynamic system. To overcome the limitations of existing methods, we propose a novel Variable Forgetting Factor Generalized Least Squares (VFF-GLS) algorithm. This method synergistically combines the unbiased estimation capability of the GLS with the tracking agility of a recursively implemented algorithm featuring an adaptive forgetting factor. The variable forgetting factor dynamically adjusts based on the prediction error, ensuring rapid adaptation during transients and high steady-state accuracy. We validate the algorithm’s effectiveness and real-time performance using actual operational data from an SG800MX-type grid-connected solar inverter through detailed MATLAB simulations.

Theoretical Foundation and Problem Formulation
A grid-connected solar inverter can be conceptually modeled as a “black-box” dynamic system. Its primary inputs are the DC-link voltage $U_d(k)$ and current $I_d(k)$ from the PV array, and its outputs are the grid-compliant AC voltage $U_{out}(k)$ and current $I_{out}(k)$. We assume this relationship can be described by a linear AutoRegressive with eXogenous input (ARX) model structure. For a multi-output system, this is represented by a set of difference equations:
$$ U_{out}(k) + \sum_{t=1}^{n} a_{1t} U_{out}(k-t) = \sum_{t=0}^{n} [b_{1t1} U_{d}(k-t) + b_{1t2} I_{d}(k-t)] + \varepsilon_1(k) $$
$$ I_{out}(k) + \sum_{t=1}^{n} a_{2t} I_{out}(k-t) = \sum_{t=0}^{n} [b_{2t1} U_{d}(k-t) + b_{2t2} I_{d}(k-t)] + \varepsilon_2(k) $$
where $k$ is the discrete-time index, $n$ is the model order, and $\varepsilon_1(k)$, $\varepsilon_2(k)$ represent equation errors or correlated noise sequences. The parameters to be identified are the autoregressive coefficients $a_{it}$ and the exogenous coefficients $b_{itj}$ ($i=1,2$ for outputs; $j=1,2$ for inputs).
We can compactly write the model in vector form for each output channel $i$:
$$ y_i = \Phi_i \theta_i + \varepsilon_i $$
where $y_i$ is the vector of output measurements, $\Phi_i$ is the regression matrix containing lagged input and output data, $\theta_i$ is the vector of unknown parameters for channel $i$, and $\varepsilon_i$ is the vector of correlated residuals.
| Symbol | Description |
|---|---|
| $U_d(k)$, $I_d(k)$ | DC input voltage and current at time $k$ |
| $U_{out}(k)$, $I_{out}(k)$ | AC output voltage and current at time $k$ |
| $n$ | Model order (number of lag terms) |
| Length of the data set | |
| $a_{it}$ | Autoregressive parameter for output $i$, lag $t$ |
| $b_{itj}$ | Exogenous parameter for output $i$, input $j$, lag $t$ |
| $\varepsilon_i(k)$ | Correlated residual (colored noise) for channel $i$ |
| $\theta_i$ | Parameter vector $[a_{i1},…, a_{in}, b_{i01},…, b_{in1}, b_{i02},…, b_{in2}]^T$ |
From Standard Least Squares to Generalized Least Squares
Standard Least Squares (LS) Method
The ordinary least squares estimator seeks to minimize the sum of squared residuals $J = \sum_i (y_i – \Phi_i \hat{\theta}_i)^T(y_i – \Phi_i \hat{\theta}_i)$. The optimal parameter estimate, in a batch processing form, is given by the well-known normal equation:
$$ \hat{\theta}_i^{LS} = (\Phi_i^T \Phi_i)^{-1} \Phi_i^T y_i $$
While computationally straightforward, this estimator is only statistically unbiased if the residuals $\varepsilon_i$ are uncorrelated and have zero mean. In practical solar inverter systems, noise from sensors, switching harmonics, and grid disturbances often leads to correlated residuals, causing $\hat{\theta}_i^{LS}$ to be biased and inconsistent.
Generalized Least Squares (GLS) Method
The GLS method rectifies this issue by modeling the correlated noise. It assumes the residual $\varepsilon_i(k)$ can be described as an autoregressive (AR) process driven by white noise $e_i(k)$:
$$ \varepsilon_i(k) + \sum_{s=1}^{p} c_{is} \varepsilon_i(k-s) = e_i(k) $$
where $c_{is}$ are the parameters of a whitening filter of order $p$, and $e_i(k)$ is a white noise sequence. The combined model for the solar inverter system and noise can be written in an augmented form. Defining an extended regression matrix $\Psi_i = [\Phi_i, \Omega_i]$ and an extended parameter vector $\beta_i = [\theta_i^T, c_i^T]^T$, where $\Omega_i$ contains lagged residuals, we get:
$$ y_i = \Psi_i \beta_i + e_i $$
The GLS solution involves an iterative procedure: 1) Estimate $\theta_i$ using LS, 2) Compute residuals $\varepsilon_i$, 3) Estimate noise model parameters $c_i$ from $\varepsilon_i$, 4) Filter the original input-output data using the estimated $1/C_i(z)$ filter (where $C_i(z)=1+\sum c_{is}z^{-s}$), 5) Re-estimate $\theta_i$ with LS on the filtered data. Steps 2-5 repeat until convergence. The batch GLS estimate is:
$$ \hat{\beta}_i^{GLS} = (\Psi_i^T \Psi_i)^{-1} \Psi_i^T y_i $$
Development of the Variable Forgetting Factor Generalized Least Squares (VFF-GLS) Algorithm
For real-time parameter identification of a solar inverter, a recursive algorithm is necessary. A direct recursive implementation of GLS (R-GLS) can be derived. However, to combat the “data saturation” phenomenon where old data dominates and prevents the algorithm from tracking time-varying parameters, a forgetting factor $\lambda$ ($0 < \lambda \leq 1$) is introduced. The standard Recursive GLS with a constant forgetting factor updates its estimates as follows:
Let $\psi_i(k)$ be the extended regression vector at time $k$. The algorithm maintains an inverse covariance matrix $P_i(k)$.
1. Compute Gain: $$ K_i(k) = \frac{P_i(k-1) \psi_i(k)}{\lambda + \psi_i^T(k) P_i(k-1) \psi_i(k)} $$
2. Update Parameter Estimate: $$ \hat{\beta}_i(k) = \hat{\beta}_i(k-1) + K_i(k) [y_i(k) – \psi_i^T(k) \hat{\beta}_i(k-1)] $$
3. Update Covariance Matrix: $$ P_i(k) = \frac{1}{\lambda} [P_i(k-1) – K_i(k) \psi_i^T(k) P_i(k-1)] $$
With $\lambda=1$, it becomes the pure R-GLS algorithm with infinite memory. With $0 < \lambda < 1$, past data is exponentially discounted. A fixed $\lambda$ presents a trade-off: a small $\lambda$ ensures fast tracking but causes high variance in estimates; a large $\lambda$ gives smooth, accurate estimates but slow adaptation.
To achieve both excellent tracking and steady-state accuracy for the solar inverter identification, we propose a Variable Forgetting Factor (VFF) mechanism. The core idea is to decrease $\lambda$ when the prediction error is large (indicating a possible change in system dynamics or poor current model) and increase it towards 1 when the error is small (indicating a good model fit). We define the variable forgetting factor $\lambda(k)$ at time $k$ as:
$$ \lambda(k) = \lambda_{min} + (1 – \lambda_{min}) \cdot 2^{-L(k)} $$
where $L(k)$ is an integer function of the squared prediction error:
$$ L(k) = \text{NINT}(\mu \cdot e^2(k)) $$
Here, $e(k) = y(k) – \psi^T(k) \hat{\beta}(k-1)$ is the prior prediction error, $\mu > 0$ is a sensitivity gain, $\text{NINT}(\cdot)$ denotes the nearest integer function, and $\lambda_{min}$ is a lower bound for the forgetting factor (e.g., $0.95$ to $0.99$ to ensure numerical stability). When $e^2(k)$ is large, $L(k)$ becomes large, making $2^{-L(k)}$ very small, thus $\lambda(k) \approx \lambda_{min}$. When $e^2(k)$ approaches zero, $L(k)=0$, and $\lambda(k)=1$.
Integrating this VFF mechanism into the R-GLS framework yields the complete VFF-GLS algorithm for solar inverter identification.
| Step | Action |
|---|---|
| Initialization | Set $\hat{\beta}(0)$, $P(0)=\alpha I$ ($\alpha$ large), choose $\lambda_{min}$, $\mu$, model orders $n$ and $p$. |
| For each sample k=1,2,… | |
| 1. Data Formation | Construct the extended regression vector $\psi(k)$ using current/lagged I/O data and lagged estimated residuals $\hat{\varepsilon}$. |
| 2. Prediction Error | Compute $e(k) = y(k) – \psi^T(k) \hat{\beta}(k-1)$. |
| 3. Update Forgetting Factor | Calculate $L(k)=\text{NINT}(\mu e^2(k))$ and then $\lambda(k)=\lambda_{min}+(1-\lambda_{min})\cdot 2^{-L(k)}$. |
| 4. Compute Gain | $K(k) = P(k-1)\psi(k) / (\lambda(k) + \psi^T(k) P(k-1)\psi(k))$. |
| 5. Update Parameter Estimate | $\hat{\beta}(k) = \hat{\beta}(k-1) + K(k) e(k)$. |
| 6. Update Covariance Matrix | $P(k) = (P(k-1) – K(k)\psi^T(k)P(k-1)) / \lambda(k)$. |
| 7. Update Residuals | Compute the new residual $\hat{\varepsilon}(k)=y(k)-\phi^T(k)\hat{\theta}(k)$ for use in future $\psi$. |
Simulation and Validation with Real Solar Inverter Data
To validate the proposed VFF-GLS algorithm, we utilized operational data from an SG800MX grid-connected solar inverter. The dataset comprised 354 samples of DC input voltage ($U_d$), DC input current ($I_d$), AC output voltage ($U_{out}$), and AC output current ($I_{out}$), recorded with a sampling period of 479 ms. The average operating points were: $U_d \approx 360V$, $I_d \approx 14.5A$, $U_{out} \approx 221.35V$, $I_{out} \approx 22.6A$, and power $\approx 5.22 kW$.
Model Order Selection
Prior to recursive identification, a preliminary batch analysis was conducted to determine an appropriate model order $n$. The loss function $J(n) = \sum e^2(k)$ was plotted against increasing model order. The curve showed a rapid decrease for $n$ from 1 to 5, a slower decrease up to $n \approx 10$, and became nearly flat after $n=15$. This indicated that a 15th-order model was sufficient to capture the dynamics of the solar inverter system without overfitting.
$$ n_{optimal} = \arg\min_n [J(n) \text{ subject to diminishing returns}] \implies n=15 $$
Recursive Identification Results
With $n=15$ and a whitening filter order $p=15$, the VFF-GLS algorithm was initialized. Parameters were set as $\lambda_{min}=0.99999$, $\mu=2 \times 10^4$, $\alpha=10^6$. The algorithm processed the data sequentially from $k=16$ onwards (to fill the initial regression vector).
The evolution of the loss function $J(k)$ with increasing data length $k$ is crucial. The plot showed initial transient spikes due to the short initial data window, but as more data was processed, the VFF-GLS algorithm quickly adapted, and the loss converged to a small, steady value. This demonstrates the algorithm’s real-time capability and stability for solar inverter monitoring.
The key outcome is the set of identified model parameters $\hat{\theta}_1$ and $\hat{\theta}_2$ for the voltage and current output channels, respectively. A subset of the converged parameters is presented below.
| Param. | $t=0$ | $t=1$ | $t=2$ | $t=3$ | $t=4$ | $t=5$ | $t=6$ | $t=7$ |
|---|---|---|---|---|---|---|---|---|
| $a_{1t}$ | 1.0000 | -0.91263 | -0.00199 | -0.08246 | 0.009155 | -0.02571 | 0.039041 | 0.048807 |
| $b_{1t1}$ | 0.007662 | -0.00458 | -0.00531 | 0.005896 | -0.00803 | 0.003215 | 0.005493 | 0.021035 |
| $b_{1t2}$ | 0.20113 | -0.14000 | -0.09672 | 0.084045 | -0.15066 | 0.065655 | 0.169774 | 0.447837 |
| $a_{2t}$ | 1.0000 | -0.40607 | -0.10890 | -0.22608 | -0.18404 | 0.160945 | -0.13572 | 0.208816 |
| $b_{2t1}$ | 0.073275 | -0.04432 | -0.00236 | -0.01098 | -0.01025 | 0.003803 | -0.00917 | 0.009290 |
| $b_{2t2}$ | 1.930207 | -1.29309 | -0.05264 | -0.25332 | -0.21510 | 0.019229 | -0.03693 | 0.101202 |
… Table continues for lags t=8 to 14 …
The ultimate validation is the comparison between the measured outputs of the actual solar inverter and the outputs simulated using the identified model with the original input data ($U_d$, $I_d$). The plots for both $U_{out}$ and $I_{out}$ showed an excellent match. After the initial adaptation period, the model outputs overlapped almost perfectly with the measured data, confirming the accuracy and predictive capability of the VFF-GLS identified model.
Comparative Analysis and Discussion
The superiority of the proposed VFF-GLS method can be contextualized by comparing its attributes with those of classical methods in the context of solar inverter identification.
| Method | Key Principle | Advantages | Disadvantages for Solar Inverter ID |
|---|---|---|---|
| Batch Least Squares (LS) | Minimizes sum of squared errors. | Simple, non-iterative, fast computation on fixed dataset. | Biased under colored noise; not suitable for real-time; requires all data upfront. |
| Recursive LS (RLS) with Fixed FF | Recursively updates LS estimates, discounts old data. | Real-time capability; tracks slow variations. | Biased under colored noise; fixed FF trades off tracking vs. noise sensitivity. |
| Batch Generalized LS (GLS) | Models noise as AR process, uses whitening filter. | Provides unbiased, consistent estimates under colored noise. | Iterative, computationally heavier; batch process (no real-time); data saturation issue if applied recursively. |
| Proposed VFF-GLS | Recursive GLS with adaptive forgetting factor based on prediction error. | Unbiased estimates (inherits GLS merit); Real-time operation; Excellent tracking of dynamics (VFF); Robust to noise. | More complex than RLS; requires tuning of $\lambda_{min}$, $\mu$; slightly higher computational load per iteration. |
The mathematical essence of the improvement can be seen in the evolving forgetting factor. Unlike a constant $\lambda$, the variable factor $\lambda(k)$ ensures that the effective window length of the data is optimal at every time step. When the solar inverter operating point changes (e.g., due to cloud cover changing PV input), the prediction error $e(k)$ increases, triggering a decrease in $\lambda(k)$. This shrinks the effective memory, allowing the algorithm to rapidly “forget” the old model and learn the new one. Once the model has adapted, $e(k)$ decreases, $\lambda(k)$ increases toward 1, and the algorithm behaves like a standard R-GLS, providing smooth and accurate parameter estimates with low variance. This dynamic adjustment is key to the method’s performance for non-stationary solar inverter systems.
Conclusion
Accurate dynamic modeling of solar inverters is fundamental for advanced grid integration, control design, and condition monitoring. This article has addressed the system identification challenge by formulating the solar inverter as a linear MIMO system and developing a novel Variable Forgetting Factor Generalized Least Squares algorithm. The VFF-GLS algorithm successfully synthesizes the unbiased estimation property of the Generalized Least Squares method with the real-time adaptability of a recursive estimator featuring an intelligent, error-driven forgetting mechanism.
Theoretical derivation established the algorithm’s recursive form, and simulation with actual operational data from a commercial solar inverter confirmed its efficacy. The method demonstrated the ability to automatically determine an appropriate model structure, accurately identify a large set of parameters in real-time, and produce a model whose output closely matches the real system’s behavior. The variable forgetting factor proved essential, enabling both swift convergence from initial conditions and robust tracking without sacrificing steady-state accuracy. This makes the VFF-GLS algorithm a powerful and practical tool for the identification and ongoing adaptive modeling of solar inverter systems in dynamic environments.
