【顶级EI复现】【最新EI论文】低温环境下考虑电池寿命的微电网优化调度(Matlab代码实现)

    💥💥💞💞欢迎来到本博客❤️❤️💥💥

🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。

⛳️座右铭:行百里者,半于九十。

📋📋📋本文目录如下:🎁🎁🎁

目录

 ⛳️赠与读者

💥1 概述

📚2 运行结果

🎉3 参考文献

🌈4 Matlab代码、数据、文章


 ⛳️赠与读者

👨‍💻做科研,涉及到一个深在的思想系统,需要科研者逻辑缜密,踏实认真,但是不能只是努力,很多时候借力比努力更重要,然后还要有仰望星空的创新点和启发点。当哲学课上老师问你什么是科学,什么是电的时候,不要觉得这些问题搞笑。哲学是科学之母,哲学就是追究终极问题,寻找那些不言自明只有小孩子会问的但是你却回答不出来的问题。建议读者按目录次序逐一浏览,免得骤然跌入幽暗的迷宫找不到来时的路,它不足为你揭示全部问题的答案,但若能让人胸中升起一朵朵疑云,也未尝不会酿成晚霞斑斓的别一番景致,万一它居然给你带来了一场精神世界的苦雨,那就借机洗刷一下原来存放在那儿的“躺平”上的尘埃吧。

     或许,雨过云收,神驰的天地更清朗.......🔎🔎🔎

💥1 概述

文献来源:

为满足“低碳”能源结构的要求,数量庞大的分布式能源接入电网呈规模化趋势,其波动性和随机性给电网的运行安全带来了巨大挑战[1-3]。为应对挑战,微电网作为新兴的电网业态可灵活地进行分布式能源管理,而储能系统在其中起到储存电能、削峰填谷、应急供电等重要作用[4-6]。但在低温环境下,储能系统中起核心作用的电池却常出现充放电效率下降、寿命衰减速率增大等问题[7-8],高速率的电池老化除了增加如热失控、电池膨胀等安全性隐患以外[9-10],还将大幅增加储能系统的运行成本。衰减和运行成本[11]。目前,国内外已有部分学者在考虑电池寿命的微电网优化运行方面做出了一定的研究工作。文献[12]考虑了放电深度(depth of discharge,DOD)对电池寿命的影响,在利用吞吐量法构建了电池寿命预测模型后,引入了与荷电状态 (state of charge,SOC)相关的寿命损耗权重因子, 以限制电池生产活动中的过度放电行为;文献[13] 考虑了 SOC 对电池寿命的影响,基于电池的单位 电量损耗成本将蓄电池运行成本平均到每一次放 电行为中,将电池的 SOC 运行区间限制在较高值; 文献[14]考虑了电池日充放电次数和放电深度对电 池寿命的影响,将放电深度均匀分割成不同放电深 度区间,构成电池运行成本与日放电次数的分段线 性函数,有效约束了电池充放电计划中的日充放电次数与放电深度。但是,在这些模型中均未考虑电池寿命与温度的关系,默认电池依靠空调调节始终在常温下运行。而事实上,空调在温度低于−10℃的低温环境下运行会出现制热性能差和热泵室外机结霜等问题[15],无法在严寒季节达到理想的制热效果。因此,在低温环境下有必要考虑温度对于电池寿命的影响机制。

目前考虑温度对电池寿命影响的相关研究较少,主要基于阿伦尼乌斯方程进行模型搭建:文

献[16]基于阿伦尼乌斯定律推导了温度高于 20℃时对于电池寿命的影响因子函数,搭建了电池的热模型并通过动态模拟器求解模型;文献[17]将温度作为电池寿命的应力因子,认为电池的衰减速率与温度的关系满足阿伦尼乌斯方程,提出一种可以估计随机运行条件下电池容量衰减的电池老化模型。以上研究均未考虑低于室温时电池的寿命衰减模型,且缺乏理论推导,对实验数据的依赖性较高。文献[18]基于热传导方程搭建了电池及加热器的热力学模型,进而形成集成的虚拟电池模型,但该模型 中包含大量微分方程,增加了模型求解难度,不利 于微电网调度的求解。综上,在低温环境下电池的 老化机理分析建模及其参与微电网运行的充放电 策略亟待研究。

因此,本文首先分析了电池在低温下的老化机理,讨论放电深度、循环次数、温度 3 个因素对于

