matlab物价的波动代码-battery-optimization:电池优化

  • t1_693871
    了解作者
  • 719.1KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-05-18 20:30
    上传日期
matlab物价的波动代码
battery-optimization-master.zip
  • battery-optimization-master
  • filldQ.m
    216B
  • PV_optim_old.m
    3.4KB
  • fillhmat.m
    566B
  • fillbQpmax.m
    296B
  • fillA.m
    501B
  • control_script.m
    2KB
  • fillQmax.m
    269B
  • PV_optim.m
    3.2KB
  • calculate_J.m
    203B
  • fillN.m
    356B
  • PV_optim_new.m
    3.4KB
  • fillQ.m
    290B
  • plot_battery.m
    929B
  • batfunc_anon.m
    739B
  • fillbQmax.m
    292B
  • batfunc1.m
    766B
  • march3.xls
    2.2MB
  • Readme.txt
    4.7KB
  • fillM.m
    609B
  • controlled_pwr.m
    753B
内容介绍
Documentation (basic) for inverter/ battery systems predictive controls Dinos Gonatas (c) Dec 2 2013 This package determines the optimal control parameters for inverter throughput and battery state of charge coupled to an intermittent PV system (or any intermittent source of power). The core functions are: - batfunc1.c … the system cost function - PV_optim.m … a function that calls the Matlab constrained optimization package, fmincon, and returns the optimal parameters at a single time point together with an error code indicating whether or not a feasible solution exists - control_script … a sample script that reads in formatted prediction data from march3.xls, then loops through a sequence of time points to determine the optimal control parameters for a series of time data. Also, utilities include - plot_battery.m … a script that compares the results of uncontrolled output power to controlled output power, together with the state of charge and inverter throughput - numerous functions that convert uncontrolled power to controlled power, initialize transfer function matrices. ________________ function [xresult, fval ] = PV_optim(fcast, Price, qmax, qmin, f0, Currentmax, time_horizon, rr_requirement, q_init1, ... q_init2, x_init, h0, inverter_min, battery_powerscale, battery_meancharge) Outputs: results xresult, a (2,time_horizon) array of the optimal control parameters. xresult(1,:) = inverter throughput xresult(2,:) = battery state of charge fval = value of the optimal cost function at an evaluated time point xflag = error code: 2 Change in x was less than options.TolX and maximum constraint violation was less than options.TolCon. 1 First-order optimality measure was less than options.TolFun, and maximum constraint violation was less than options.TolCon. 0 Number of iterations exceeded options.MaxIter or number of function evaluations exceeded options.MaxFunEvals. -1 Stopped by an output function or plot function. -2 No feasible point was found. -3 Objective function at current iteration went below options.ObjectiveLimit and maximum constraint violation was less than options.TolCon. Inputs: fcast - the forecast of the uncontrolled power Price - the power price qmax - maximum charge for battery (in units of power*time) qmin - min charge for battery (lowest value = 0) f0 - nameplate maximum PV power (e.g.. for computing ramp rate requirement) Currentmax - maximum battery current, in PV power units (e.g. = 30% means max current corresponds to 30% of PV nameplate rating) time_horizon - # of time points ahead in battery forecast (note these are not necessarily in minutes although they can be) rr_requirement - ramp rate limit in % of max PV nameplate q_init1 - initial charge of battery 1st time point q_init2 - initial charge of battery at 2nd time point x_init - initial inverter throughput (usually set this = 1) h0 - roundtrip battery efficiency (including battery inverter) inverter_min - the lowest permissible of inverter throughput (lowest value = 0, highest value = 1; set = 1 if it’s desired to smooth PV fluctuations with battery alone) battery_powerscale - a weighting factor to reduce the impact of battery current on the system cost function. This should be < 1 otherwise the system will always try to maximize the power generated by the battery during the limited time horizon of the optimization… and the battery will run out of charge early instead of being useful for balancing PV production fluctuations the system can’t foresee during a limited time horizon battery_mean_charge - set this to some # around 50 - 80%; other things being equal if nothing is going on that needs battery intervention, the battery will charge to this level of maximum charge so that it will be ready the next time it’s needed. The optimal value of this parameter depends on the PV power production history so should be tested empirically on some sample days to get the best results for ability to mitigate fluctuations. The script control_script.m calls the this function with a bunch of sample arguments while reading in the excel file with your data formatted in an easy to read way (march3.xls - 1st column is the actual data, each subsequent column is the predicted data x time steps ahead). Note the ‘scale_factor’ variable. This = 2 for the data you sent b/c while each successive forecast is on a minute basis, in each time series there are 2 time points per minute. So lots of things have to be adjusted to compensate, eg. the rr_requirement. Since a 10% ramp limitation per time point actually = 10%/30 seconds = 20%/min The script plot_battery calculates the controlled power and makes some decent plots so you can figure out what’s going on. This runs quite quickly per time point so it is feasible to adapt this for real time operation. Good luck!
评论
    相关推荐
    • matlab 课件
      matlab 功能很强大,本课件详细的介绍了matlab在科学计算中的应用。
    • Matlab教程
      MatlaB经典ppt,主要讲解了MatlaB的入门知识,图形编程以及仿真。
    • matlab入门
      matlab的入门教程,很值得仔细看看,对提高matlab能力有帮助
    • matlab编译器
      matlab编译为exe文件所需要的文件; 使用时解压,将解压后文件拖入至matlab命令行即可
    • matlab
      matlab的基础知识进行介绍
    • MatLab
      “#MatLab
    • MATLAB编译器
      基于MATLAB 2018b版本介绍MATLAB编译器。介绍如何利用编译器将MATLAB代码编译为独立应用程序或组件,并在没有安装MATLAB的计算机上进行部署。
    • MATLAB 论文
      基于MATLAB的论文撰写!可以为你指明一条写作MATLAB论文的道路!
    • matlab
      matlab经典课堂讲义
    • matlab
      matlab