基于扩展(EKF)和无迹卡尔曼滤波(UKF)的电力系统动态状态估计(Matlab代码实现)

简介: 基于扩展(EKF)和无迹卡尔曼滤波(UKF)的电力系统动态状态估计(Matlab代码实现)

💥1 概述

文献来源:

摘要:准确估计电力系统动态对于提高电力系统的可靠性、韧性、安全性和稳定性非常重要。随着逆变器型分布式能源的不断集成,对电力系统动态的了解比以往任何时候都更为必要和关键,以实现电力系统的正确控制和运行。尽管最近测量设备和传输技术的进展极大地减小了测量和传输误差,但这些测量仍然不完全摆脱测量噪声的影响。因此,需要对嘈杂的测量进行滤波,以获得准确的电力系统运行动态。本文使用扩展卡尔曼滤波器(EKF)和无迹卡尔曼滤波器(UKF)来估计电力系统的动态状态。我们对西部电力协调委员会(WECC)的3机9节点系统和新英格兰的10机39母线系统进行了案例研究。结果表明,UKF和EKF能够准确地估计电力系统的动态。本文还提供了对测试案例的EKF和UKF的比较性能。其他基于卡尔曼滤波技术和机器学习的估计器的信息将很快在本报告中更新。


关键词:扩展卡尔曼滤波(EKF)、电力系统动态状态估计、无迹卡尔曼滤波(UKF)。


原文摘要:


Abstract—Accurate estimation of power system dynamics is very important for the enhancement of power system relia-bility, resilience, security, and stability of power system. With the increasing integration of inverter-based distributed energy resources, the knowledge of power system dynamics has become more necessary and critical than ever before for proper control and operation of the power system. Although recent advancement of measurement devices and the transmission technologies have reduced the measurement and transmission error significantly, these measurements are still not completely free from the mea- surement noises. Therefore, the noisy measurements need to be filtered to obtain the accurate power system operating dynamics. In this work, the power system dynamic states are estimated using extended Kalman filter (EKF) and unscented Kalman filter (UKF). We have performed case studies on Western Electricity Coordinating Council (WECC)’s 3-machine 9-bus system and New England 10-machine 39-bus. The results show that the UKF and EKF can accurately estimate the power system dynamics. The comparative performance of EKF and UKF for the tested case is also provided. Other Kalman filtering techniques along

with the machine learning based estimator will be updated in this report soon. All the sources code including Newton Raphson power flow, admittance matrix calculation, EKF calculation, and

UKF calculation are publicly available in Github on Power System Dynamic State Estimation.

Index Terms—Extended Kalman filter (EKF), power system dynamic state estimation, and unscented Kalman filter (UKF).


📚2 运行结果

2.1 UKF

2.2 EKF

部分代码:

% Covariance Matrix
sig=1e-2; 
P=sig^2*eye(ns);  % Error covariance matrix 
Q=sig^2*eye(ns); % system noise covariance matrix 
R=sig^2*eye(nm); % measurment noise covariance matrix 
X_hat=X_0;
X_est=[]; 
X_mes=[]; % Initial statel 
% constant values 
RMSE=[];
%Extended Kalman Filter (EKF) ALgorithm 
for k=0:deltt:t_max
    % Ybus and reconstruction matrix accodring to the requirement
    if k<t_SW
        ps=1;
    elseif (t_SW<k)&&(k<=t_FC)
        ps=2;  
    else 
        ps=3; 
    end  
    Ybusm = YBUS(:,:,ps);
    RVm=RV(:, :, ps);
    [~, X] = ode45(@(t,x) dynamic_system(t,x,M,D,Ybusm,E_abs,PM,n),[k k+deltt],X_0);
    X_0=transpose(X(end, :));
    X_mes=[X_mes X_0];
    %determine the measurements 
    E1=E_abs.*exp(1j*X_0(1:n)); 
    I1=Ybusm*E1; 
    PG=real(E1.*conj(I1)); 
    QG=imag(E1.*conj(I1)); 
    Vmag=abs(RVm*E1); 
    Vangle=angle(RVm*E1); 
    z=[PG; QG; Vmag; Vangle]; 
    % determine Phi=df/fx 
    Phi=RK4partial(E_abs, X_hat, Ybusm, M, deltt, D, n);
    %prediction 
%     [~, X1]= ode45(@(t,x) dynamic_system(t,x,M,D,Ybusm,E_abs,PM,n),[k k+deltt],X_hat);
%     X_hat=transpose(X1(end, :));
    X_hat=RK4(n, deltt, E_abs, ns, X_hat, PM, M, D, Ybusm); 
    P=Phi*P*transpose(Phi)+Q;
    % correction 
    [H, zhat]=RK4H(E_abs, X_hat, Ybusm, s,n, RVm) ; 
    % Measurement update of state estimate and estimation error covariance 
    K=P*transpose(H)*(H*P*transpose(H)+R);
    X_hat=X_hat+K*(z-zhat); 
    P=(eye(ns)-K*H)*P; 
    X_est=[X_est, X_hat];  
    RMSE=[RMSE, sqrt(trace(P))];