电池寿命衰减的影响,并搭建了考虑电池自发热和全温度范围的寿命衰减模型。接着,在微电网调度模型中考虑电池寿命衰减的影响,基于可行域凸极 点线性组合法,将模型转化为易于求解的混合整数模型。最后,在算例分析部分计算了 3 个温度场景下模型的优化结果,比较在不同场景下电池的衰减 速率以及系统的运行成本。

📚2 运行结果

🎉3 参考文献

文章中一些内容引自网络,会注明出处或引用为参考文献,难免有未尽之处,如有不妥,请随时联系删除。

[1]丁佳昀,胡秦然,吴在军,等.低温环境下考虑电池寿命的微电网优化调度[J].中国电机工程学报,2024,44(10):3815-3824.DOI:10.13334/j.0258-8013.pcsee.223275.

🌈4 Matlab代码、数据、文章

资料获取,更多粉丝福利,MATLAB|Simulink|Python资源获取

                                                           在这里插入图片描述

  • 16
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个使用贝叶斯优化的示例函数的Matlab代码: ```matlab function [xopt,fopt] = bayesopt_fun(f,x0,lb,ub,opts) % BAYESOPT_FUN: Bayesian optimization of a function % [XOPT,FOPT] = BAYESOPT_FUN(F,X0,LB,UB,OPTS) finds the minimum of a % function F using Bayesian optimization. X0 is the initial guess, % LB and UB are the lower and upper bounds of the variables, and OPTS % is an options structure created using BAYESOPT_OPTIONS. The function % F should take a vector of variables as input and return a scalar % output. % % Example usage: % f = @(x) sin(3*x) + x.^2 - 0.7*x; % opts = bayesopt_options('AcquisitionFunctionName','expected-improvement-plus'); % [xopt,fopt] = bayesopt_fun(f,0,0,1,opts); % % See also BAYESOPT_OPTIONS. % Check inputs narginchk(4,5); if nargin < 5, opts = bayesopt_options(); end assert(isa(f,'function_handle'),'F must be a function handle'); assert(isvector(x0) && isnumeric(x0),'X0 must be a numeric vector'); assert(isvector(lb) && isnumeric(lb),'LB must be a numeric vector'); assert(isvector(ub) && isnumeric(ub),'UB must be a numeric vector'); assert(all(size(x0)==size(lb)) && all(size(x0)==size(ub)), ... 'X0, LB, and UB must have the same size'); opts = bayesopt_options(opts); % ensure opts has all fields % Initialize X = x0(:); % column vector Y = f(X); n = numel(X); Xbest = X; Ybest = Y; fmin = min(Y); fmax = max(Y); % Loop over iterations for i = 1:opts.MaxIterations % Train surrogate model model = fitrgp(X,Y,'Basis','linear','FitMethod','exact', ... 'PredictMethod','exact','Standardize',true, ... 'KernelFunction',opts.KernelFunction,'KernelParameters',opts.KernelParameters); % Find next point to evaluate if strcmp(opts.AcquisitionFunctionName,'expected-improvement-plus') % Use expected improvement with small positive improvement threshold impThreshold = 0.01*(fmax-fmin); acqFcn = @(x) expected_improvement_plus(x,model,fmin,impThreshold); else % Use acquisition function specified in options acqFcn = str2func(opts.AcquisitionFunctionName); end xnext = bayesopt_acq(acqFcn,model,lb,ub,opts.AcquisitionSamples); % Evaluate function at next point ynext = f(xnext); % Update data X = [X; xnext(:)]; Y = [Y; ynext]; if ynext < Ybest Xbest = xnext; Ybest = ynext; end fmin = min(Y); fmax = max(Y); % Check stopping criterion if i >= opts.MaxIterations || (i > 1 && abs(Y(end)-Y(end-1))/Ybest <= opts.TolFun) break; end end % Return best point found xopt = Xbest; fopt = Ybest; end function EI = expected_improvement_plus(X,model,fmin,impThreshold) % EXPECTED_IMPROVEMENT_PLUS: Expected improvement with small positive improvement threshold % EI = EXPECTED_IMPROVEMENT_PLUS(X,MODEL,FMIN,IMPTHRESHOLD) computes % the expected improvement (EI) of a surrogate model at the point X. % The input MODEL is a regression model, FMIN is the current minimum % value of the function being modeled, and IMPTHRESHOLD is a small % positive improvement threshold. % % The expected improvement is defined as: % EI = E[max(FMIN - Y, 0)] % where Y is the predicted value of the surrogate model at X. % The expected value is taken over the posterior distribution of Y. % % However, if the predicted value Y is within IMPTHRESHOLD of FMIN, % then EI is set to IMPTHRESHOLD instead. This is done to encourage % exploration of the search space, even if the expected improvement % is very small. % % See also BAYESOPT_ACQ. % Check inputs narginchk(4,4); % Compute predicted value and variance at X [Y,~,sigma] = predict(model,X); % Compute expected improvement z = (fmin - Y - impThreshold)/sigma; EI = (fmin - Y - impThreshold)*normcdf(z) + sigma*normpdf(z); EI(sigma==0) = 0; % avoid division by zero % Check if improvement is small if Y >= fmin - impThreshold EI = impThreshold; end end function opts = bayesopt_options(varargin) % BAYESOPT_OPTIONS: Create options structure for Bayesian optimization % OPTS = BAYESOPT_OPTIONS() creates an options structure with default % values for all parameters. % % OPTS = BAYESOPT_OPTIONS(P1,V1,P2,V2,...) creates an options structure % with parameter names and values specified in pairs. Any unspecified % parameters will take on their default values. % % OPTS = BAYESOPT_OPTIONS(OLDOPTS,P1,V1,P2,V2,...) creates a copy of % the OLDOPTS structure, with any parameters specified in pairs % overwriting the corresponding values. % % Available parameters: % MaxIterations - Maximum number of iterations (default 100) % TolFun - Tolerance on function value improvement (default 1e-6) % KernelFunction - Name of kernel function for Gaussian process % regression (default 'squaredexponential') % KernelParameters - Parameters of kernel function (default []) % AcquisitionFunctionName - Name of acquisition function for deciding % which point to evaluate next (default % 'expected-improvement-plus') % AcquisitionSamples - Number of samples to use when evaluating the % acquisition function (default 1000) % % See also BAYESOPT_FUN, BAYESOPT_ACQ. % Define default options opts = struct('MaxIterations',100,'TolFun',1e-6, ... 'KernelFunction','squaredexponential','KernelParameters',[], ... 'AcquisitionFunctionName','expected-improvement-plus','AcquisitionSamples',1000); % Overwrite default options with user-specified options if nargin > 0 if isstruct(varargin{1}) % Copy old options structure and overwrite fields with new values oldopts = varargin{1}; for i = 2:2:nargin fieldname = validatestring(varargin{i},fieldnames(opts)); oldopts.(fieldname) = varargin{i+1}; end opts = oldopts; else % Overwrite fields of default options with new values for i = 1:2:nargin fieldname = validatestring(varargin{i},fieldnames(opts)); opts.(fieldname) = varargin{i+1}; end end end end function xnext = bayesopt_acq(acqFcn,model,lb,ub,nSamples) % BAYESOPT_ACQ: Find next point to evaluate using an acquisition function % XNEXT = BAYESOPT_ACQ(ACQFCN,MODEL,LB,UB,NSAMPLES) finds the next point % to evaluate using the acquisition function ACQFCN and the regression % model MODEL. LB and UB are the lower and upper bounds of the variables, % and NSAMPLES is the number of random samples to use when maximizing % the acquisition function. % % The input ACQFCN should be a function handle that takes a regression % model and a set of input points as inputs, and returns a vector of % acquisition function values. The set of input points is a matrix with % one row per point and one column per variable. % % The output XNEXT is a vector containing the next point to evaluate. % % See also BAYESOPT_FUN, EXPECTED_IMPROVEMENT_PLUS. % Check inputs narginchk(4,5); assert(isa(acqFcn,'function_handle'),'ACQFCN must be a function handle'); assert(isa(model,'RegressionGP'),'MODEL must be a regressionGP object'); assert(isvector(lb) && isnumeric(lb),'LB must be a numeric vector'); assert(isvector(ub) && isnumeric(ub),'UB must be a numeric vector'); assert(all(size(lb)==size(ub)),'LB and UB must have the same size'); if nargin < 5, nSamples = 1000; end % Generate random samples X = bsxfun(@plus,lb,bsxfun(@times,rand(nSamples,numel(lb)),ub-lb)); % Evaluate acquisition function acq = acqFcn(model,X); % Find maximum of acquisition function [~,imax] = max(acq); xnext = X(imax,:); end ``` 该示例代码实现了一个使用贝叶斯优化的函数优化器。该优化器使用高斯过程回归模型来近似目标函数,并使用期望改进加上(EI+)作为获取函数。您可以将此代码用作自己的优化问题的起点,并根据需要进行修改。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值