【MATLAB例程】基于鲁棒卡尔曼滤波的弹性状态估计与欺骗攻击检测

【信息科学与工程学】【运营科学】第二篇 C4信息与通信网络运营 (C4) ——数据中心网络运营04 典型值:λ1​∈[−0.02,−0.01], λ2​∈[−0.01,0], η1​,η3​∈[0.1,0.3], η2​,η4​∈[0.05,0.15]参数:δ1​∈[−0.8,−0.3], δ2​∈[−0.5,−0.2], δ3​∈[−0.4,−0.1], δ4​∈[−0.6,−0.2]参数:φ1​∈[0.1,0.3], φ2​∈[−0.2,−0.05], φ3​∈[−0.1,0.1], φ4​∈[−0.3,−0.1]参数:α∈[0.3,0.6], β∈[0.2,0.4], γ∈[0.01,0.03] 阅读详情

在这里插入图片描述

结合鲁棒卡尔曼滤波与欺骗攻击检测的MATLAB代码,包含动态模型、攻击注入和弹性状态估计功能,代码可直接运行,附有详细的注释

运行结果

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

MATLAB源代码

以下是一段结合鲁棒卡尔曼滤波与欺骗攻击检测的MATLAB代码,包含动态模型、攻击注入和弹性状态估计功能,代码可直接运行并包含详细注释:

% 基于鲁棒卡尔曼滤波的弹性状态估计与欺骗攻击检测
% 作者:matlabfilter
% 2025-04-07/Ver1
clc; clear; close all;
rng(0);
%% 参数初始化
dt = 0.1;          % 时间步长
T = 10;             % 总时长
t = 0:dt:T;         % 时间序列
N = length(t);      % 数据点数

% 系统模型(二维匀速运动)
F = [1 dt 0 0;      % 状态转移矩阵
     0 1 0 0;
     0 0 1 dt;
     0 0 0 1];
H = [1 0 0 0;       % 观测矩阵
     0 0 1 0]; 

% 噪声参数
Q = diag([0.1, 0.1, 0.1, 0.1]);  % 过程噪声协方差
R = diag([1, 1]);                 % 观测噪声协方差

% 欺骗攻击参数
attack_start = 50;                % 攻击开始时刻
attack_duration = 30;              % 攻击持续时间
attack_magnitude = [5; 3];         % 攻击幅度[X方向,Y方向]

%% 生成真实轨迹与带噪声观测
true_states = zeros(4,N);
measurements = zeros(2,N);

% 初始状态
true_states(:,1) = [0; 1; 0; 0.5]; 

% 生成状态序列
for k = 2:N
    true_states(:,k) = F * true_states(:,k-1) + sqrtm(Q)*randn(4,1);
end

% 添加观测噪声
【MATLAB代码】(电机UKF1)标准无迹卡尔曼滤波(UKF)原理与MATLAB例程:四维PMSM转速与电角度估计 本文基于标准无迹卡尔曼滤波(UKF),实现对PMSM电机在已知负载下的电流、转速与电角度联合估计。采用单个MATLAB文件,集成数据生成、模型仿真、滤波算法与结果评估,支持课程实验与二次开发。通过真实台架仿真生成带噪电压/电流观测值,验证了估计器在初始误差收敛及变速跟踪中的有效性。结果包含转速、电角度、电流估计曲线及误差分析,附带命令行统计与新息诊断,完整指标保存于工作区。订阅专栏可获取源码与定制服务。 阅读详情

相关推荐

【MATLAB代码】平面下,5基站对待定位点的定位。基于距离辅助下的AOA。订阅专栏后可查看完整代码

本文基于五基站二维定位模型,对比纯AOA最小二乘与角度-距离联合解算的定位性能。通过MATLAB仿真,可视化目标真实与估计位置,并输出RMSE、误差分布等指标。代码支持参数自定义,订阅后可直接运行。测距仅作辅助以提升精度,适用于导航与定位滤波算法研究。如需定制或讲解,欢迎联系作者微信:matlabfilter。

985工科博士毕业,专攻定位、导航和滤波等算法研究。从业10年,主要使用MATLAB 29

FANUC_M-20iA_六轴机械臂码垛仿真

将MATLAB六轴机械臂码垛仿真模型从1.2万面简化STL升级为FANUC官方12.2万面CAD(COLLADA格式),彻底解决闪烁与穿模问题。通过闭式解锁定自然支链,结合DLS优化,实现逆运动学稳定求解;利用真实质量参数进行动力学校核,确保轨迹可执行。动画仅更新矩阵,不重建对象,达成25 fps流畅仿真,四层堆垛整齐,夹爪全程朝下,仿真精度与工业级真机高度一致。

