拉丁超立方抽样方法分成两步,第一步是对每个输入随机变量进行采样,使得采样点能够完全覆盖随机分布的区域。第二步是改变每个随机变量采样值的排列顺序,使得相互独立的随机变量采样值的相关性趋向最小。
基于MATLAB的风力和光伏发电不确定场景的生成App是基于分布式风力和光伏发电的历史输出数据,采用拉丁超立方抽样和反向场景缩减方法可以获得分布式风力发电输出功率和光伏发电输出功率。
基于MATLAB的风力和光伏发电不确定场景的生成App如下:

点击加载数据——点击开始计算——即可获得场景结果图和每个场景包含的excel结果文件,并生成jpg、bmp、fig、pdf格式的分类结果图。需要app安装包,可以进行打赏后截图(80元及以上),点击微信公众号云龙派的“联系掌门”按键进行联系,或者在公众号云龙派内回复截图,几小时内会回复。界面编程不易,还请见谅!
1.基于MATLAB的风力和光伏发电不确定场景的生成App举例

以风力发电输出功率为例,首先基于历史数据,构建风力发电的正态分布概率密度函数。其次,采用拉丁超立方抽样方法随机生成S个风力发电的场景。最后,使用反向场景缩减算法对初始的S个风力发电的场景缩减到N个,并计算其平均值作为风力发电的输出功率。反向场景缩减算法的计算步骤如下:
使用1天24小时的某地分布式风力发电和光伏发电的平均输出功率的历史数据。
Step1:点击fenbushiApp.mlappinstall文件,在MATLAB中双击安装APP,点击安装到我的APP。
Step2:在APP 菜单栏中找到我的app中的fenbushiApp,双击运行出App主界面。
Step3:点击加载数据,选择数据excel文件,并点击确定。
Step4:点击开始计算,获得相应的输出和图形、数据文件。
Step5:点击清除和关闭,可以清除图形窗口和EXCEL窗口内容。
2.App部分程序
classdef fenbushiApp < matlab.apps.AppBase % Properties that correspond to app components properties (Access = public) AppUIFigure matlab.ui.Figure AppPanel matlab.ui.container.Panel Panel_3 matlab.ui.container.Panel Label_4 matlab.ui.control.Label Label_2 matlab.ui.control.Label Label matlab.ui.control.Label UITable_3 matlab.ui.control.Table UITable_2 matlab.ui.control.Table UITable matlab.ui.control.Table UIAxes_3 matlab.ui.control.UIAxes UIAxes_2 matlab.ui.control.UIAxes UIAxes matlab.ui.control.UIAxes Panel_2 matlab.ui.container.Panel Button_4 matlab.ui.control.Button Button_3 matlab.ui.control.Button Button_2 matlab.ui.control.Button Panel matlab.ui.container.Panel Button matlab.ui.control.Button end % Callbacks that handle component events methods (Access = private) % Button pushed function: Button function ButtonPushed(app, event) global data [filename,pathname,filterindex]=uigetfile({'.xlsx';'.xls'},'打开数据'); if ~filename return; end str1=[pathname,filename]; if (filename==0 & pathname==0) msgbox('您没有选择文件,请重新选择!','打开文件出错','error'); else data=xlsread (strcat([pathname filename])); msgbox('打开及读取数据完毕!','确认','warn'); end end % Button pushed function: Button_4 function Button_4Pushed(app, event) closereq; end % Button pushed function: Button_3 function Button_3Pushed(app, event) app.UITable.Data = []; app.UITable_2.Data = []; app.UITable_3.Data = []; try delete(allchild(app.UIAxes)); delete(allchild(app.UIAxes_2)); delete(allchild(app.UIAxes_3)); end end
本文内容来源于网络,仅供参考学习,如内容、图片有任何版权问题,请联系处理,24小时内删除。
作 者 | 郭志龙
编 辑 | 郭志龙校 对 | 郭志龙