拉丁超立方抽样
Posted 优化大师傅
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了拉丁超立方抽样相关的知识,希望对你有一定的参考价值。
import numpy as np
#区间下限函数
def partition_lower (lower_limit,upper_limit,number_of_sample):
section_variable = np.array([lower_limit, upper_limit]).reshape(-1,1) #变量区间上下限列向量
coefficient_f = np.zeros((number_of_sample,2))
for i in range(number_of_sample):
coefficient_f[i,0] = 1-(i)/number_of_sample
coefficient_f[i,1] = (i)/number_of_sample
partition_range = coefficient_f@section_variable
return partition_range #返回区间下限
#区间上限函数
def partition_upper (lower_limit,upper_limit,number_of_sample):
section_variable = np.array([lower_limit, upper_limit]).reshape(-1,1) #变量区间上下限列向量
coefficient_f = np.zeros((number_of_sample,2))
for i in range(number_of_sample):
coefficient_f[i,0] = 1-(i+1)/number_of_sample
coefficient_f[i,1] = (i+1)/number_of_sample
partition_range = coefficient_f@section_variable
return partition_range #返回区间上限
lower_limit = partition_lower(0,10,10) #将0-10分成10个等长区间,获得每个区间的下限
upper_limit = partition_upper(0,10,10) #将0-10分成10个等长区间,获得每个区间的上限
print(lower_limit.T)
print(upper_limit.T)
以上是关于拉丁超立方抽样的主要内容,如果未能解决你的问题,请参考以下文章
论文复现:模拟风电不确定性——拉丁超立方抽样生成及缩减场景(Matlab全代码)
论文复现:模拟风电不确定性——拉丁超立方抽样生成及缩减场景(Matlab全代码)