end 
save('39_RMSE_EKF.mat', 'RMSE')
%% Plots
t= (0:deltt:t_max);
for i=1:1:n
figure(i)
subplot(2,1,1)
plot(t,X_mes(i, :), 'linewidth', 1.5)
hold on 
plot(t, X_est(i, :), 'linestyle', '--', 'color', 'r', 'linewidth', 2);
grid on
ylabel(sprintf('Angle_{%d}', i), 'fontsize', 12)
xlabel('time(s)', 'fontsize', 15); 
title('Actual Vs Estimated \delta', 'fontsize', 12)
legend(sprintf('Angle_{%d, Actual} ',i), sprintf('Angle_{%d, EKF}', i)); 
subplot(2,1,2)
plot(t,X_mes(i+n, :), 'linewidth', 1.5)
hold on 
plot(t, X_est(i+n, :), 'linestyle', '--', 'color', 'r', 'linewidth', 2);
grid on
ylabel(sprintf('Speed_{%d}', i), 'fontsize', 12)
xlabel('time(s)', 'fontsize', 15); 
title('Actual Vs Estimated \omega', 'fontsize', 12)
legend(sprintf('Speed_{%d, Actual} ',i), sprintf('Speed_{%d, EKF}', i));
% subplot(2,2,3)
% plot(t,X_mes(i+1, :), 'linewidth', 1.5)
% hold on 
% plot(t, X_est(i+1, :), 'linestyle', '--', 'color', 'r', 'linewidth', 2);
% grid on
% ylabel(sprintf('Angle_{%d}', i+1), 'fontsize', 12)
% xlabel('time(s)', 'fontsize', 15); 
% title('Measured Vs Eistimated \delta', 'fontsize', 12)

🎉3 参考文献

部分理论来源于网络,如有侵权请联系删除。

🌈4 Matlab代码实现


相关文章
|
15天前
|
算法 安全 数据库
基于结点电压法的配电网状态估计算法matlab仿真
**摘要** 该程序实现了基于结点电压法的配电网状态估计算法,旨在提升数据的准确性和可靠性。在MATLAB2022a中运行,显示了状态估计过程中的电压和相位估计值,以及误差随迭代变化的图表。算法通过迭代计算雅可比矩阵,结合基尔霍夫定律解决线性方程组,估算网络节点电压。状态估计过程中应用了高斯-牛顿或莱文贝格-马夸尔特法,处理量测数据并考虑约束条件,以提高估计精度。程序结果以图形形式展示电压幅值和角度估计的比较,以及估计误差的演变,体现了算法在处理配电网状态估计问题的有效性。
|
19天前
|
机器学习/深度学习 自然语言处理 算法
m基于深度学习的OFDM+QPSK链路信道估计和均衡算法误码率matlab仿真,对比LS,MMSE及LMMSE传统算法
**摘要:** 升级版MATLAB仿真对比了深度学习与LS、MMSE、LMMSE的OFDM信道估计算法,新增自动样本生成、复杂度分析及抗频偏性能评估。深度学习在无线通信中,尤其在OFDM的信道估计问题上展现潜力,解决了传统方法的局限。程序涉及信道估计器设计,深度学习模型通过学习导频信息估计信道响应,适应频域变化。核心代码展示了信号处理流程,包括编码、调制、信道模拟、降噪、信道估计和解调。
44 8
|
16天前
|
算法
m基于GA遗传优化的高斯白噪声信道SNR估计算法matlab仿真
**MATLAB2022a模拟展示了遗传算法在AWGN信道中估计SNR的效能。该算法利用生物进化原理全局寻优,解决通信系统中复杂环境下的SNR估计问题。核心代码执行多代选择、重组和突变操作,逐步优化SNR估计。结果以图形形式对比了真实SNR与估计值,并显示了均方根误差(RMSE),体现了算法的准确性。**
18 0
|
27天前
|
资源调度 SoC
基于UKF无迹卡尔曼滤波的电池Soc估计matlab仿真
**摘要:** 使用MATLAB2022a,基于UKF的电池SOC估计仿真比较真实值,展示非线性滤波在电动车电池管理中的效用。电池电气模型描述电压、电流与SoC的非线性关系,UKF利用无迹变换处理非线性,通过预测和更新步骤实时估计SoC,优化状态估计。尽管UKF有效,但依赖准确模型参数。
|
2月前
|
数据安全/隐私保护
耐震时程曲线,matlab代码,自定义反应谱与地震波,优化源代码,地震波耐震时程曲线
地震波格式转换、时程转换、峰值调整、规范反应谱、计算反应谱、计算持时、生成人工波、时频域转换、数据滤波、基线校正、Arias截波、傅里叶变换、耐震时程曲线、脉冲波合成与提取、三联反应谱、地震动参数、延性反应谱、地震波缩尺、功率谱密度
基于混合整数规划的微网储能电池容量规划(matlab代码)
基于混合整数规划的微网储能电池容量规划(matlab代码)
|
2月前
|
数据安全/隐私保护
地震波功率谱密度函数、功率谱密度曲线,反应谱转功率谱,matlab代码
地震波格式转换、时程转换、峰值调整、规范反应谱、计算反应谱、计算持时、生成人工波、时频域转换、数据滤波、基线校正、Arias截波、傅里叶变换、耐震时程曲线、脉冲波合成与提取、三联反应谱、地震动参数、延性反应谱、地震波缩尺、功率谱密度
|
2月前
|
算法 调度
含多微网租赁共享储能的配电网博弈优化调度(含matlab代码)
含多微网租赁共享储能的配电网博弈优化调度(含matlab代码)
|
2月前
|
Serverless
基于Logistic函数的负荷需求响应(matlab代码)
基于Logistic函数的负荷需求响应(matlab代码)
|
2月前
|
供应链 算法
基于分布式优化的多产消者非合作博弈能量共享(Matlab代码)
基于分布式优化的多产消者非合作博弈能量共享(Matlab代码)