yjw0911的博客 294

Unity实时控制佳能单反拍照全流程(附EDSDK 3.6.1配置避坑指南)

本文详细介绍了在Unity中实时控制佳能单反相机进行拍照的完整流程,重点提供了EDSDK 3.6.1的配置与避坑指南。内容涵盖从SDK获取、环境搭建、相机初始化、参数设置到实现拍照控制,并深入探讨了实时取景的延迟优化方案与资源管理,旨在帮助开发者高效集成专业相机,提升AR/VR及摄影测量等应用的视觉输入质量。

go5gopher的博客 186

Mediapipe姿态估计——用坐标计算手指关节弯曲角度并实时标注

利用mediapipe搭建姿态检测模型;mediapipe人体标注节点坐标;mediapipe计算手指弯曲角度并实时渲染;mediapipe计算关节弯曲角度。mediapipe手势识别;mediapipe姿态检测模型;mediapipe学习。

kalakalabala的博客 1万+

CAN:CANape使用Function处理数据

CANape中的function and script习惯称之为脚本(实际为函数和脚本)。这里介绍function,可以实现简单信号a和信号b乘法,比如计算功率(转速与扭矩乘)。该功能前期有专业人员做支援,当时问其编制方法,其回答是看帮助文件。现在没有支援自己动手。 功能描述:电压信号阶梯增加,每次保持1.5s,测量后0.5s位移平均值(假设信号步长10ms,需要取样50个点,但该脚本中点的数目为10个)。图示如下: 刚开始看了软件Function definition→Library function,

Morven 1万+

WorkBuddy 实战:规则、记忆与 Skill 配置全攻略

AI工作台正成为连接大模型与真实业务的桥梁,其核心价值在于将零散AI能力封装为可复用的工作流。WorkBuddy作为典型智能体入口,通过自定义规则、跨对话记忆与Skill扩展,解决AI“失忆”和“不懂行话”等痛点。从概念到实践,掌握安装避坑、缓存目录调整、知识库挂载等基础操作后,用户可在客服话术生成、文献综述、重复任务自动执行等场景中显著提升效率。本文结合Docker私有化部署与安全审核要点,系统拆解WorkBuddy从入门到进阶的完整路径,帮助团队将AI工具沉淀为可维护的流程资产。

weixin_29053073的博客 456

手把手教你用海康威视相机+DLP4500搭建双目结构光系统(附避坑指南)

本文详细介绍了如何使用海康威视相机和DLP4500搭建双目结构光三维测量系统,涵盖硬件选型、系统搭建、双目标定及三维重建等关键步骤。特别针对预算有限的开发者和实验室团队,提供实用的避坑指南和优化技巧,帮助实现0.02mm的高精度测量。

weixin_42526087的博客 468

BevFusion (5):逐行代码详解

论文中给出了Bevfusion的架构图,它的输入是多视角的相机和点云图,经过两个特定的head,分别用于做检测任务和分割任务。图1 Bevfusion 结构图Bevfusion因为有两个模态的输入:多视角相机和点云,所以对应两个分支:相机分支和点云分支。相机分支:输入6个视角的图片后,提取特征,然后经VT(View Transformer)转换之后得到相机的Bev特征。激光雷达分支:输入点云数据,经过Encoder编码得到体素化Lidar特征,然后沿z方向展平,得到Lidar Bev特征。

@bangbang的博客 3721

MCP开发实战:基于openEuler系统MCP插件的开发、测试与发布全流程

MCP开发实战:基于openEuler系统MCP插件的开发、测试与发布全流程

jks212454的博客 557

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

上一篇: TDOA定位与CKF轨迹滤波,三维轨迹滤波的MATLAB例程,附完整的代码
下一篇: 【雷达跟踪】基于matlab卡尔曼滤波器雷达多目标跟踪(双雷达 多目标 分布式融合),附完整代码和讲解、注释
MATLAB卡尔曼
MATLAB卡尔曼 毕昇杯全国一等奖获得者 毕昇杯全国一等奖获得者 领域专家: 数据科学与机器学习技术领域 领域专家: 数据科学与机器学习技术领域
博客等级 码龄14年 7628粉丝 1441原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

MATLAB卡尔曼

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值