parent
c3f05ce4cc
commit
7e91bafa7f
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -24,6 +24,7 @@ classdef Opti
|
|||
rPD=NaN;
|
||||
rQD=NaN;
|
||||
mLoadCurrent=NaN;
|
||||
noLoadi=NaN;
|
||||
end
|
||||
|
||||
methods
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
function [ output_args,this ] = equ( this,x )
|
||||
%EQU Summary of this function goes here
|
||||
% Detailed explanation goes here
|
||||
output_args=[];
|
||||
PDi=this.PDi;
|
||||
QDi=this.QDi;
|
||||
Volt0=this.Volt0;
|
||||
|
|
@ -23,37 +24,44 @@ busNum=length(Volt0);
|
|||
VMatrix=sparse(r,c,VAngel(r)-VAngel(c)-Angel,busNum,busNum);
|
||||
dP=PG-PD_-diag(Volt)*(Y.*cos(VMatrix))*Volt;
|
||||
dQ=QG-QD_-diag(Volt)*(Y.*spfun(@sin,VMatrix))*Volt;
|
||||
output_args=[dP;dQ];
|
||||
output_args=[dP;dQ];%潮流约束
|
||||
%% 使用零注入begin
|
||||
% zeroInj=setdiff(1:busNum,union(Balance,union(PDi,QDi)));
|
||||
% output_args=[output_args(zeroInj);output_args(length(PDi)+zeroInj)];
|
||||
% output_args=[output_args(zeroInj);output_args(length(Volt0)+zeroInj)];
|
||||
%% 使用零注入end
|
||||
|
||||
%电压恒定
|
||||
output_args=[output_args;Volt(Balance)-1];
|
||||
%相角恒定
|
||||
output_args=[output_args;VAngel(Balance)];
|
||||
this.cu=zeros(length(output_args),1);
|
||||
this.cl=this.cu;
|
||||
this.cl=zeros(length(output_args),1);
|
||||
%% 开始增加不等式约束-电压\PD\QD
|
||||
%电压不等式约束
|
||||
output_args=[output_args;Volt];
|
||||
this.cu=[this.cu;1.1*ones(length(Volt),1)];
|
||||
this.cl=[this.cl;0.9*ones(length(Volt),1)];
|
||||
this.cu=[this.cu;1.07*ones(length(Volt),1)];%9节点
|
||||
this.cl=[this.cl;0.93*ones(length(Volt),1)];%9节点
|
||||
% this.cu=[this.cu;1.00*ones(length(Volt),1)];
|
||||
% this.cl=[this.cl;0.90*ones(length(Volt),1)];
|
||||
%% PD
|
||||
rPD=this.rPD;
|
||||
output_args=[output_args;PD];
|
||||
this.cu=[this.cu;1.5*rPD];
|
||||
this.cl=[this.cl;0.5*rPD];
|
||||
% PDU=[0.124;0.315;0.5;1;1;0.5;0.63;0.4];%原始数据
|
||||
% PDU=[0.63;0.4;0.5;1;0.8;1;0.63;0.4];%偏差比较大
|
||||
this.cu=[this.cu;1.2*rPD];
|
||||
this.cl=[this.cl;0.8*rPD];
|
||||
this.cu=[this.cu;PDU];
|
||||
this.cl=[this.cl;0*PDU];
|
||||
%% QD
|
||||
rQD=this.rQD;
|
||||
output_args=[output_args;QD];
|
||||
this.cu=[this.cu;1.9*rQD];
|
||||
this.cl=[this.cl;0.9*rQD];
|
||||
QDU=PDU;
|
||||
% this.cu=[this.cu;1.2*rQD];
|
||||
% this.cl=[this.cl;0.8*rQD];
|
||||
this.cu=[this.cu;QDU];
|
||||
this.cl=[this.cl;0*QDU];
|
||||
%% 稠密化
|
||||
output_args=full(output_args);
|
||||
this.cu=full(this.cu);
|
||||
this.cl=full(this.cl);
|
||||
|
||||
end
|
||||
|
||||
|
|
|
|||
20
@Opti/equ.m
20
@Opti/equ.m
|
|
@ -1,6 +1,7 @@
|
|||
function [ output_args,this ] = equ( this,x )
|
||||
%EQU Summary of this function goes here
|
||||
% Detailed explanation goes here
|
||||
output_args=[];
|
||||
PDi=this.PDi;
|
||||
QDi=this.QDi;
|
||||
Volt0=this.Volt0;
|
||||
|
|
@ -23,37 +24,44 @@ busNum=length(Volt0);
|
|||
VMatrix=sparse(r,c,VAngel(r)-VAngel(c)-Angel,busNum,busNum);
|
||||
dP=PG-PD_-diag(Volt)*(Y.*cos(VMatrix))*Volt;
|
||||
dQ=QG-QD_-diag(Volt)*(Y.*spfun(@sin,VMatrix))*Volt;
|
||||
output_args=[dP;dQ];
|
||||
output_args=[dP;dQ];%潮流约束
|
||||
%% 使用零注入begin
|
||||
% zeroInj=setdiff(1:busNum,union(Balance,union(PDi,QDi)));
|
||||
% output_args=[output_args(zeroInj);output_args(length(Volt0)+zeroInj)];
|
||||
%% 使用零注入end
|
||||
|
||||
%电压恒定
|
||||
output_args=[output_args;Volt(Balance)-1];
|
||||
%相角恒定
|
||||
output_args=[output_args;VAngel(Balance)];
|
||||
this.cu=zeros(length(output_args),1);
|
||||
this.cl=this.cu;
|
||||
this.cl=zeros(length(output_args),1);
|
||||
%% 开始增加不等式约束-电压\PD\QD
|
||||
%电压不等式约束
|
||||
output_args=[output_args;Volt];
|
||||
this.cu=[this.cu;1.07*ones(length(Volt),1)];
|
||||
this.cl=[this.cl;0.93*ones(length(Volt),1)];
|
||||
% this.cu=[this.cu;1.07*ones(length(Volt),1)];%9节点
|
||||
% this.cl=[this.cl;0.93*ones(length(Volt),1)];%9节点
|
||||
this.cu=[this.cu;1.00*ones(length(Volt),1)];
|
||||
this.cl=[this.cl;0.90*ones(length(Volt),1)];
|
||||
%% PD
|
||||
rPD=this.rPD;
|
||||
output_args=[output_args;PD];
|
||||
% PDU=[0.124;0.315;0.5;1;1;0.5;0.63;0.4];%原始数据
|
||||
% PDU=[0.63;0.4;0.5;1;0.8;1;0.63;0.4];%偏差比较大
|
||||
this.cu=[this.cu;1.2*rPD];
|
||||
this.cl=[this.cl;0.8*rPD];
|
||||
% this.cu=[this.cu;PDU];
|
||||
% this.cl=[this.cl;0*PDU];
|
||||
%% QD
|
||||
rQD=this.rQD;
|
||||
output_args=[output_args;QD];
|
||||
% QDU=PDU;
|
||||
this.cu=[this.cu;1.2*rQD];
|
||||
this.cl=[this.cl;0.8*rQD];
|
||||
% this.cu=[this.cu;QDU];
|
||||
% this.cl=[this.cl;0*QDU];
|
||||
%% 稠密化
|
||||
output_args=full(output_args);
|
||||
this.cu=full(this.cu);
|
||||
this.cl=full(this.cl);
|
||||
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
function [ this ] = init( this,Volt0,PDi,QDi,wPD,wQD,wVolt,wLoadCurrent,PD0,QD0,rPD,rQD,Y,Angel,r,c,PG,QG,Balance,mLoadCurrent)
|
||||
function [ this ] = init( this,Volt0,PDi,QDi,wPD,wQD,wVolt,wLoadCurrent,PD0,QD0,rPD,rQD,Y,Angel,r,c,PG,QG,Balance,mLoadCurrent,noLoadi)
|
||||
%INIT Summary of this function goes here
|
||||
% Detailed explanation goes here
|
||||
this.PDi=PDi;
|
||||
|
|
@ -20,5 +20,6 @@ this.rQD=rQD;
|
|||
this.wVolt=wVolt;
|
||||
this.wLoadCurrent=wLoadCurrent;
|
||||
this.mLoadCurrent=mLoadCurrent;
|
||||
this.noLoadi=noLoadi;
|
||||
end
|
||||
|
||||
|
|
|
|||
10
@Opti/obj.m
10
@Opti/obj.m
|
|
@ -10,19 +10,13 @@ wQD=this.wQD;
|
|||
PD0=this.PD0;
|
||||
QD0=this.QD0;
|
||||
t4=(wPD(PDi).*(PD-PD0(PDi))).^2;
|
||||
% t4=wPD(PDi).*((PD-PD0(PDi))./PD0(PDi)).^2;
|
||||
t5=(wQD(QDi).*(QD-QD0(QDi))).^2;
|
||||
% t5=wQD(QDi).*((QD-QD0(QDi))./QD0(QDi)).^2;
|
||||
Volt0=this.Volt0;
|
||||
SEVolt=x(length(PDi)+length(QDi)+1:length(PDi)+length(QDi)+length(Volt0));
|
||||
wVolt=this.wVolt;
|
||||
t6=(wVolt.*(SEVolt-Volt0)).^2;
|
||||
% t6=wVolt.*((SEVolt-Volt0)./Volt0).^2;
|
||||
t6=(wVolt.*((SEVolt-Volt0))).^2;
|
||||
Balance=this.Balance;
|
||||
t6(Balance)=0;%²»¼ÆËãÆ½ºâ½ÚµãµÄ
|
||||
% xx=t6(8);
|
||||
% t6=xx;
|
||||
% t6(9:end)=0;
|
||||
% µçÁ÷
|
||||
SEVAngel=x(length(PDi)+length(QDi)+length(SEVolt)+1:end);
|
||||
loadCurrent=LoadCurrent( SEVolt,SEVAngel,PD0(PDi),QD0(QDi),PDi,QDi );
|
||||
|
|
@ -30,7 +24,7 @@ wLoadCurrent=this.wLoadCurrent;
|
|||
mLoadCurrent=this.mLoadCurrent;
|
||||
% t7=(wLoadCurrent.*(loadCurrent-mLoadCurrent)).^2;
|
||||
t7=wLoadCurrent.*((loadCurrent-mLoadCurrent)./mLoadCurrent).^2;
|
||||
output_args=sum(t4)+sum(t5)+sum(t6)+sum(0);
|
||||
output_args=sum(t4)+sum(t5)+sum(t6);
|
||||
output_args=full(output_args);
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
retail=dlmread('E:\书籍\论文\配电网状态估计\零售业负荷.txt');
|
||||
retail=retail/max(retail);
|
||||
tobacco=dlmread('E:\书籍\论文\配电网状态估计\烟草负荷.txt');
|
||||
tobacco=tobacco/max(retail);
|
||||
residential=dlmread('E:\书籍\论文\配电网状态估计\城镇居民负荷.txt');
|
||||
residential=residential/max(retail);
|
||||
x=1:length(retail);
|
||||
subplot(2,2,1);
|
||||
plot(x,retai
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
clear
|
||||
clc
|
||||
retail=dlmread('E:\书籍\论文\配电网状态估计\零售业负荷.txt');
|
||||
retail=retail/1000;
|
||||
retail(length(retail)+1)=retail(end)*0.98;
|
||||
tobacco=dlmread('E:\书籍\论文\配电网状态估计\烟草负荷.txt');
|
||||
tobacco=tobacco/1;
|
||||
tobacco(length(tobacco)+1)=tobacco(end)*1.02;
|
||||
residential=dlmread('E:\书籍\论文\配电网状态估计\城镇居民负荷.txt');
|
||||
residential=residential/10000;
|
||||
residential(length(residential)+1)=residential(end)*0.98;
|
||||
figure('Color',[1 1 1]);
|
||||
x=0:length(retail)-1;
|
||||
subplot(2,2,1);
|
||||
plot(x/4,residential);
|
||||
xlim([0 24]);
|
||||
% ylim([0 1.05]);
|
||||
set(gca,'xtick', x)
|
||||
xlabel('时刻/时');
|
||||
ylabel('kW');
|
||||
title('居民负荷');
|
||||
% set(gca,'ytick',[]);
|
||||
subplot(2,2,2);
|
||||
plot(x/4,tobacco);
|
||||
xlim([0 24]);
|
||||
% ylim([0 1.05]);
|
||||
set(gca,'xtick', x)
|
||||
xlabel('时刻/时');
|
||||
ylabel('kW');
|
||||
title('工业负荷');
|
||||
subplot(2,2,3);
|
||||
plot(x/4,retail);
|
||||
xlim([0 24]);
|
||||
% ylim([0 1.05]);
|
||||
set(gca,'xtick', x)
|
||||
xlabel('时刻/时');
|
||||
ylabel('kW');
|
||||
title('商业负荷');
|
||||
|
|
@ -0,0 +1,705 @@
|
|||
Model {
|
||||
Name "Filtering"
|
||||
Version 7.5
|
||||
MdlSubVersion 0
|
||||
GraphicalInterface {
|
||||
NumRootInports 0
|
||||
NumRootOutports 0
|
||||
ParameterArgumentNames ""
|
||||
ComputedModelVersion "1.6"
|
||||
NumModelReferences 0
|
||||
NumTestPointedSignals 0
|
||||
}
|
||||
SavedCharacterEncoding "GBK"
|
||||
SaveDefaultBlockParams on
|
||||
ScopeRefreshTime 0.035000
|
||||
OverrideScopeRefreshTime on
|
||||
DisableAllScopes off
|
||||
DataTypeOverride "UseLocalSettings"
|
||||
MinMaxOverflowLogging "UseLocalSettings"
|
||||
MinMaxOverflowArchiveMode "Overwrite"
|
||||
MaxMDLFileLineLength 120
|
||||
Created "Thu Oct 17 10:08:19 2013"
|
||||
Creator "dmy"
|
||||
UpdateHistory "UpdateHistoryNever"
|
||||
ModifiedByFormat "%<Auto>"
|
||||
LastModifiedBy "dmy"
|
||||
ModifiedDateFormat "%<Auto>"
|
||||
LastModifiedDate "Sat Oct 19 16:47:19 2013"
|
||||
RTWModifiedTimeStamp 304102038
|
||||
ModelVersionFormat "1.%<AutoIncrement:6>"
|
||||
ConfigurationManager "None"
|
||||
SampleTimeColors off
|
||||
SampleTimeAnnotations off
|
||||
LibraryLinkDisplay "none"
|
||||
WideLines off
|
||||
ShowLineDimensions off
|
||||
ShowPortDataTypes off
|
||||
ShowLoopsOnError on
|
||||
IgnoreBidirectionalLines off
|
||||
ShowStorageClass off
|
||||
ShowTestPointIcons on
|
||||
ShowSignalResolutionIcons on
|
||||
ShowViewerIcons on
|
||||
SortedOrder off
|
||||
ExecutionContextIcon off
|
||||
ShowLinearizationAnnotations on
|
||||
BlockNameDataTip off
|
||||
BlockParametersDataTip off
|
||||
BlockDescriptionStringDataTip off
|
||||
ToolBar on
|
||||
StatusBar on
|
||||
BrowserShowLibraryLinks off
|
||||
BrowserLookUnderMasks off
|
||||
SimulationMode "normal"
|
||||
LinearizationMsg "none"
|
||||
Profile off
|
||||
ParamWorkspaceSource "MATLABWorkspace"
|
||||
AccelSystemTargetFile "accel.tlc"
|
||||
AccelTemplateMakefile "accel_default_tmf"
|
||||
AccelMakeCommand "make_rtw"
|
||||
TryForcingSFcnDF off
|
||||
RecordCoverage off
|
||||
CovPath "/"
|
||||
CovSaveName "covdata"
|
||||
CovMetricSettings "dw"
|
||||
CovNameIncrementing off
|
||||
CovHtmlReporting on
|
||||
CovForceBlockReductionOff on
|
||||
covSaveCumulativeToWorkspaceVar on
|
||||
CovSaveSingleToWorkspaceVar on
|
||||
CovCumulativeVarName "covCumulativeData"
|
||||
CovCumulativeReport off
|
||||
CovReportOnPause on
|
||||
CovModelRefEnable "Off"
|
||||
CovExternalEMLEnable off
|
||||
ExtModeBatchMode off
|
||||
ExtModeEnableFloating on
|
||||
ExtModeTrigType "manual"
|
||||
ExtModeTrigMode "normal"
|
||||
ExtModeTrigPort "1"
|
||||
ExtModeTrigElement "any"
|
||||
ExtModeTrigDuration 1000
|
||||
ExtModeTrigDurationFloating "auto"
|
||||
ExtModeTrigHoldOff 0
|
||||
ExtModeTrigDelay 0
|
||||
ExtModeTrigDirection "rising"
|
||||
ExtModeTrigLevel 0
|
||||
ExtModeArchiveMode "off"
|
||||
ExtModeAutoIncOneShot off
|
||||
ExtModeIncDirWhenArm off
|
||||
ExtModeAddSuffixToVar off
|
||||
ExtModeWriteAllDataToWs off
|
||||
ExtModeArmWhenConnect on
|
||||
ExtModeSkipDownloadWhenConnect off
|
||||
ExtModeLogAll on
|
||||
ExtModeAutoUpdateStatusClock on
|
||||
BufferReuse on
|
||||
ShowModelReferenceBlockVersion off
|
||||
ShowModelReferenceBlockIO off
|
||||
Array {
|
||||
Type "Handle"
|
||||
Dimension 1
|
||||
Simulink.ConfigSet {
|
||||
$ObjectID 1
|
||||
Version "1.10.0"
|
||||
Array {
|
||||
Type "Handle"
|
||||
Dimension 9
|
||||
Simulink.SolverCC {
|
||||
$ObjectID 2
|
||||
Version "1.10.0"
|
||||
StartTime "0.0"
|
||||
StopTime "96"
|
||||
AbsTol "auto"
|
||||
FixedStep "auto"
|
||||
InitialStep "auto"
|
||||
MaxNumMinSteps "-1"
|
||||
MaxOrder 5
|
||||
ZcThreshold "auto"
|
||||
ConsecutiveZCsStepRelTol "10*128*eps"
|
||||
MaxConsecutiveZCs "1000"
|
||||
ExtrapolationOrder 4
|
||||
NumberNewtonIterations 1
|
||||
MaxStep "auto"
|
||||
MinStep "auto"
|
||||
MaxConsecutiveMinStep "1"
|
||||
RelTol "1e-3"
|
||||
SolverMode "Auto"
|
||||
Solver "ode45"
|
||||
SolverName "ode45"
|
||||
SolverJacobianMethodControl "auto"
|
||||
ShapePreserveControl "DisableAll"
|
||||
ZeroCrossControl "UseLocalSettings"
|
||||
ZeroCrossAlgorithm "Nonadaptive"
|
||||
AlgebraicLoopSolver "TrustRegion"
|
||||
SolverResetMethod "Fast"
|
||||
PositivePriorityOrder off
|
||||
AutoInsertRateTranBlk off
|
||||
SampleTimeConstraint "Unconstrained"
|
||||
InsertRTBMode "Whenever possible"
|
||||
}
|
||||
Simulink.DataIOCC {
|
||||
$ObjectID 3
|
||||
Version "1.10.0"
|
||||
Decimation "1"
|
||||
ExternalInput "[t, u]"
|
||||
FinalStateName "xFinal"
|
||||
InitialState "xInitial"
|
||||
LimitDataPoints on
|
||||
MaxDataPoints "1000"
|
||||
LoadExternalInput off
|
||||
LoadInitialState off
|
||||
SaveFinalState off
|
||||
SaveCompleteFinalSimState off
|
||||
SaveFormat "Array"
|
||||
SaveOutput on
|
||||
SaveState off
|
||||
SignalLogging on
|
||||
DSMLogging on
|
||||
InspectSignalLogs off
|
||||
SaveTime on
|
||||
ReturnWorkspaceOutputs off
|
||||
StateSaveName "xout"
|
||||
TimeSaveName "tout"
|
||||
OutputSaveName "yout"
|
||||
SignalLoggingName "logsout"
|
||||
DSMLoggingName "dsmout"
|
||||
OutputOption "RefineOutputTimes"
|
||||
OutputTimes "[]"
|
||||
ReturnWorkspaceOutputsName "out"
|
||||
Refine "1"
|
||||
}
|
||||
Simulink.OptimizationCC {
|
||||
$ObjectID 4
|
||||
Version "1.10.0"
|
||||
Array {
|
||||
Type "Cell"
|
||||
Dimension 7
|
||||
Cell "BooleansAsBitfields"
|
||||
Cell "PassReuseOutputArgsAs"
|
||||
Cell "PassReuseOutputArgsThreshold"
|
||||
Cell "ZeroExternalMemoryAtStartup"
|
||||
Cell "ZeroInternalMemoryAtStartup"
|
||||
Cell "OptimizeModelRefInitCode"
|
||||
Cell "NoFixptDivByZeroProtection"
|
||||
PropName "DisabledProps"
|
||||
}
|
||||
BlockReduction on
|
||||
BooleanDataType on
|
||||
ConditionallyExecuteInputs on
|
||||
InlineParams off
|
||||
UseIntDivNetSlope off
|
||||
InlineInvariantSignals off
|
||||
OptimizeBlockIOStorage on
|
||||
BufferReuse on
|
||||
EnhancedBackFolding off
|
||||
StrengthReduction off
|
||||
EnforceIntegerDowncast on
|
||||
ExpressionFolding on
|
||||
BooleansAsBitfields off
|
||||
BitfieldContainerType "uint_T"
|
||||
EnableMemcpy on
|
||||
MemcpyThreshold 64
|
||||
PassReuseOutputArgsAs "Structure reference"
|
||||
ExpressionDepthLimit 2147483647
|
||||
FoldNonRolledExpr on
|
||||
LocalBlockOutputs on
|
||||
RollThreshold 5
|
||||
SystemCodeInlineAuto off
|
||||
StateBitsets off
|
||||
DataBitsets off
|
||||
UseTempVars off
|
||||
ZeroExternalMemoryAtStartup on
|
||||
ZeroInternalMemoryAtStartup on
|
||||
InitFltsAndDblsToZero off
|
||||
NoFixptDivByZeroProtection off
|
||||
EfficientFloat2IntCast off
|
||||
EfficientMapNaN2IntZero on
|
||||
OptimizeModelRefInitCode off
|
||||
LifeSpan "inf"
|
||||
MaxStackSize "Inherit from target"
|
||||
BufferReusableBoundary on
|
||||
SimCompilerOptimization "Off"
|
||||
AccelVerboseBuild off
|
||||
}
|
||||
Simulink.DebuggingCC {
|
||||
$ObjectID 5
|
||||
Version "1.10.0"
|
||||
RTPrefix "error"
|
||||
ConsistencyChecking "none"
|
||||
ArrayBoundsChecking "none"
|
||||
SignalInfNanChecking "none"
|
||||
SignalRangeChecking "none"
|
||||
ReadBeforeWriteMsg "UseLocalSettings"
|
||||
WriteAfterWriteMsg "UseLocalSettings"
|
||||
WriteAfterReadMsg "UseLocalSettings"
|
||||
AlgebraicLoopMsg "warning"
|
||||
ArtificialAlgebraicLoopMsg "warning"
|
||||
SaveWithDisabledLinksMsg "warning"
|
||||
SaveWithParameterizedLinksMsg "warning"
|
||||
CheckSSInitialOutputMsg on
|
||||
UnderspecifiedInitializationDetection "Classic"
|
||||
MergeDetectMultiDrivingBlocksExec "none"
|
||||
CheckExecutionContextPreStartOutputMsg off
|
||||
CheckExecutionContextRuntimeOutputMsg off
|
||||
SignalResolutionControl "UseLocalSettings"
|
||||
BlockPriorityViolationMsg "warning"
|
||||
MinStepSizeMsg "warning"
|
||||
TimeAdjustmentMsg "none"
|
||||
MaxConsecutiveZCsMsg "error"
|
||||
SolverPrmCheckMsg "warning"
|
||||
InheritedTsInSrcMsg "warning"
|
||||
DiscreteInheritContinuousMsg "warning"
|
||||
MultiTaskDSMMsg "error"
|
||||
MultiTaskCondExecSysMsg "error"
|
||||
MultiTaskRateTransMsg "error"
|
||||
SingleTaskRateTransMsg "none"
|
||||
TasksWithSamePriorityMsg "warning"
|
||||
SigSpecEnsureSampleTimeMsg "warning"
|
||||
CheckMatrixSingularityMsg "none"
|
||||
IntegerOverflowMsg "warning"
|
||||
Int32ToFloatConvMsg "warning"
|
||||
ParameterDowncastMsg "error"
|
||||
ParameterOverflowMsg "error"
|
||||
ParameterUnderflowMsg "none"
|
||||
ParameterPrecisionLossMsg "warning"
|
||||
ParameterTunabilityLossMsg "warning"
|
||||
FixptConstUnderflowMsg "none"
|
||||
FixptConstOverflowMsg "none"
|
||||
FixptConstPrecisionLossMsg "none"
|
||||
UnderSpecifiedDataTypeMsg "none"
|
||||
UnnecessaryDatatypeConvMsg "none"
|
||||
VectorMatrixConversionMsg "none"
|
||||
InvalidFcnCallConnMsg "error"
|
||||
FcnCallInpInsideContextMsg "Use local settings"
|
||||
SignalLabelMismatchMsg "none"
|
||||
UnconnectedInputMsg "warning"
|
||||
UnconnectedOutputMsg "warning"
|
||||
UnconnectedLineMsg "warning"
|
||||
SFcnCompatibilityMsg "none"
|
||||
UniqueDataStoreMsg "none"
|
||||
BusObjectLabelMismatch "warning"
|
||||
RootOutportRequireBusObject "warning"
|
||||
AssertControl "UseLocalSettings"
|
||||
EnableOverflowDetection off
|
||||
ModelReferenceIOMsg "none"
|
||||
ModelReferenceVersionMismatchMessage "none"
|
||||
ModelReferenceIOMismatchMessage "none"
|
||||
ModelReferenceCSMismatchMessage "none"
|
||||
UnknownTsInhSupMsg "warning"
|
||||
ModelReferenceDataLoggingMessage "warning"
|
||||
ModelReferenceSymbolNameMessage "warning"
|
||||
ModelReferenceExtraNoncontSigs "error"
|
||||
StateNameClashWarn "warning"
|
||||
SimStateInterfaceChecksumMismatchMsg "warning"
|
||||
StrictBusMsg "ErrorLevel1"
|
||||
BusNameAdapt "WarnAndRepair"
|
||||
NonBusSignalsTreatedAsBus "none"
|
||||
LoggingUnavailableSignals "error"
|
||||
BlockIODiagnostic "none"
|
||||
}
|
||||
Simulink.HardwareCC {
|
||||
$ObjectID 6
|
||||
Version "1.10.0"
|
||||
ProdBitPerChar 8
|
||||
ProdBitPerShort 16
|
||||
ProdBitPerInt 32
|
||||
ProdBitPerLong 32
|
||||
ProdIntDivRoundTo "Undefined"
|
||||
ProdEndianess "Unspecified"
|
||||
ProdWordSize 32
|
||||
ProdShiftRightIntArith on
|
||||
ProdHWDeviceType "32-bit Generic"
|
||||
TargetBitPerChar 8
|
||||
TargetBitPerShort 16
|
||||
TargetBitPerInt 32
|
||||
TargetBitPerLong 32
|
||||
TargetShiftRightIntArith on
|
||||
TargetIntDivRoundTo "Undefined"
|
||||
TargetEndianess "Unspecified"
|
||||
TargetWordSize 32
|
||||
TargetTypeEmulationWarnSuppressLevel 0
|
||||
TargetPreprocMaxBitsSint 32
|
||||
TargetPreprocMaxBitsUint 32
|
||||
TargetHWDeviceType "Specified"
|
||||
TargetUnknown off
|
||||
ProdEqTarget on
|
||||
}
|
||||
Simulink.ModelReferenceCC {
|
||||
$ObjectID 7
|
||||
Version "1.10.0"
|
||||
UpdateModelReferenceTargets "IfOutOfDateOrStructuralChange"
|
||||
CheckModelReferenceTargetMessage "error"
|
||||
EnableParallelModelReferenceBuilds off
|
||||
ParallelModelReferenceMATLABWorkerInit "None"
|
||||
ModelReferenceNumInstancesAllowed "Multi"
|
||||
PropagateVarSize "Infer from blocks in model"
|
||||
ModelReferencePassRootInputsByReference on
|
||||
ModelReferenceMinAlgLoopOccurrences off
|
||||
PropagateSignalLabelsOutOfModel off
|
||||
SupportModelReferenceSimTargetCustomCode off
|
||||
}
|
||||
Simulink.SFSimCC {
|
||||
$ObjectID 8
|
||||
Version "1.10.0"
|
||||
SFSimEnableDebug on
|
||||
SFSimOverflowDetection on
|
||||
SFSimEcho on
|
||||
SimBlas on
|
||||
SimCtrlC on
|
||||
SimExtrinsic on
|
||||
SimIntegrity on
|
||||
SimUseLocalCustomCode off
|
||||
SimBuildMode "sf_incremental_build"
|
||||
}
|
||||
Simulink.RTWCC {
|
||||
$BackupClass "Simulink.RTWCC"
|
||||
$ObjectID 9
|
||||
Version "1.10.0"
|
||||
Array {
|
||||
Type "Cell"
|
||||
Dimension 6
|
||||
Cell "IncludeHyperlinkInReport"
|
||||
Cell "GenerateTraceInfo"
|
||||
Cell "GenerateTraceReport"
|
||||
Cell "GenerateTraceReportSl"
|
||||
Cell "GenerateTraceReportSf"
|
||||
Cell "GenerateTraceReportEml"
|
||||
PropName "DisabledProps"
|
||||
}
|
||||
SystemTargetFile "grt.tlc"
|
||||
GenCodeOnly off
|
||||
MakeCommand "make_rtw"
|
||||
GenerateMakefile on
|
||||
TemplateMakefile "grt_default_tmf"
|
||||
GenerateReport off
|
||||
SaveLog off
|
||||
RTWVerbose on
|
||||
RetainRTWFile off
|
||||
ProfileTLC off
|
||||
TLCDebug off
|
||||
TLCCoverage off
|
||||
TLCAssert off
|
||||
ProcessScriptMode "Default"
|
||||
ConfigurationMode "Optimized"
|
||||
ConfigAtBuild off
|
||||
RTWUseLocalCustomCode off
|
||||
RTWUseSimCustomCode off
|
||||
IncludeHyperlinkInReport off
|
||||
LaunchReport off
|
||||
TargetLang "C"
|
||||
IncludeBusHierarchyInRTWFileBlockHierarchyMap off
|
||||
IncludeERTFirstTime off
|
||||
GenerateTraceInfo off
|
||||
GenerateTraceReport off
|
||||
GenerateTraceReportSl off
|
||||
GenerateTraceReportSf off
|
||||
GenerateTraceReportEml off
|
||||
GenerateCodeInfo off
|
||||
RTWCompilerOptimization "Off"
|
||||
CheckMdlBeforeBuild "Off"
|
||||
CustomRebuildMode "OnUpdate"
|
||||
Array {
|
||||
Type "Handle"
|
||||
Dimension 2
|
||||
Simulink.CodeAppCC {
|
||||
$ObjectID 10
|
||||
Version "1.10.0"
|
||||
Array {
|
||||
Type "Cell"
|
||||
Dimension 19
|
||||
Cell "IgnoreCustomStorageClasses"
|
||||
Cell "IgnoreTestpoints"
|
||||
Cell "InsertBlockDesc"
|
||||
Cell "SFDataObjDesc"
|
||||
Cell "SimulinkDataObjDesc"
|
||||
Cell "DefineNamingRule"
|
||||
Cell "SignalNamingRule"
|
||||
Cell "ParamNamingRule"
|
||||
Cell "InlinedPrmAccess"
|
||||
Cell "CustomSymbolStr"
|
||||
Cell "CustomSymbolStrGlobalVar"
|
||||
Cell "CustomSymbolStrType"
|
||||
Cell "CustomSymbolStrField"
|
||||
Cell "CustomSymbolStrFcn"
|
||||
Cell "CustomSymbolStrFcnArg"
|
||||
Cell "CustomSymbolStrBlkIO"
|
||||
Cell "CustomSymbolStrTmpVar"
|
||||
Cell "CustomSymbolStrMacro"
|
||||
Cell "ReqsInCode"
|
||||
PropName "DisabledProps"
|
||||
}
|
||||
ForceParamTrailComments off
|
||||
GenerateComments on
|
||||
IgnoreCustomStorageClasses on
|
||||
IgnoreTestpoints off
|
||||
IncHierarchyInIds off
|
||||
MaxIdLength 31
|
||||
PreserveName off
|
||||
PreserveNameWithParent off
|
||||
ShowEliminatedStatement off
|
||||
IncAutoGenComments off
|
||||
SimulinkDataObjDesc off
|
||||
SFDataObjDesc off
|
||||
IncDataTypeInIds off
|
||||
MangleLength 1
|
||||
CustomSymbolStrGlobalVar "$R$N$M"
|
||||
CustomSymbolStrType "$N$R$M"
|
||||
CustomSymbolStrField "$N$M"
|
||||
CustomSymbolStrFcn "$R$N$M$F"
|
||||
CustomSymbolStrFcnArg "rt$I$N$M"
|
||||
CustomSymbolStrBlkIO "rtb_$N$M"
|
||||
CustomSymbolStrTmpVar "$N$M"
|
||||
CustomSymbolStrMacro "$R$N$M"
|
||||
DefineNamingRule "None"
|
||||
ParamNamingRule "None"
|
||||
SignalNamingRule "None"
|
||||
InsertBlockDesc off
|
||||
SimulinkBlockComments on
|
||||
EnableCustomComments off
|
||||
InlinedPrmAccess "Literals"
|
||||
ReqsInCode off
|
||||
UseSimReservedNames off
|
||||
}
|
||||
Simulink.GRTTargetCC {
|
||||
$BackupClass "Simulink.TargetCC"
|
||||
$ObjectID 11
|
||||
Version "1.10.0"
|
||||
Array {
|
||||
Type "Cell"
|
||||
Dimension 17
|
||||
Cell "GeneratePreprocessorConditionals"
|
||||
Cell "IncludeMdlTerminateFcn"
|
||||
Cell "CombineOutputUpdateFcns"
|
||||
Cell "SuppressErrorStatus"
|
||||
Cell "ERTCustomFileBanners"
|
||||
Cell "GenerateSampleERTMain"
|
||||
Cell "GenerateTestInterfaces"
|
||||
Cell "ModelStepFunctionPrototypeControlCompliant"
|
||||
Cell "CPPClassGenCompliant"
|
||||
Cell "MultiInstanceERTCode"
|
||||
Cell "PurelyIntegerCode"
|
||||
Cell "SupportNonFinite"
|
||||
Cell "SupportComplex"
|
||||
Cell "SupportAbsoluteTime"
|
||||
Cell "SupportContinuousTime"
|
||||
Cell "SupportNonInlinedSFcns"
|
||||
Cell "PortableWordSizes"
|
||||
PropName "DisabledProps"
|
||||
}
|
||||
TargetFcnLib "ansi_tfl_table_tmw.mat"
|
||||
TargetLibSuffix ""
|
||||
TargetPreCompLibLocation ""
|
||||
TargetFunctionLibrary "ANSI_C"
|
||||
UtilityFuncGeneration "Auto"
|
||||
ERTMultiwordTypeDef "System defined"
|
||||
ERTCodeCoverageTool "None"
|
||||
ERTMultiwordLength 256
|
||||
MultiwordLength 2048
|
||||
GenerateFullHeader on
|
||||
GenerateSampleERTMain off
|
||||
GenerateTestInterfaces off
|
||||
IsPILTarget off
|
||||
ModelReferenceCompliant on
|
||||
ParMdlRefBuildCompliant on
|
||||
CompOptLevelCompliant on
|
||||
IncludeMdlTerminateFcn on
|
||||
GeneratePreprocessorConditionals "Disable all"
|
||||
CombineOutputUpdateFcns off
|
||||
SuppressErrorStatus off
|
||||
ERTFirstTimeCompliant off
|
||||
IncludeFileDelimiter "Auto"
|
||||
ERTCustomFileBanners off
|
||||
SupportAbsoluteTime on
|
||||
LogVarNameModifier "rt_"
|
||||
MatFileLogging on
|
||||
MultiInstanceERTCode off
|
||||
SupportNonFinite on
|
||||
SupportComplex on
|
||||
PurelyIntegerCode off
|
||||
SupportContinuousTime on
|
||||
SupportNonInlinedSFcns on
|
||||
SupportVariableSizeSignals off
|
||||
EnableShiftOperators on
|
||||
ParenthesesLevel "Nominal"
|
||||
PortableWordSizes off
|
||||
ModelStepFunctionPrototypeControlCompliant off
|
||||
CPPClassGenCompliant off
|
||||
AutosarCompliant off
|
||||
UseMalloc off
|
||||
ExtMode off
|
||||
ExtModeStaticAlloc off
|
||||
ExtModeTesting off
|
||||
ExtModeStaticAllocSize 1000000
|
||||
ExtModeTransport 0
|
||||
ExtModeMexFile "ext_comm"
|
||||
ExtModeIntrfLevel "Level1"
|
||||
RTWCAPISignals off
|
||||
RTWCAPIParams off
|
||||
RTWCAPIStates off
|
||||
GenerateASAP2 off
|
||||
}
|
||||
PropName "Components"
|
||||
}
|
||||
}
|
||||
hdlcoderui.hdlcc {
|
||||
$ObjectID 12
|
||||
Version "1.10.0"
|
||||
Description "HDL Coder custom configuration component"
|
||||
Name "HDL Coder"
|
||||
Array {
|
||||
Type "Cell"
|
||||
Dimension 1
|
||||
Cell ""
|
||||
PropName "HDLConfigFile"
|
||||
}
|
||||
HDLCActiveTab "0"
|
||||
}
|
||||
PropName "Components"
|
||||
}
|
||||
Name "Configuration"
|
||||
CurrentDlgPage "Solver"
|
||||
ConfigPrmDlgPosition " [ 520, 225, 1400, 855 ] "
|
||||
}
|
||||
PropName "ConfigurationSets"
|
||||
}
|
||||
Simulink.ConfigSet {
|
||||
$PropName "ActiveConfigurationSet"
|
||||
$ObjectID 1
|
||||
}
|
||||
BlockDefaults {
|
||||
ForegroundColor "black"
|
||||
BackgroundColor "white"
|
||||
DropShadow off
|
||||
NamePlacement "normal"
|
||||
FontName "Helvetica"
|
||||
FontSize 10
|
||||
FontWeight "normal"
|
||||
FontAngle "normal"
|
||||
ShowName on
|
||||
BlockRotation 0
|
||||
BlockMirror off
|
||||
}
|
||||
AnnotationDefaults {
|
||||
HorizontalAlignment "center"
|
||||
VerticalAlignment "middle"
|
||||
ForegroundColor "black"
|
||||
BackgroundColor "white"
|
||||
DropShadow off
|
||||
FontName "Helvetica"
|
||||
FontSize 10
|
||||
FontWeight "normal"
|
||||
FontAngle "normal"
|
||||
UseDisplayTextAsClickCallback off
|
||||
}
|
||||
LineDefaults {
|
||||
FontName "Helvetica"
|
||||
FontSize 9
|
||||
FontWeight "normal"
|
||||
FontAngle "normal"
|
||||
}
|
||||
BlockParameterDefaults {
|
||||
Block {
|
||||
BlockType Clock
|
||||
DisplayTime off
|
||||
}
|
||||
Block {
|
||||
BlockType Fcn
|
||||
Expr "sin(u[1])"
|
||||
SampleTime "-1"
|
||||
}
|
||||
Block {
|
||||
BlockType Scope
|
||||
ModelBased off
|
||||
TickLabels "OneTimeTick"
|
||||
ZoomMode "on"
|
||||
Grid "on"
|
||||
TimeRange "auto"
|
||||
YMin "-5"
|
||||
YMax "5"
|
||||
SaveToWorkspace off
|
||||
SaveName "ScopeData"
|
||||
LimitDataPoints on
|
||||
MaxDataPoints "5000"
|
||||
Decimation "1"
|
||||
SampleInput off
|
||||
SampleTime "-1"
|
||||
}
|
||||
}
|
||||
System {
|
||||
Name "Filtering"
|
||||
Location [610, 390, 1194, 889]
|
||||
Open on
|
||||
ModelBrowserVisibility off
|
||||
ModelBrowserWidth 200
|
||||
ScreenColor "white"
|
||||
PaperOrientation "landscape"
|
||||
PaperPositionMode "auto"
|
||||
PaperType "A4"
|
||||
PaperUnits "centimeters"
|
||||
TiledPaperMargins [1.270000, 1.270000, 1.270000, 1.270000]
|
||||
TiledPageScale 1
|
||||
ShowPageBoundaries off
|
||||
ZoomFactor "100"
|
||||
ReportName "simulink-default.rpt"
|
||||
SIDHighWatermark 11
|
||||
Block {
|
||||
BlockType Clock
|
||||
Name "Clock"
|
||||
SID 7
|
||||
Position [85, 245, 105, 265]
|
||||
DisplayTime on
|
||||
Decimation "10"
|
||||
}
|
||||
Block {
|
||||
BlockType Fcn
|
||||
Name "Fcn"
|
||||
SID 8
|
||||
Position [175, 125, 235, 155]
|
||||
Expr "-4568*x(1)^9+1049*x(1)^8+3.027e4*x(1)^7-9207*x(1)^6-6.556e4*x(1)^5+2.979e4*x(1)^4+4.438e4*x(1)^3-4."
|
||||
"276e4*x(1)^2+7355*x(1)+4.344e4"
|
||||
}
|
||||
Block {
|
||||
BlockType Scope
|
||||
Name "Scope"
|
||||
SID 6
|
||||
Ports [2]
|
||||
Position [400, 131, 430, 164]
|
||||
Floating off
|
||||
Location [153, 268, 1586, 860]
|
||||
Open off
|
||||
NumInputPorts "2"
|
||||
List {
|
||||
ListType AxesTitles
|
||||
axes1 "%<SignalLabel>"
|
||||
axes2 "%<SignalLabel>"
|
||||
}
|
||||
YMin "-5~-5"
|
||||
YMax "5~5"
|
||||
DataFormat "StructureWithTime"
|
||||
SampleTime "0"
|
||||
}
|
||||
Line {
|
||||
SrcBlock "Fcn"
|
||||
SrcPort 1
|
||||
DstBlock "Scope"
|
||||
DstPort 1
|
||||
}
|
||||
Line {
|
||||
SrcBlock "Clock"
|
||||
SrcPort 1
|
||||
Points [0, -25; 35, 0; 0, -20]
|
||||
Branch {
|
||||
Points [0, -70]
|
||||
DstBlock "Fcn"
|
||||
DstPort 1
|
||||
}
|
||||
Branch {
|
||||
Points [200, 0; 0, -55]
|
||||
DstBlock "Scope"
|
||||
DstPort 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,704 @@
|
|||
Model {
|
||||
Name "Filtering"
|
||||
Version 7.5
|
||||
MdlSubVersion 0
|
||||
GraphicalInterface {
|
||||
NumRootInports 0
|
||||
NumRootOutports 0
|
||||
ParameterArgumentNames ""
|
||||
ComputedModelVersion "1.6"
|
||||
NumModelReferences 0
|
||||
NumTestPointedSignals 0
|
||||
}
|
||||
SavedCharacterEncoding "GBK"
|
||||
SaveDefaultBlockParams on
|
||||
ScopeRefreshTime 0.035000
|
||||
OverrideScopeRefreshTime on
|
||||
DisableAllScopes off
|
||||
DataTypeOverride "UseLocalSettings"
|
||||
MinMaxOverflowLogging "UseLocalSettings"
|
||||
MinMaxOverflowArchiveMode "Overwrite"
|
||||
MaxMDLFileLineLength 120
|
||||
Created "Thu Oct 17 10:08:19 2013"
|
||||
Creator "dmy"
|
||||
UpdateHistory "UpdateHistoryNever"
|
||||
ModifiedByFormat "%<Auto>"
|
||||
LastModifiedBy "dmy"
|
||||
ModifiedDateFormat "%<Auto>"
|
||||
LastModifiedDate "Sat Oct 19 16:47:19 2013"
|
||||
RTWModifiedTimeStamp 304102446
|
||||
ModelVersionFormat "1.%<AutoIncrement:6>"
|
||||
ConfigurationManager "None"
|
||||
SampleTimeColors off
|
||||
SampleTimeAnnotations off
|
||||
LibraryLinkDisplay "none"
|
||||
WideLines off
|
||||
ShowLineDimensions off
|
||||
ShowPortDataTypes off
|
||||
ShowLoopsOnError on
|
||||
IgnoreBidirectionalLines off
|
||||
ShowStorageClass off
|
||||
ShowTestPointIcons on
|
||||
ShowSignalResolutionIcons on
|
||||
ShowViewerIcons on
|
||||
SortedOrder off
|
||||
ExecutionContextIcon off
|
||||
ShowLinearizationAnnotations on
|
||||
BlockNameDataTip off
|
||||
BlockParametersDataTip off
|
||||
BlockDescriptionStringDataTip off
|
||||
ToolBar on
|
||||
StatusBar on
|
||||
BrowserShowLibraryLinks off
|
||||
BrowserLookUnderMasks off
|
||||
SimulationMode "normal"
|
||||
LinearizationMsg "none"
|
||||
Profile off
|
||||
ParamWorkspaceSource "MATLABWorkspace"
|
||||
AccelSystemTargetFile "accel.tlc"
|
||||
AccelTemplateMakefile "accel_default_tmf"
|
||||
AccelMakeCommand "make_rtw"
|
||||
TryForcingSFcnDF off
|
||||
RecordCoverage off
|
||||
CovPath "/"
|
||||
CovSaveName "covdata"
|
||||
CovMetricSettings "dw"
|
||||
CovNameIncrementing off
|
||||
CovHtmlReporting on
|
||||
CovForceBlockReductionOff on
|
||||
covSaveCumulativeToWorkspaceVar on
|
||||
CovSaveSingleToWorkspaceVar on
|
||||
CovCumulativeVarName "covCumulativeData"
|
||||
CovCumulativeReport off
|
||||
CovReportOnPause on
|
||||
CovModelRefEnable "Off"
|
||||
CovExternalEMLEnable off
|
||||
ExtModeBatchMode off
|
||||
ExtModeEnableFloating on
|
||||
ExtModeTrigType "manual"
|
||||
ExtModeTrigMode "normal"
|
||||
ExtModeTrigPort "1"
|
||||
ExtModeTrigElement "any"
|
||||
ExtModeTrigDuration 1000
|
||||
ExtModeTrigDurationFloating "auto"
|
||||
ExtModeTrigHoldOff 0
|
||||
ExtModeTrigDelay 0
|
||||
ExtModeTrigDirection "rising"
|
||||
ExtModeTrigLevel 0
|
||||
ExtModeArchiveMode "off"
|
||||
ExtModeAutoIncOneShot off
|
||||
ExtModeIncDirWhenArm off
|
||||
ExtModeAddSuffixToVar off
|
||||
ExtModeWriteAllDataToWs off
|
||||
ExtModeArmWhenConnect on
|
||||
ExtModeSkipDownloadWhenConnect off
|
||||
ExtModeLogAll on
|
||||
ExtModeAutoUpdateStatusClock on
|
||||
BufferReuse on
|
||||
ShowModelReferenceBlockVersion off
|
||||
ShowModelReferenceBlockIO off
|
||||
Array {
|
||||
Type "Handle"
|
||||
Dimension 1
|
||||
Simulink.ConfigSet {
|
||||
$ObjectID 1
|
||||
Version "1.10.0"
|
||||
Array {
|
||||
Type "Handle"
|
||||
Dimension 9
|
||||
Simulink.SolverCC {
|
||||
$ObjectID 2
|
||||
Version "1.10.0"
|
||||
StartTime "0.0"
|
||||
StopTime "96"
|
||||
AbsTol "auto"
|
||||
FixedStep "auto"
|
||||
InitialStep "auto"
|
||||
MaxNumMinSteps "-1"
|
||||
MaxOrder 5
|
||||
ZcThreshold "auto"
|
||||
ConsecutiveZCsStepRelTol "10*128*eps"
|
||||
MaxConsecutiveZCs "1000"
|
||||
ExtrapolationOrder 4
|
||||
NumberNewtonIterations 1
|
||||
MaxStep "auto"
|
||||
MinStep "auto"
|
||||
MaxConsecutiveMinStep "1"
|
||||
RelTol "1e-3"
|
||||
SolverMode "Auto"
|
||||
Solver "ode45"
|
||||
SolverName "ode45"
|
||||
SolverJacobianMethodControl "auto"
|
||||
ShapePreserveControl "DisableAll"
|
||||
ZeroCrossControl "UseLocalSettings"
|
||||
ZeroCrossAlgorithm "Nonadaptive"
|
||||
AlgebraicLoopSolver "TrustRegion"
|
||||
SolverResetMethod "Fast"
|
||||
PositivePriorityOrder off
|
||||
AutoInsertRateTranBlk off
|
||||
SampleTimeConstraint "Unconstrained"
|
||||
InsertRTBMode "Whenever possible"
|
||||
}
|
||||
Simulink.DataIOCC {
|
||||
$ObjectID 3
|
||||
Version "1.10.0"
|
||||
Decimation "1"
|
||||
ExternalInput "[t, u]"
|
||||
FinalStateName "xFinal"
|
||||
InitialState "xInitial"
|
||||
LimitDataPoints on
|
||||
MaxDataPoints "1000"
|
||||
LoadExternalInput off
|
||||
LoadInitialState off
|
||||
SaveFinalState off
|
||||
SaveCompleteFinalSimState off
|
||||
SaveFormat "Array"
|
||||
SaveOutput on
|
||||
SaveState off
|
||||
SignalLogging on
|
||||
DSMLogging on
|
||||
InspectSignalLogs off
|
||||
SaveTime on
|
||||
ReturnWorkspaceOutputs off
|
||||
StateSaveName "xout"
|
||||
TimeSaveName "tout"
|
||||
OutputSaveName "yout"
|
||||
SignalLoggingName "logsout"
|
||||
DSMLoggingName "dsmout"
|
||||
OutputOption "RefineOutputTimes"
|
||||
OutputTimes "[]"
|
||||
ReturnWorkspaceOutputsName "out"
|
||||
Refine "1"
|
||||
}
|
||||
Simulink.OptimizationCC {
|
||||
$ObjectID 4
|
||||
Version "1.10.0"
|
||||
Array {
|
||||
Type "Cell"
|
||||
Dimension 7
|
||||
Cell "BooleansAsBitfields"
|
||||
Cell "PassReuseOutputArgsAs"
|
||||
Cell "PassReuseOutputArgsThreshold"
|
||||
Cell "ZeroExternalMemoryAtStartup"
|
||||
Cell "ZeroInternalMemoryAtStartup"
|
||||
Cell "OptimizeModelRefInitCode"
|
||||
Cell "NoFixptDivByZeroProtection"
|
||||
PropName "DisabledProps"
|
||||
}
|
||||
BlockReduction on
|
||||
BooleanDataType on
|
||||
ConditionallyExecuteInputs on
|
||||
InlineParams off
|
||||
UseIntDivNetSlope off
|
||||
InlineInvariantSignals off
|
||||
OptimizeBlockIOStorage on
|
||||
BufferReuse on
|
||||
EnhancedBackFolding off
|
||||
StrengthReduction off
|
||||
EnforceIntegerDowncast on
|
||||
ExpressionFolding on
|
||||
BooleansAsBitfields off
|
||||
BitfieldContainerType "uint_T"
|
||||
EnableMemcpy on
|
||||
MemcpyThreshold 64
|
||||
PassReuseOutputArgsAs "Structure reference"
|
||||
ExpressionDepthLimit 2147483647
|
||||
FoldNonRolledExpr on
|
||||
LocalBlockOutputs on
|
||||
RollThreshold 5
|
||||
SystemCodeInlineAuto off
|
||||
StateBitsets off
|
||||
DataBitsets off
|
||||
UseTempVars off
|
||||
ZeroExternalMemoryAtStartup on
|
||||
ZeroInternalMemoryAtStartup on
|
||||
InitFltsAndDblsToZero off
|
||||
NoFixptDivByZeroProtection off
|
||||
EfficientFloat2IntCast off
|
||||
EfficientMapNaN2IntZero on
|
||||
OptimizeModelRefInitCode off
|
||||
LifeSpan "inf"
|
||||
MaxStackSize "Inherit from target"
|
||||
BufferReusableBoundary on
|
||||
SimCompilerOptimization "Off"
|
||||
AccelVerboseBuild off
|
||||
}
|
||||
Simulink.DebuggingCC {
|
||||
$ObjectID 5
|
||||
Version "1.10.0"
|
||||
RTPrefix "error"
|
||||
ConsistencyChecking "none"
|
||||
ArrayBoundsChecking "none"
|
||||
SignalInfNanChecking "none"
|
||||
SignalRangeChecking "none"
|
||||
ReadBeforeWriteMsg "UseLocalSettings"
|
||||
WriteAfterWriteMsg "UseLocalSettings"
|
||||
WriteAfterReadMsg "UseLocalSettings"
|
||||
AlgebraicLoopMsg "warning"
|
||||
ArtificialAlgebraicLoopMsg "warning"
|
||||
SaveWithDisabledLinksMsg "warning"
|
||||
SaveWithParameterizedLinksMsg "warning"
|
||||
CheckSSInitialOutputMsg on
|
||||
UnderspecifiedInitializationDetection "Classic"
|
||||
MergeDetectMultiDrivingBlocksExec "none"
|
||||
CheckExecutionContextPreStartOutputMsg off
|
||||
CheckExecutionContextRuntimeOutputMsg off
|
||||
SignalResolutionControl "UseLocalSettings"
|
||||
BlockPriorityViolationMsg "warning"
|
||||
MinStepSizeMsg "warning"
|
||||
TimeAdjustmentMsg "none"
|
||||
MaxConsecutiveZCsMsg "error"
|
||||
SolverPrmCheckMsg "warning"
|
||||
InheritedTsInSrcMsg "warning"
|
||||
DiscreteInheritContinuousMsg "warning"
|
||||
MultiTaskDSMMsg "error"
|
||||
MultiTaskCondExecSysMsg "error"
|
||||
MultiTaskRateTransMsg "error"
|
||||
SingleTaskRateTransMsg "none"
|
||||
TasksWithSamePriorityMsg "warning"
|
||||
SigSpecEnsureSampleTimeMsg "warning"
|
||||
CheckMatrixSingularityMsg "none"
|
||||
IntegerOverflowMsg "warning"
|
||||
Int32ToFloatConvMsg "warning"
|
||||
ParameterDowncastMsg "error"
|
||||
ParameterOverflowMsg "error"
|
||||
ParameterUnderflowMsg "none"
|
||||
ParameterPrecisionLossMsg "warning"
|
||||
ParameterTunabilityLossMsg "warning"
|
||||
FixptConstUnderflowMsg "none"
|
||||
FixptConstOverflowMsg "none"
|
||||
FixptConstPrecisionLossMsg "none"
|
||||
UnderSpecifiedDataTypeMsg "none"
|
||||
UnnecessaryDatatypeConvMsg "none"
|
||||
VectorMatrixConversionMsg "none"
|
||||
InvalidFcnCallConnMsg "error"
|
||||
FcnCallInpInsideContextMsg "Use local settings"
|
||||
SignalLabelMismatchMsg "none"
|
||||
UnconnectedInputMsg "warning"
|
||||
UnconnectedOutputMsg "warning"
|
||||
UnconnectedLineMsg "warning"
|
||||
SFcnCompatibilityMsg "none"
|
||||
UniqueDataStoreMsg "none"
|
||||
BusObjectLabelMismatch "warning"
|
||||
RootOutportRequireBusObject "warning"
|
||||
AssertControl "UseLocalSettings"
|
||||
EnableOverflowDetection off
|
||||
ModelReferenceIOMsg "none"
|
||||
ModelReferenceVersionMismatchMessage "none"
|
||||
ModelReferenceIOMismatchMessage "none"
|
||||
ModelReferenceCSMismatchMessage "none"
|
||||
UnknownTsInhSupMsg "warning"
|
||||
ModelReferenceDataLoggingMessage "warning"
|
||||
ModelReferenceSymbolNameMessage "warning"
|
||||
ModelReferenceExtraNoncontSigs "error"
|
||||
StateNameClashWarn "warning"
|
||||
SimStateInterfaceChecksumMismatchMsg "warning"
|
||||
StrictBusMsg "ErrorLevel1"
|
||||
BusNameAdapt "WarnAndRepair"
|
||||
NonBusSignalsTreatedAsBus "none"
|
||||
LoggingUnavailableSignals "error"
|
||||
BlockIODiagnostic "none"
|
||||
}
|
||||
Simulink.HardwareCC {
|
||||
$ObjectID 6
|
||||
Version "1.10.0"
|
||||
ProdBitPerChar 8
|
||||
ProdBitPerShort 16
|
||||
ProdBitPerInt 32
|
||||
ProdBitPerLong 32
|
||||
ProdIntDivRoundTo "Undefined"
|
||||
ProdEndianess "Unspecified"
|
||||
ProdWordSize 32
|
||||
ProdShiftRightIntArith on
|
||||
ProdHWDeviceType "32-bit Generic"
|
||||
TargetBitPerChar 8
|
||||
TargetBitPerShort 16
|
||||
TargetBitPerInt 32
|
||||
TargetBitPerLong 32
|
||||
TargetShiftRightIntArith on
|
||||
TargetIntDivRoundTo "Undefined"
|
||||
TargetEndianess "Unspecified"
|
||||
TargetWordSize 32
|
||||
TargetTypeEmulationWarnSuppressLevel 0
|
||||
TargetPreprocMaxBitsSint 32
|
||||
TargetPreprocMaxBitsUint 32
|
||||
TargetHWDeviceType "Specified"
|
||||
TargetUnknown off
|
||||
ProdEqTarget on
|
||||
}
|
||||
Simulink.ModelReferenceCC {
|
||||
$ObjectID 7
|
||||
Version "1.10.0"
|
||||
UpdateModelReferenceTargets "IfOutOfDateOrStructuralChange"
|
||||
CheckModelReferenceTargetMessage "error"
|
||||
EnableParallelModelReferenceBuilds off
|
||||
ParallelModelReferenceMATLABWorkerInit "None"
|
||||
ModelReferenceNumInstancesAllowed "Multi"
|
||||
PropagateVarSize "Infer from blocks in model"
|
||||
ModelReferencePassRootInputsByReference on
|
||||
ModelReferenceMinAlgLoopOccurrences off
|
||||
PropagateSignalLabelsOutOfModel off
|
||||
SupportModelReferenceSimTargetCustomCode off
|
||||
}
|
||||
Simulink.SFSimCC {
|
||||
$ObjectID 8
|
||||
Version "1.10.0"
|
||||
SFSimEnableDebug on
|
||||
SFSimOverflowDetection on
|
||||
SFSimEcho on
|
||||
SimBlas on
|
||||
SimCtrlC on
|
||||
SimExtrinsic on
|
||||
SimIntegrity on
|
||||
SimUseLocalCustomCode off
|
||||
SimBuildMode "sf_incremental_build"
|
||||
}
|
||||
Simulink.RTWCC {
|
||||
$BackupClass "Simulink.RTWCC"
|
||||
$ObjectID 9
|
||||
Version "1.10.0"
|
||||
Array {
|
||||
Type "Cell"
|
||||
Dimension 6
|
||||
Cell "IncludeHyperlinkInReport"
|
||||
Cell "GenerateTraceInfo"
|
||||
Cell "GenerateTraceReport"
|
||||
Cell "GenerateTraceReportSl"
|
||||
Cell "GenerateTraceReportSf"
|
||||
Cell "GenerateTraceReportEml"
|
||||
PropName "DisabledProps"
|
||||
}
|
||||
SystemTargetFile "grt.tlc"
|
||||
GenCodeOnly off
|
||||
MakeCommand "make_rtw"
|
||||
GenerateMakefile on
|
||||
TemplateMakefile "grt_default_tmf"
|
||||
GenerateReport off
|
||||
SaveLog off
|
||||
RTWVerbose on
|
||||
RetainRTWFile off
|
||||
ProfileTLC off
|
||||
TLCDebug off
|
||||
TLCCoverage off
|
||||
TLCAssert off
|
||||
ProcessScriptMode "Default"
|
||||
ConfigurationMode "Optimized"
|
||||
ConfigAtBuild off
|
||||
RTWUseLocalCustomCode off
|
||||
RTWUseSimCustomCode off
|
||||
IncludeHyperlinkInReport off
|
||||
LaunchReport off
|
||||
TargetLang "C"
|
||||
IncludeBusHierarchyInRTWFileBlockHierarchyMap off
|
||||
IncludeERTFirstTime off
|
||||
GenerateTraceInfo off
|
||||
GenerateTraceReport off
|
||||
GenerateTraceReportSl off
|
||||
GenerateTraceReportSf off
|
||||
GenerateTraceReportEml off
|
||||
GenerateCodeInfo off
|
||||
RTWCompilerOptimization "Off"
|
||||
CheckMdlBeforeBuild "Off"
|
||||
CustomRebuildMode "OnUpdate"
|
||||
Array {
|
||||
Type "Handle"
|
||||
Dimension 2
|
||||
Simulink.CodeAppCC {
|
||||
$ObjectID 10
|
||||
Version "1.10.0"
|
||||
Array {
|
||||
Type "Cell"
|
||||
Dimension 19
|
||||
Cell "IgnoreCustomStorageClasses"
|
||||
Cell "IgnoreTestpoints"
|
||||
Cell "InsertBlockDesc"
|
||||
Cell "SFDataObjDesc"
|
||||
Cell "SimulinkDataObjDesc"
|
||||
Cell "DefineNamingRule"
|
||||
Cell "SignalNamingRule"
|
||||
Cell "ParamNamingRule"
|
||||
Cell "InlinedPrmAccess"
|
||||
Cell "CustomSymbolStr"
|
||||
Cell "CustomSymbolStrGlobalVar"
|
||||
Cell "CustomSymbolStrType"
|
||||
Cell "CustomSymbolStrField"
|
||||
Cell "CustomSymbolStrFcn"
|
||||
Cell "CustomSymbolStrFcnArg"
|
||||
Cell "CustomSymbolStrBlkIO"
|
||||
Cell "CustomSymbolStrTmpVar"
|
||||
Cell "CustomSymbolStrMacro"
|
||||
Cell "ReqsInCode"
|
||||
PropName "DisabledProps"
|
||||
}
|
||||
ForceParamTrailComments off
|
||||
GenerateComments on
|
||||
IgnoreCustomStorageClasses on
|
||||
IgnoreTestpoints off
|
||||
IncHierarchyInIds off
|
||||
MaxIdLength 31
|
||||
PreserveName off
|
||||
PreserveNameWithParent off
|
||||
ShowEliminatedStatement off
|
||||
IncAutoGenComments off
|
||||
SimulinkDataObjDesc off
|
||||
SFDataObjDesc off
|
||||
IncDataTypeInIds off
|
||||
MangleLength 1
|
||||
CustomSymbolStrGlobalVar "$R$N$M"
|
||||
CustomSymbolStrType "$N$R$M"
|
||||
CustomSymbolStrField "$N$M"
|
||||
CustomSymbolStrFcn "$R$N$M$F"
|
||||
CustomSymbolStrFcnArg "rt$I$N$M"
|
||||
CustomSymbolStrBlkIO "rtb_$N$M"
|
||||
CustomSymbolStrTmpVar "$N$M"
|
||||
CustomSymbolStrMacro "$R$N$M"
|
||||
DefineNamingRule "None"
|
||||
ParamNamingRule "None"
|
||||
SignalNamingRule "None"
|
||||
InsertBlockDesc off
|
||||
SimulinkBlockComments on
|
||||
EnableCustomComments off
|
||||
InlinedPrmAccess "Literals"
|
||||
ReqsInCode off
|
||||
UseSimReservedNames off
|
||||
}
|
||||
Simulink.GRTTargetCC {
|
||||
$BackupClass "Simulink.TargetCC"
|
||||
$ObjectID 11
|
||||
Version "1.10.0"
|
||||
Array {
|
||||
Type "Cell"
|
||||
Dimension 17
|
||||
Cell "GeneratePreprocessorConditionals"
|
||||
Cell "IncludeMdlTerminateFcn"
|
||||
Cell "CombineOutputUpdateFcns"
|
||||
Cell "SuppressErrorStatus"
|
||||
Cell "ERTCustomFileBanners"
|
||||
Cell "GenerateSampleERTMain"
|
||||
Cell "GenerateTestInterfaces"
|
||||
Cell "ModelStepFunctionPrototypeControlCompliant"
|
||||
Cell "CPPClassGenCompliant"
|
||||
Cell "MultiInstanceERTCode"
|
||||
Cell "PurelyIntegerCode"
|
||||
Cell "SupportNonFinite"
|
||||
Cell "SupportComplex"
|
||||
Cell "SupportAbsoluteTime"
|
||||
Cell "SupportContinuousTime"
|
||||
Cell "SupportNonInlinedSFcns"
|
||||
Cell "PortableWordSizes"
|
||||
PropName "DisabledProps"
|
||||
}
|
||||
TargetFcnLib "ansi_tfl_table_tmw.mat"
|
||||
TargetLibSuffix ""
|
||||
TargetPreCompLibLocation ""
|
||||
TargetFunctionLibrary "ANSI_C"
|
||||
UtilityFuncGeneration "Auto"
|
||||
ERTMultiwordTypeDef "System defined"
|
||||
ERTCodeCoverageTool "None"
|
||||
ERTMultiwordLength 256
|
||||
MultiwordLength 2048
|
||||
GenerateFullHeader on
|
||||
GenerateSampleERTMain off
|
||||
GenerateTestInterfaces off
|
||||
IsPILTarget off
|
||||
ModelReferenceCompliant on
|
||||
ParMdlRefBuildCompliant on
|
||||
CompOptLevelCompliant on
|
||||
IncludeMdlTerminateFcn on
|
||||
GeneratePreprocessorConditionals "Disable all"
|
||||
CombineOutputUpdateFcns off
|
||||
SuppressErrorStatus off
|
||||
ERTFirstTimeCompliant off
|
||||
IncludeFileDelimiter "Auto"
|
||||
ERTCustomFileBanners off
|
||||
SupportAbsoluteTime on
|
||||
LogVarNameModifier "rt_"
|
||||
MatFileLogging on
|
||||
MultiInstanceERTCode off
|
||||
SupportNonFinite on
|
||||
SupportComplex on
|
||||
PurelyIntegerCode off
|
||||
SupportContinuousTime on
|
||||
SupportNonInlinedSFcns on
|
||||
SupportVariableSizeSignals off
|
||||
EnableShiftOperators on
|
||||
ParenthesesLevel "Nominal"
|
||||
PortableWordSizes off
|
||||
ModelStepFunctionPrototypeControlCompliant off
|
||||
CPPClassGenCompliant off
|
||||
AutosarCompliant off
|
||||
UseMalloc off
|
||||
ExtMode off
|
||||
ExtModeStaticAlloc off
|
||||
ExtModeTesting off
|
||||
ExtModeStaticAllocSize 1000000
|
||||
ExtModeTransport 0
|
||||
ExtModeMexFile "ext_comm"
|
||||
ExtModeIntrfLevel "Level1"
|
||||
RTWCAPISignals off
|
||||
RTWCAPIParams off
|
||||
RTWCAPIStates off
|
||||
GenerateASAP2 off
|
||||
}
|
||||
PropName "Components"
|
||||
}
|
||||
}
|
||||
hdlcoderui.hdlcc {
|
||||
$ObjectID 12
|
||||
Version "1.10.0"
|
||||
Description "HDL Coder custom configuration component"
|
||||
Name "HDL Coder"
|
||||
Array {
|
||||
Type "Cell"
|
||||
Dimension 1
|
||||
Cell ""
|
||||
PropName "HDLConfigFile"
|
||||
}
|
||||
HDLCActiveTab "0"
|
||||
}
|
||||
PropName "Components"
|
||||
}
|
||||
Name "Configuration"
|
||||
CurrentDlgPage "Solver"
|
||||
ConfigPrmDlgPosition " [ 520, 225, 1400, 855 ] "
|
||||
}
|
||||
PropName "ConfigurationSets"
|
||||
}
|
||||
Simulink.ConfigSet {
|
||||
$PropName "ActiveConfigurationSet"
|
||||
$ObjectID 1
|
||||
}
|
||||
BlockDefaults {
|
||||
ForegroundColor "black"
|
||||
BackgroundColor "white"
|
||||
DropShadow off
|
||||
NamePlacement "normal"
|
||||
FontName "Helvetica"
|
||||
FontSize 10
|
||||
FontWeight "normal"
|
||||
FontAngle "normal"
|
||||
ShowName on
|
||||
BlockRotation 0
|
||||
BlockMirror off
|
||||
}
|
||||
AnnotationDefaults {
|
||||
HorizontalAlignment "center"
|
||||
VerticalAlignment "middle"
|
||||
ForegroundColor "black"
|
||||
BackgroundColor "white"
|
||||
DropShadow off
|
||||
FontName "Helvetica"
|
||||
FontSize 10
|
||||
FontWeight "normal"
|
||||
FontAngle "normal"
|
||||
UseDisplayTextAsClickCallback off
|
||||
}
|
||||
LineDefaults {
|
||||
FontName "Helvetica"
|
||||
FontSize 9
|
||||
FontWeight "normal"
|
||||
FontAngle "normal"
|
||||
}
|
||||
BlockParameterDefaults {
|
||||
Block {
|
||||
BlockType Clock
|
||||
DisplayTime off
|
||||
}
|
||||
Block {
|
||||
BlockType Fcn
|
||||
Expr "sin(u[1])"
|
||||
SampleTime "-1"
|
||||
}
|
||||
Block {
|
||||
BlockType Scope
|
||||
ModelBased off
|
||||
TickLabels "OneTimeTick"
|
||||
ZoomMode "on"
|
||||
Grid "on"
|
||||
TimeRange "auto"
|
||||
YMin "-5"
|
||||
YMax "5"
|
||||
SaveToWorkspace off
|
||||
SaveName "ScopeData"
|
||||
LimitDataPoints on
|
||||
MaxDataPoints "5000"
|
||||
Decimation "1"
|
||||
SampleInput off
|
||||
SampleTime "-1"
|
||||
}
|
||||
}
|
||||
System {
|
||||
Name "Filtering"
|
||||
Location [610, 390, 1194, 889]
|
||||
Open on
|
||||
ModelBrowserVisibility off
|
||||
ModelBrowserWidth 200
|
||||
ScreenColor "white"
|
||||
PaperOrientation "landscape"
|
||||
PaperPositionMode "auto"
|
||||
PaperType "A4"
|
||||
PaperUnits "centimeters"
|
||||
TiledPaperMargins [1.270000, 1.270000, 1.270000, 1.270000]
|
||||
TiledPageScale 1
|
||||
ShowPageBoundaries off
|
||||
ZoomFactor "100"
|
||||
ReportName "simulink-default.rpt"
|
||||
SIDHighWatermark 11
|
||||
Block {
|
||||
BlockType Clock
|
||||
Name "Clock"
|
||||
SID 7
|
||||
Position [85, 245, 105, 265]
|
||||
DisplayTime on
|
||||
Decimation "10"
|
||||
}
|
||||
Block {
|
||||
BlockType Fcn
|
||||
Name "Fcn"
|
||||
SID 8
|
||||
Position [175, 125, 235, 155]
|
||||
Expr "0.01013*x(1)^4-2.24*x(1)^3152.2*x(1)^2+-2988*x(1)+2.74e4"
|
||||
}
|
||||
Block {
|
||||
BlockType Scope
|
||||
Name "Scope"
|
||||
SID 6
|
||||
Ports [2]
|
||||
Position [400, 131, 430, 164]
|
||||
Floating off
|
||||
Location [153, 268, 1586, 860]
|
||||
Open off
|
||||
NumInputPorts "2"
|
||||
List {
|
||||
ListType AxesTitles
|
||||
axes1 "%<SignalLabel>"
|
||||
axes2 "%<SignalLabel>"
|
||||
}
|
||||
YMin "-5~-5"
|
||||
YMax "5~5"
|
||||
DataFormat "StructureWithTime"
|
||||
SampleTime "0"
|
||||
}
|
||||
Line {
|
||||
SrcBlock "Fcn"
|
||||
SrcPort 1
|
||||
DstBlock "Scope"
|
||||
DstPort 1
|
||||
}
|
||||
Line {
|
||||
SrcBlock "Clock"
|
||||
SrcPort 1
|
||||
Points [0, -25; 35, 0; 0, -20]
|
||||
Branch {
|
||||
Points [0, -70]
|
||||
DstBlock "Fcn"
|
||||
DstPort 1
|
||||
}
|
||||
Branch {
|
||||
Points [200, 0; 0, -55]
|
||||
DstBlock "Scope"
|
||||
DstPort 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
function lic = actxlicense(progid)
|
||||
|
||||
if strcmpi(progid, 'air.airctrl.1')
|
||||
lic = 'Copyright (c) 1996 ';
|
||||
return;
|
||||
end
|
||||
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,14 @@
|
|||
function [ mVolt,PD0,QD0 ] = GetMeasure( sigma,rVolt,PD0,QD0 )
|
||||
%GETMEASURE Summary of this function goes here
|
||||
% Detailed explanation goes here
|
||||
mVolt=(1+normrnd(0,sigma,length(rVolt),1)).*rVolt;
|
||||
t1=find(mVolt>(1+3*sigma)*rVolt);
|
||||
t2=find(mVolt<(1-3*sigma)*rVolt);
|
||||
if any(t1) || any(t2)
|
||||
mVolt(t1)=(1+normrnd(0,sigma,length(rVolt),1)).*rVolt
|
||||
end
|
||||
PD0=(1+normrnd(0,sigma,length(PD0),1)).*rPD;
|
||||
QD0=(1+normrnd(0,sigma,length(QD0),1)).*rQD;
|
||||
|
||||
end
|
||||
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
function [ mVolt,PD0,QD0,mLoadCurrent ] = GetMeasure( sigma,rVolt,rPD,rQD,rLoadCurrent )
|
||||
%GETMEASURE Summary of this function goes here
|
||||
% Detailed explanation goes here
|
||||
mVolt=(1+normrnd(0,sigma,length(rVolt),1)).*rVolt;
|
||||
% t1=find(mVolt>(1+1*sigma)*rVolt);
|
||||
% t2=find(mVolt<(1-1*sigma)*rVolt);
|
||||
% while any(t1) || any(t2)
|
||||
% mVolt(t1)=(1+normrnd(0,sigma,length(t1),1)).*rVolt(t1);
|
||||
% mVolt(t2)=(1+normrnd(0,sigma,length(t2),1)).*rVolt(t2);
|
||||
% t1=find(mVolt>(1+1*sigma)*rVolt);
|
||||
% t2=find(mVolt<(1-1*sigma)*rVolt);
|
||||
% end
|
||||
|
||||
PD0=(1+normrnd(0,sigma,length(rPD),1)).*rPD;
|
||||
% t1=find(PD0>(1+1*sigma)*rPD);
|
||||
% t2=find(PD0<(1-1*sigma)*rPD);
|
||||
%
|
||||
% while any(t1)||any(t2)
|
||||
% PD0(t1)=(1+normrnd(0,sigma,length(t1),1)).*rPD(t1);
|
||||
% PD0(t2)=(1+normrnd(0,sigma,length(t2),1)).*rPD(t2);
|
||||
% t1=find(PD0>(1+1*sigma)*rPD);
|
||||
% t2=find(PD0<(1-1*sigma)*rPD);
|
||||
% end
|
||||
QD0=(1+normrnd(0,sigma,length(rQD),1)).*rQD;
|
||||
% t1=find(QD0>(1+1*sigma)*rQD);
|
||||
% t2=find(QD0<(1-1*sigma)*rQD);
|
||||
% while any(t1)||any(t2)
|
||||
% QD0(t1)=(1+normrnd(0,sigma,length(t1),1)).*rQD(t1);
|
||||
% QD0(t2)=(1+normrnd(0,sigma,length(t2),1)).*rQD(t2);
|
||||
% t1=find(QD0>(1+1*sigma)*rQD);
|
||||
% t2=find(QD0<(1-1*sigma)*rQD);
|
||||
% end
|
||||
|
||||
mLoadCurrent=(1+normrnd(0,sigma,length(rLoadCurrent),1)).*rLoadCurrent;
|
||||
t1=find(mLoadCurrent>(1+1*sigma)*rLoadCurrent);
|
||||
t2=find(mLoadCurrent<(1-1*sigma)*rLoadCurrent);
|
||||
while any(t1)||any(t2)
|
||||
mLoadCurrent(t1)=(1+normrnd(0,sigma,length(t1),1)).*rLoadCurrent(t1);
|
||||
mLoadCurrent(t2)=(1+normrnd(0,sigma,length(t2),1)).*rLoadCurrent(t2);
|
||||
t1=find(mLoadCurrent>(1+1*sigma)*rLoadCurrent);
|
||||
t2=find(mLoadCurrent<(1-1*sigma)*rLoadCurrent);
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
function [ output_args ] = LineCurrent( Linei,Linej,Liner,Linex,Volt,VAngle )
|
||||
cmpV=Volt.*exp(1j*VAngle);
|
||||
GB=1./(Liner+1j*Linex);
|
||||
cmpI=
|
||||
end
|
||||
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
function [ output_args ] = LineCurrent( Linei,Linej,Liner,Linex,Volt,VAngle )
|
||||
cmpV=Volt.*exp(1j*VAngle);
|
||||
GB=1./(Liner+1j*Linex);
|
||||
cmpI=( cmpV(Linei)-cmpV(Linej) ).*GB;
|
||||
output_args=abs(cmpI);
|
||||
end
|
||||
|
||||
|
|
@ -1,8 +1,9 @@
|
|||
function [ output_args ] = LoadCurrent( Volt,VAngel,PD,QD,PDi,QDi )
|
||||
%% ¼ÆË㸺ºÉµçÁ÷
|
||||
cmpVolt=Volt.*exp(1j*VAngel);
|
||||
t1=real(conj((PD+1j*QD)./cmpVolt(PDi)));
|
||||
% cmpVolt=Volt.*exp(1j*VAngel);
|
||||
% t1=real(conj((PD+1j*QD)./cmpVolt(PDi)));
|
||||
% t1=real(conj((PD+1j*QD)).*Volt(PDi));
|
||||
t1=(PD.^2+QD.^2)./Volt(PDi).^2;
|
||||
output_args=t1;
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
txt=dlmread('E:\书籍\论文\配电网状态估计\负荷.txt');
|
||||
txt=txt./10000;
|
||||
x=1:length(txt);
|
||||
plot(x,txt,'k');
|
||||
hold on
|
||||
plot(x,txt*0.8,'k--');
|
||||
plot(x,txt*1.2,'k--');
|
||||
legend('典型负荷曲线','考虑波动后的负荷范围')
|
||||
|
||||
ylabel('负荷值/kW')
|
||||
xlabel('时间/时')
|
||||
k=1;
|
||||
for i=0:length(x)-1
|
||||
x1(k)=x(length(x)-i);
|
||||
Z2(k)=txt(length(x)-i)*1.2;
|
||||
k=k+1;
|
||||
end
|
||||
fill([x x1],[txt'*0.8 Z2],[240, 240, 240]./255,'edgealpha',0)
|
||||
|
|
@ -1,10 +1,11 @@
|
|||
function [output_arg]=MaxDeviation(rVolt,SEVolt,rVAngel,SEVAngel,rPD,rQD,PD,QD)
|
||||
% t1=[rVolt;rVAngel;rPD;rQD];
|
||||
% t2=[SEVolt;SEVAngel;PD;QD];
|
||||
t1=[rPD;rQD];
|
||||
t2=[PD;QD];
|
||||
function [output_arg]=MaxDeviation(sigma,rVolt,SEVolt,rVAngel,SEVAngel,rPD,rQD,PD,QD)
|
||||
t1=[rVolt;rVAngel;rPD;rQD];
|
||||
t2=[SEVolt;SEVAngel;PD;QD];
|
||||
% t1=[rVolt;rPD;rQD];
|
||||
% t2=[SEVolt;PD;QD];
|
||||
t3=(t1(t1~=0)-double(t2(t1~=0)))./t1(t1~=0);
|
||||
t4=abs(t3);
|
||||
output_arg=max(t4);
|
||||
find(t4==output_arg);
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
function [ output_args ] = MaxSigma( x,PDi,QDi,mPD,mQD,Volt0,sigma,rPD,rQD,rVolt )
|
||||
PD=x(1:length(PDi));
|
||||
QD=x(length(PDi)+1:length(PDi)+length(QDi));
|
||||
SEVolt=x(length(PDi)+length(QDi)+1:length(PDi)+length(QDi)+length(Volt0));
|
||||
t0=[]
|
||||
r=[mPD(PDi)-PD;mQD(QDi)-QD;Volt0'-SEVolt];
|
||||
realVal=[rPD();rQD;rVolt];
|
||||
t1=r>3*sigma*realVal;
|
||||
t2=r<-3*sigma*realVal;
|
||||
if any(t1)
|
||||
find(t1)
|
||||
end
|
||||
if any(t2)
|
||||
find(t2)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
function [ output_args,t1,t2 ] = MaxSigma( x,PDi,QDi,mPD,mQD,mVolt,mLoadCurrent,sigma,rPD,rQD,rVolt,rLoadCurrent )
|
||||
PD=x(1:length(PDi));
|
||||
QD=x(length(PDi)+1:length(PDi)+length(QDi));
|
||||
SEVolt=x(length(PDi)+length(QDi)+1:length(PDi)+length(QDi)+length(mVolt));
|
||||
SEVAngel=x(length(PDi)+length(QDi)+length(mVolt)+1:end);
|
||||
SECurrent=LoadCurrent( SEVolt,SEVAngel,PD,QD,PDi,QDi );
|
||||
r=[mPD(PDi)-PD;mQD(QDi)-QD;mVolt-SEVolt;mLoadCurrent-SECurrent];
|
||||
% realVal=[rPD(PDi);rQD(QDi);rVolt];
|
||||
realVal=sparse([PD;QD;SEVolt;rLoadCurrent]);
|
||||
t1=r>3*sigma*realVal;
|
||||
t2=r<-3*sigma*realVal;
|
||||
% r./realVal
|
||||
if any(t1)
|
||||
find(t1)
|
||||
output_args=1;
|
||||
return;
|
||||
end
|
||||
if any(t2)
|
||||
find(t2)
|
||||
output_args=1;
|
||||
return;
|
||||
end
|
||||
output_args=0;
|
||||
end
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
function [ output_args ] = NormalizedResiduals(x,sigma,PDi,QDi,Volt0)
|
||||
PD=x(1:length(PDi));
|
||||
QD=x(length(PDi)+1:length(PDi)+length(QDi));
|
||||
SEVolt=x(length(PDi)+length(QDi)+1:length(PDi)+length(QDi)+length(Volt0));
|
||||
|
||||
H=eye(length(PD)+length(QD)+length(SEVolt));
|
||||
R=sigma*eye*()
|
||||
end
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
function [ output_args ] = NormalizedResiduals(x,sigma,PDi,QDi,Volt0,mPD,mQD)
|
||||
PD=x(1:length(PDi));
|
||||
QD=x(length(PDi)+1:length(PDi)+length(QDi));
|
||||
SEVolt=x(length(PDi)+length(QDi)+1:length(PDi)+length(QDi)+length(Volt0));
|
||||
mNum=length(PD)+length(QD)+length(SEVolt); %Á¿²âÁ¿ÊýÁ¿
|
||||
% H=[eye(mNum),zeros(mNum,length(Volt0));];
|
||||
H=[eye(mNum)];
|
||||
R=sigma*eye(mNum);
|
||||
G=H'*inv(R)*H;
|
||||
K=H*inv(G)*H'*inv(R);
|
||||
S=eye(mNum)-K;
|
||||
omega=S*R;
|
||||
r=[mPD(PDi)-PD;mQD(QDi)-QD;Volt0'-SEVolt];
|
||||
normR=abs(r)./diag(omega);
|
||||
maxR=max(normR);
|
||||
end
|
||||
|
||||
99
OPF_Init.asv
99
OPF_Init.asv
|
|
@ -1,7 +1,9 @@
|
|||
function [Volt,UAngel,Init_Z,Init_W,Init_L,Init_U,Init_Y,PG,QG,RestraintCount,wPG,wQG,wPD,wQD,wVolt,wLoadCurrent,PD,PD0,QD,randPDind,Loadi,notLoadi]=OPF_Init(Busnum,Balance,PG,QG,Volt,GenU,GenL,PVi,PGi,PVQU,PVQL,PD0,QD0,QD,PD)
|
||||
Loadi=find(QD~=0 | PD~=0);
|
||||
PDi=find(PD~=0);
|
||||
QDi=find(QD~=0);
|
||||
function [Volt,UAngel,Init_Z,Init_W,Init_L,Init_U,Init_Y,PG,QG,RestraintCount,wPG,wQG,wPD,wQD,wVolt,wLoadCurrent,PD,PD0,QD,randPDind,Loadi,noLoadi]=OPF_Init(Busnum,Balance,PG,QG,rVolt,GenU,GenL,PVi,PGi,PVQU,PVQL,PD0,QD0,rQD,rPD,rLoadCurrent)
|
||||
Loadi=find(rQD~=0 | rPD~=0);
|
||||
PDi=find(rPD~=0);
|
||||
%PDi=[10,11,23,19,22,20,12,13,14,15,8,18,25,17,24,16];
|
||||
%QDi=find(rQD~=0);
|
||||
QDi=PDi;
|
||||
notLoadi=setdiff(1:Busnum,Loadi);
|
||||
PGOnly=setdiff(PGi,PDi);
|
||||
QGOnly=setdiff(PVi,QDi);
|
||||
|
|
@ -13,7 +15,7 @@ noPGPDQGQD=setdiff(1:Busnum,union(union(PDi,PGi),union(QDi,PVi)));
|
|||
%Loadi=[1:Busnum]';
|
||||
RestraintCount=size(PVi,1)+size(PGi,1)+size(Loadi,1)*1+Busnum*1; %约束条件数,放开所有QD,不单独约束QD上下限
|
||||
RestraintCount=RestraintCount+length(Loadi); %加上功率因数,用功率因数约束QD
|
||||
t_Bal_volt=Volt(Balance);
|
||||
t_Bal_volt=rVolt(Balance);
|
||||
Volt=sparse(1*ones(1,Busnum));
|
||||
Volt(Balance)=t_Bal_volt;
|
||||
UAngel=sparse(1,Busnum);
|
||||
|
|
@ -33,20 +35,87 @@ wQG=1*ones(size(PVi,1),1);
|
|||
%randInt=randperm(size(Loadi,1));
|
||||
%randPDind=randInt(1:10);
|
||||
randPDind=0;
|
||||
wPD=1/0.05*zeros(length(PD),1);
|
||||
wPD(1:2:end)=0;
|
||||
wQD=1/0.05*zeros(length(QD),1);
|
||||
wQD(1:2:end)=0;
|
||||
wVolt=1/0.05*zeros(Busnum,1);
|
||||
wVolt(1:2:end)=0;
|
||||
wLoadCurrent=1/0.05*zeros(length(PDi),1);
|
||||
% load('I');
|
||||
sigma=0.03;
|
||||
% sigma=sigma*I/200;
|
||||
% wPD=1/(1)*ones(length(PD),1);
|
||||
% wPD(11)=wPD(11)*1;
|
||||
% wQD=1/(1)*ones(length(QD),1);
|
||||
% wQD(11)=wQD(11)*1;
|
||||
% wVolt=1/(1)*ones(Busnum,1);
|
||||
% wVolt(Balance)=0;% ²»¿¼ÂÇÆ½ºâ½Úµã
|
||||
wLoadCurrent=1./(abs(rLoadCurrent)*sigma);
|
||||
wPD=1./(abs(rPD)*sigma);
|
||||
wQD=1./(abs(rQD)*sigma);
|
||||
wVolt=1./(abs(rVolt)*sigma);
|
||||
wPD(notLoadi)=0;
|
||||
wQD(notLoadi)=0;
|
||||
wVolt(notLoadi)=0;
|
||||
%% 100%
|
||||
% noLoad=[];
|
||||
% wPD(noLoad)=0;
|
||||
% wQD(noLoad)=0;
|
||||
% wVolt(noLoad)=0;
|
||||
%% 90%
|
||||
% noLoad=[17];
|
||||
% wPD(noLoad)=0;
|
||||
% wQD(noLoad)=0;
|
||||
% wVolt(noLoad)=0;
|
||||
%% 80%
|
||||
% noLoad=[16 18];
|
||||
% wPD(noLoad)=0;
|
||||
% wQD(noLoad)=0;
|
||||
% wVolt(noLoad)=0;
|
||||
%% 70%
|
||||
% noLoad=[15 19];
|
||||
% wPD(noLoad)=0;
|
||||
% wQD(noLoad)=0;
|
||||
% wVolt(noLoad)=0;
|
||||
%% 60%
|
||||
% noLoad=[15 17 19];
|
||||
% wPD(noLoad)=0;
|
||||
% wQD(noLoad)=0;
|
||||
% wVolt(noLoad)=0;
|
||||
% wLoadCurrent(noLoad)=0;
|
||||
%% 50%
|
||||
% noLoad=[10 11 14 15 25 17 22 20];
|
||||
% noLoad=[2 5 6 9];
|
||||
%noLoad=[3,5,6,9,11,12,15,17,20,21,22,23,27,29,30,31];%33½Úµã
|
||||
% wPD(noLoad)=0;
|
||||
% wQD(noLoad)=0;
|
||||
% wVolt(noLoad)=0;
|
||||
% wLoadCurrent(1:2:end)=0;
|
||||
%% 40%
|
||||
% noLoad=[11 13 16 18 20];
|
||||
% wPD(noLoad)=0;
|
||||
% wQD(noLoad)=0;
|
||||
% wVolt(noLoad)=0;
|
||||
%% 30%
|
||||
% noLoad=[11 13 16 17 18 20];
|
||||
% wPD(noLoad)=0;
|
||||
% wQD(noLoad)=0;
|
||||
% wVolt(noLoad)=0;
|
||||
%% 20%
|
||||
% noLoad=[11 13 15 17 19 20];
|
||||
% wPD(noLoad)=0;
|
||||
% wQD(noLoad)=0;
|
||||
% wVolt(noLoad)=0;
|
||||
%% 10%
|
||||
% noLoad=[11 13 15 17 18 19 20];
|
||||
% wPD(noLoad)=0;
|
||||
% wQD(noLoad)=0;
|
||||
% wVolt(noLoad)=0;
|
||||
%% 0%
|
||||
% noLoad=[];
|
||||
% wPD(1:end)=0;
|
||||
% wQD(1:end)=0;
|
||||
% wVolt(1:end)=0;
|
||||
%wD(randPDind)=0;%一些负荷不约束
|
||||
%wD(7)=0;
|
||||
% wD(11)=0;
|
||||
PD=1*PD0;
|
||||
PD=0.1*PD0;
|
||||
%powerFacter=0.98;
|
||||
%QD=PD*sqrt((1-powerFacter^2)/powerFacter^2);
|
||||
QD=QD0;
|
||||
|
||||
QD=0.1*QD0;
|
||||
noLoadi=noLoad;
|
||||
end
|
||||
100
OPF_Init.m
100
OPF_Init.m
|
|
@ -1,7 +1,9 @@
|
|||
function [Volt,UAngel,Init_Z,Init_W,Init_L,Init_U,Init_Y,PG,QG,RestraintCount,wPG,wQG,wPD,wQD,wVolt,wLoadCurrent,PD,PD0,QD,randPDind,Loadi,notLoadi]=OPF_Init(Busnum,Balance,PG,QG,Volt,GenU,GenL,PVi,PGi,PVQU,PVQL,PD0,QD0,QD,PD)
|
||||
Loadi=find(QD~=0 | PD~=0);
|
||||
PDi=find(PD~=0);
|
||||
QDi=find(QD~=0);
|
||||
function [Volt,UAngel,Init_Z,Init_W,Init_L,Init_U,Init_Y,PG,QG,RestraintCount,wPG,wQG,wPD,wQD,wVolt,wLoadCurrent,PD,PD0,QD,randPDind,Loadi,noLoadi]=OPF_Init(Busnum,Balance,PG,QG,rVolt,GenU,GenL,PVi,PGi,PVQU,PVQL,PD0,QD0,rQD,rPD,rLoadCurrent)
|
||||
Loadi=find(rQD~=0 | rPD~=0);
|
||||
PDi=find(rPD~=0);
|
||||
%PDi=[10,11,23,19,22,20,12,13,14,15,8,18,25,17,24,16];
|
||||
%QDi=find(rQD~=0);
|
||||
QDi=PDi;
|
||||
notLoadi=setdiff(1:Busnum,Loadi);
|
||||
PGOnly=setdiff(PGi,PDi);
|
||||
QGOnly=setdiff(PVi,QDi);
|
||||
|
|
@ -13,7 +15,7 @@ noPGPDQGQD=setdiff(1:Busnum,union(union(PDi,PGi),union(QDi,PVi)));
|
|||
%Loadi=[1:Busnum]';
|
||||
RestraintCount=size(PVi,1)+size(PGi,1)+size(Loadi,1)*1+Busnum*1; %约束条件数,放开所有QD,不单独约束QD上下限
|
||||
RestraintCount=RestraintCount+length(Loadi); %加上功率因数,用功率因数约束QD
|
||||
t_Bal_volt=Volt(Balance);
|
||||
t_Bal_volt=rVolt(Balance);
|
||||
Volt=sparse(1*ones(1,Busnum));
|
||||
Volt(Balance)=t_Bal_volt;
|
||||
UAngel=sparse(1,Busnum);
|
||||
|
|
@ -33,31 +35,87 @@ wQG=1*ones(size(PVi,1),1);
|
|||
%randInt=randperm(size(Loadi,1));
|
||||
%randPDind=randInt(1:10);
|
||||
randPDind=0;
|
||||
wPD=1/0.05*ones(length(PD),1);
|
||||
wQD=1/0.05*ones(length(QD),1);
|
||||
wVolt=1/0.05*ones(Busnum,1);
|
||||
wLoadCurrent=1/0.05*ones(length(PDi),1);
|
||||
%% 70%
|
||||
% noLoad=[1;4;5;7;8;10;11;13;14;16;17;19;20;21];
|
||||
% load('I');
|
||||
sigma=0.03;
|
||||
% sigma=sigma*I/200;
|
||||
% wPD=1/(1)*ones(length(PD),1);
|
||||
% wPD(11)=wPD(11)*1;
|
||||
% wQD=1/(1)*ones(length(QD),1);
|
||||
% wQD(11)=wQD(11)*1;
|
||||
% wVolt=1/(1)*ones(Busnum,1);
|
||||
% wVolt(Balance)=0;% ²»¿¼ÂÇÆ½ºâ½Úµã
|
||||
wLoadCurrent=1./(abs(rLoadCurrent)*sigma);
|
||||
wPD=1./(abs(rPD)*sigma);
|
||||
wQD=1./(abs(rQD)*sigma);
|
||||
wVolt=1./(abs(rVolt)*sigma);
|
||||
wPD(notLoadi)=0;
|
||||
wQD(notLoadi)=0;
|
||||
wVolt(notLoadi)=0;
|
||||
%% 100%
|
||||
% noLoad=[];
|
||||
% wPD(noLoad)=0;
|
||||
% wQD(noLoad)=0;
|
||||
% wVolt(noLoad)=0;
|
||||
%% 90%
|
||||
% noLoad=[17];
|
||||
% wPD(noLoad)=0;
|
||||
% wQD(noLoad)=0;
|
||||
% wVolt(noLoad)=0;
|
||||
%% 80%
|
||||
% noLoad=[16 18];
|
||||
% wPD(noLoad)=0;
|
||||
% wQD(noLoad)=0;
|
||||
% wVolt(noLoad)=0;
|
||||
%% 70%
|
||||
% noLoad=[15 19];
|
||||
% wPD(noLoad)=0;
|
||||
% wQD(noLoad)=0;
|
||||
% wVolt(noLoad)=0;
|
||||
%% 60%
|
||||
% noLoad=[15 17 19];
|
||||
% wPD(noLoad)=0;
|
||||
% wQD(noLoad)=0;
|
||||
% wVolt(noLoad)=0;
|
||||
% wLoadCurrent(noLoad)=0;
|
||||
%% 50%
|
||||
% wPD(1:2:end)=0;
|
||||
% wQD(1:2:end)=0;
|
||||
% wVolt(1:2:end)=0;
|
||||
% noLoad=[10 11 14 15 25 17 22 20];
|
||||
% noLoad=[2 5 6 9];
|
||||
% noLoad=[3,5,6,9,11,12,15,17,20,21,22,23,27,29,30,31];%33½Úµã
|
||||
% wPD(noLoad)=0;
|
||||
% wQD(noLoad)=0;
|
||||
% wVolt(noLoad)=0;
|
||||
% wLoadCurrent(1:2:end)=0;
|
||||
%% 40%
|
||||
% noLoad=[11 13 16 18 20];
|
||||
% wPD(noLoad)=0;
|
||||
% wQD(noLoad)=0;
|
||||
% wVolt(noLoad)=0;
|
||||
%% 30%
|
||||
noLoad=[1;5;7;11;15;20];
|
||||
wPD(noLoad)=0;
|
||||
wQD(noLoad)=0;
|
||||
wVolt(noLoad)=0;
|
||||
% noLoad=[11 13 16 17 18 20];
|
||||
% wPD(noLoad)=0;
|
||||
% wQD(noLoad)=0;
|
||||
% wVolt(noLoad)=0;
|
||||
%% 20%
|
||||
% noLoad=[11 13 15 17 19 20];
|
||||
% wPD(noLoad)=0;
|
||||
% wQD(noLoad)=0;
|
||||
% wVolt(noLoad)=0;
|
||||
%% 10%
|
||||
% noLoad=[11 13 15 17 18 19 20];
|
||||
% wPD(noLoad)=0;
|
||||
% wQD(noLoad)=0;
|
||||
% wVolt(noLoad)=0;
|
||||
%% 0%
|
||||
noLoad=[];
|
||||
wPD(1:end)=0;
|
||||
wQD(1:end)=0;
|
||||
wVolt(1:end)=0;
|
||||
%wD(randPDind)=0;%一些负荷不约束
|
||||
%wD(7)=0;
|
||||
% wD(11)=0;
|
||||
PD=1*PD0;
|
||||
PD=0.1*PD0;
|
||||
%powerFacter=0.98;
|
||||
%QD=PD*sqrt((1-powerFacter^2)/powerFacter^2);
|
||||
QD=QD0;
|
||||
|
||||
QD=0.1*QD0;
|
||||
noLoadi=noLoad;
|
||||
end
|
||||
|
|
@ -0,0 +1 @@
|
|||
2013.10.15 准备加入支路功率量测量试试,原来只有电压和负荷的效果太不好了,主要是负荷的估计效果不好。
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
function [ output_args ] = RealValuePlot(mPD,mQD,rPD,rQD,mVolt,rVolt,mVAngel,rVAngel)
|
||||
x=1:length(mPD);
|
||||
subplot(2,1,1);
|
||||
plot(x,mPD);
|
||||
hold on;
|
||||
load('0PD');
|
||||
t=PD;
|
||||
plot(x,PD,'kh');
|
||||
load('50PD');
|
||||
t=[PD];
|
||||
% plot(x,PD,'k+');
|
||||
load('100PD');
|
||||
t=[t,PD];
|
||||
% plot(x,PD,'kp');
|
||||
t=[t,rPD];
|
||||
bar(t);
|
||||
legend('50%','100%','Actual');
|
||||
% plot(x,rPD,'k.');
|
||||
xlabel('负荷节点号');
|
||||
ylabel('负荷值/p.u');
|
||||
%% QD
|
||||
subplot(2,1,2);
|
||||
% plot(x,mQD);
|
||||
hold on;
|
||||
% load('0QD');
|
||||
% t=QD;
|
||||
% plot(x,QD,'k-.');
|
||||
load('50QD');
|
||||
t=[QD];
|
||||
% plot(x,QD,'k--');
|
||||
load('100QD');
|
||||
t=[t,QD];
|
||||
% plot(x,QD,'k-');
|
||||
t=[t,rQD];
|
||||
bar(t);
|
||||
legend('50%','100%','Actual');
|
||||
% plot(x,rQD,'k:');
|
||||
xlabel('负荷节点号');
|
||||
ylabel('负荷值/p.u');
|
||||
%% Volt
|
||||
x=1:length(mVolt);
|
||||
figure
|
||||
subplot(2,1,1);
|
||||
% plot(x,mVolt);
|
||||
hold on;
|
||||
% load('0SEVolt');
|
||||
% t=SEVolt;
|
||||
% plot(x,SEVolt,'k-.');
|
||||
load('50SEVolt');
|
||||
t=[SEVolt];
|
||||
% plot(x,SEVolt,'k--');
|
||||
load('100SEVolt');
|
||||
t=[t,SEVolt];
|
||||
% plot(x,SEVolt,'k-');
|
||||
% plot(x,rVolt,'k:');
|
||||
t=[t,rVolt];
|
||||
bar(t);
|
||||
legend('50%','100%','Actual');
|
||||
axis([0,22,0.95,1.01]);
|
||||
xlabel('节点号');
|
||||
ylabel('电压/p.u');
|
||||
%% VAngle
|
||||
subplot(2,1,2);
|
||||
% plot(x,mVAngel);
|
||||
hold on;
|
||||
% load('0SEVAngel');
|
||||
% t=SEVAngel;
|
||||
% plot(x,SEVAngel,'k-.');
|
||||
load('50SEVAngel');
|
||||
t=[SEVAngel];
|
||||
% plot(x,SEVAngel,'k--');
|
||||
load('100SEVAngel');
|
||||
t=[t,SEVAngel];
|
||||
% plot(x,SEVAngel,'k-');
|
||||
% plot(x,rVAngel,'k:');
|
||||
t=[t,rVAngel];
|
||||
bar(t);
|
||||
legend('50%','100%','Actual');
|
||||
axis([1,22,-0.08,0]);
|
||||
xlabel('节点号');
|
||||
ylabel('相角/p.u');
|
||||
end
|
||||
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
function [ output_args ] = RealValuePlot(mPD,mQD,rPD,rQD,mVolt,rVolt,rVAngel)
|
||||
x=1:length(mPD);
|
||||
subplot(2,1,1);
|
||||
% plot(x,mPD);
|
||||
load('D:\Matlab\StateEstimateionYALMIP-LU9\graph\9\20140327\20%\100PD.mat');
|
||||
t=PD;
|
||||
% plot(x,PD,'kh');
|
||||
load('D:\Matlab\StateEstimateionYALMIP-LU9\graph\9\20140327\20%\50PD.mat');
|
||||
t=[t,PD];
|
||||
% plot(x,PD,'k+');
|
||||
load('D:\Matlab\StateEstimateionYALMIP-LU9\graph\9\20140327\20%\0PD.mat');
|
||||
t=[t,PD];
|
||||
% plot(x,PD,'kp');
|
||||
% bars=bar(t);
|
||||
% set(bars(1),'FaceColor',[1 1 1]);
|
||||
% set(bars(2),'FaceColor',[1 1 1]);
|
||||
% set(bars(3),'FaceColor',[1 1 1]);
|
||||
% set(bars(4),'FaceColor',[1 1 1])
|
||||
% set(bars(5),'FaceColor',[1 1 1]);
|
||||
hold on;
|
||||
load('D:\Matlab\StateEstimateionYALMIP-LU9\graph\9\20140327\容量\100PD.mat');
|
||||
tt=[t,PD];
|
||||
% plot(x,PD,'kh');
|
||||
load('D:\Matlab\StateEstimateionYALMIP-LU9\graph\9\20140327\容量\50PD.mat');
|
||||
tt=[tt,PD];
|
||||
% plot(x,PD,'k+');
|
||||
load('D:\Matlab\StateEstimateionYALMIP-LU9\graph\9\20140327\容量\0PD.mat');
|
||||
tt=[tt,PD];
|
||||
% plot(x,PD,'kp');
|
||||
tt=[tt,rPD];
|
||||
tt=[tt,mPD];
|
||||
bars=bar([t,tt]);
|
||||
set(bars(1),'FaceColor',[1 1 1]);
|
||||
set(bars(2),'FaceColor',[1 1 1]);
|
||||
set(bars(3),'FaceColor',[1 1 1]);
|
||||
set(bars(4),'FaceColor',[1 1 1])
|
||||
set(bars(5),'FaceColor',[1 1 1]);
|
||||
legend('0%','50%','100%','实际值','量测值','0%','50%','100%','实际值','量测值');
|
||||
% plot(x,rPD,'k.');
|
||||
xlabel('负荷节点号');
|
||||
ylabel('负荷值/p.u');
|
||||
%% QD
|
||||
subplot(2,1,2);
|
||||
% plot(x,mQD);
|
||||
hold on;
|
||||
load('D:\Matlab\StateEstimateionYALMIP-LU9\graph\9\20140327\20%\100QD.mat');
|
||||
t=QD;
|
||||
% plot(x,QD,'k-.');
|
||||
load('D:\Matlab\StateEstimateionYALMIP-LU9\graph\9\20140327\20%\50QD.mat');
|
||||
t=[t,QD];
|
||||
% plot(x,QD,'k--');
|
||||
load('D:\Matlab\StateEstimateionYALMIP-LU9\graph\9\20140327\20%\0QD.mat');
|
||||
t=[t,QD];
|
||||
load('D:\Matlab\StateEstimateionYALMIP-LU9\graph\9\20140327\容量\100QD.mat');
|
||||
t=[t,QD];
|
||||
load('D:\Matlab\StateEstimateionYALMIP-LU9\graph\9\20140327\容量\50QD.mat');
|
||||
t=[t,QD];
|
||||
load('D:\Matlab\StateEstimateionYALMIP-LU9\graph\9\20140327\容量\0QD.mat');
|
||||
t=[t,QD];
|
||||
t=[t,rQD];
|
||||
tt=[t,mQD];
|
||||
% plot(x,QD,'k-');
|
||||
% bar(t);
|
||||
legend('0%','50%','100%','实际值','量测值');
|
||||
% plot(x,rQD,'k:');
|
||||
xlabel('负荷节点号');
|
||||
ylabel('负荷值/p.u');
|
||||
%% Volt
|
||||
x=1:length(mVolt);
|
||||
figure
|
||||
subplot(2,1,1);
|
||||
% plot(x,mVolt);
|
||||
hold on;
|
||||
load('D:\Matlab\StateEstimateionYALMIP-LU9\graph\9\20140327\20%\100SEVolt.mat');
|
||||
t=SEVolt;
|
||||
% plot(x,SEVolt,'k-.');
|
||||
load('D:\Matlab\StateEstimateionYALMIP-LU9\graph\9\20140327\20%\50SEVolt.mat');
|
||||
t=[t,SEVolt];
|
||||
% plot(x,SEVolt,'k--');
|
||||
load('D:\Matlab\StateEstimateionYALMIP-LU9\graph\9\20140327\20%\100SEVolt.mat');
|
||||
t=[t,SEVolt];
|
||||
load('D:\Matlab\StateEstimateionYALMIP-LU9\graph\9\20140327\容量\100SEVolt.mat');
|
||||
t=[t,SEVolt];
|
||||
load('D:\Matlab\StateEstimateionYALMIP-LU9\graph\9\20140327\容量\50SEVolt.mat');
|
||||
t=[t,SEVolt];
|
||||
load('D:\Matlab\StateEstimateionYALMIP-LU9\graph\9\20140327\容量\0SEVolt.mat');
|
||||
t=[t,SEVolt];
|
||||
% plot(x,SEVolt,'k-');
|
||||
% plot(x,rVolt,'k:');
|
||||
t=[t,rVolt];
|
||||
tt=[t,mVolt];
|
||||
% bar(t);
|
||||
legend('0%','50%','100%','实际值','量测值');
|
||||
%axis([0,22,0.95,1.01]);
|
||||
xlabel('节点号');
|
||||
ylabel('电压/p.u');
|
||||
%% VAngle
|
||||
subplot(2,1,2);
|
||||
% plot(x,mVAngel);
|
||||
hold on;
|
||||
load('D:\Matlab\StateEstimateionYALMIP-LU9\graph\9\20140327\20%\100SEVAngel.mat');
|
||||
t=SEVAngel;
|
||||
% plot(x,SEVAngel,'k-.');
|
||||
load('D:\Matlab\StateEstimateionYALMIP-LU9\graph\9\20140327\20%\50SEVAngel.mat');
|
||||
t=[t,SEVAngel];
|
||||
% plot(x,SEVAngel,'k--');
|
||||
load('D:\Matlab\StateEstimateionYALMIP-LU9\graph\9\20140327\20%\0SEVAngel.mat');
|
||||
t=[t,SEVAngel];
|
||||
% plot(x,SEVAngel,'k-');
|
||||
% plot(x,rVAngel,'k:');
|
||||
load('D:\Matlab\StateEstimateionYALMIP-LU9\graph\9\20140327\容量\100SEVAngel.mat');
|
||||
t=[t,SEVAngel];
|
||||
load('D:\Matlab\StateEstimateionYALMIP-LU9\graph\9\20140327\容量\50SEVAngel.mat');
|
||||
t=[t,SEVAngel];
|
||||
load('D:\Matlab\StateEstimateionYALMIP-LU9\graph\9\20140327\容量\0SEVAngel.mat');
|
||||
t=[t,SEVAngel];
|
||||
tt=[t,rVAngel];
|
||||
% bar(t(2:end,:));
|
||||
legend('0%','50%','100%','实际值');
|
||||
%axis([1,22,-0.08,0]);
|
||||
xlabel('节点号');
|
||||
ylabel('相角/p.u');
|
||||
end
|
||||
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
clc
|
||||
clear
|
||||
clear
|
||||
% yalmip('clear')
|
||||
tic
|
||||
[kmax,Precision,UAngel,Volt,Busnum,PVi,PVu,Balance,Y,Angle,P0,Q0,r,c,GB, ...
|
||||
|
|
@ -109,4 +108,5 @@ StatDeviation(rVolt,SEVolt,rVAngel,SEVAngel,rPD(PDi),rQD(QDi),PD,QD)
|
|||
%% Ô¼Êø¼ì²é
|
||||
% seOpti.equ(x);
|
||||
% sum([SEVolt;PD;QD]>cu(length(SEVolt)*2+2:end));
|
||||
% sum([SEVolt;PD;QD]<cl(length(SEVolt)*2+2:end));
|
||||
% sum([SEVolt;PD;QD]<cl(length(SEVolt)*2+2:end));
|
||||
RealValuePlot(mPD(PDi),mQD(QDi),rPD(PDi),rQD(QDi),SEVolt,rVolt,SEVAngel,rVAngel);
|
||||
|
|
@ -0,0 +1,142 @@
|
|||
clc
|
||||
clear
|
||||
close all
|
||||
% yalmip('clear')
|
||||
tic
|
||||
for I=1:1
|
||||
[kmax,Precision,UAngel,Volt,Busnum,PVi,PVu,Balance,Y,Angle,P0,Q0,r,c,GB, ...
|
||||
Linei,Linej,Transfori,Transforj,GenU,GenL,GenC,PG,QG,PD,QD,CenterA,PGi,PVQU,PVQL, ...
|
||||
Liner,Linex,Lineb,Transforr,Transforx,Transfork0]=pf('E:/算例/feeder33/feeder33.txt');
|
||||
%pf('C:\bpa\长虹世纪线_556844_2013-10-28\长虹世纪线_556844_2013-10-28_iPso_newFil
|
||||
%e.txt');
|
||||
% pf('E:/算例/东际911_2751267_2012-09-05/pyth-增加3倍.txt'); 20131125
|
||||
% pf('E:/算例/东际911_2751267_2012-09-05/newFIle20-使用.txt');
|
||||
|
||||
%% 潮流等式
|
||||
AngleIJ=sparse(r,c,UAngel(r)-UAngel(c)-Angle',Busnum,Busnum);
|
||||
PGBal=PD+diag(Volt)*Y.*cos(AngleIJ)*Volt';
|
||||
QGBal=QD+diag(Volt)*Y.*sin(AngleIJ)*Volt';
|
||||
%% 初值-即测量值
|
||||
PG0=PG;
|
||||
QG0=QG;
|
||||
PD0=PD;
|
||||
QD0=QD;
|
||||
PDReal=PD;%真值
|
||||
QDReal=QD;%真值
|
||||
PG0(Balance)=PGBal(Balance);
|
||||
QG0(Balance)=QGBal(Balance);
|
||||
QG0(PVi)=QGBal(PVi);
|
||||
PG(Balance)=PGBal(Balance);
|
||||
QG(PVi)=QGBal(PVi);
|
||||
Volt0=Volt;
|
||||
% PF=1;
|
||||
% AngleIJ=sparse(r,c,UAngel(r)-UAngel(c)-Angle',Busnum,Busnum);
|
||||
% dP=PG-PD-diag(Volt)*Y.*cos(AngleIJ)*Volt';
|
||||
% dPD=abs(dP./PD);
|
||||
% dQ=QG-QD-diag(Volt)*Y.*sin(AngleIJ)*Volt';
|
||||
% dQD=abs(dQ./QD);
|
||||
% maxdPQ=max([dPD(dPD<10);dQD(dQD<10)]);
|
||||
xVolt=Volt;
|
||||
xUAngel=UAngel;
|
||||
% VMatrix=sparse(r,c,UAngel(r)-UAngel(c)-Angle',Busnum,Busnum);
|
||||
% dP=PG-PD-diag(xVolt)*(Y.*cos(VMatrix))*xVolt';
|
||||
rPD=PD;
|
||||
rQD=QD;
|
||||
rVolt=Volt';
|
||||
rVAngel=UAngel';
|
||||
BalVolt=Volt(Balance);
|
||||
Busnum=length(Volt);
|
||||
PDi=find(PD~=0);
|
||||
QDi=find(QD~=0);
|
||||
rLoadCurrent=LoadCurrent( rVolt,rVAngel,rPD(PDi),rQD(QDi),PDi,QDi );
|
||||
%% 电流真实值
|
||||
[Volt,UAngel,Init_Z,Init_W,Init_L,Init_U,Init_Y,PG,QG,RestraintCount,wPG,wQG,wPD,wQD,wVolt,wLoadCurrent,PD,PD0,QD,randPDind,Loadi,noLoadi]=OPF_Init(Busnum,Balance,PG,QG,rVolt,GenU,GenL,PVi,PGi,PVQU,PVQL,PD0,QD0,rQD,rPD,rLoadCurrent);
|
||||
%% 开始
|
||||
%% 加噪音
|
||||
% load('PD0');
|
||||
% load('QD0');
|
||||
% load('mVolt');
|
||||
% load('mLoadCurrent');
|
||||
%% 17号负荷上加负数
|
||||
% PD0(17)=-10;
|
||||
%% 负荷用Pd=(1+k)Pd0添加负荷
|
||||
% QD0(11)=(1.+0.01*I)*rQD(11);
|
||||
% % load('mLoadCurrent');
|
||||
% load('I');
|
||||
sigma=0.03;
|
||||
%
|
||||
% [ mVolt,PD0,QD0,mLoadCurrent ] = GetMeasure(sigma,rVolt,rPD,rQD,rLoadCurrent );
|
||||
% sigma=sigma*(I-1)/50;
|
||||
% 排除大于3倍sigma的数据
|
||||
% save('mVolt','mVolt');
|
||||
% save('PD0','PD0');
|
||||
% save('QD0','QD0');
|
||||
%% 电流测量值
|
||||
% save('mLoadCurrent','mLoadCurrent');
|
||||
mPD=PD0;
|
||||
mQD=QD0;
|
||||
%% 目标函数
|
||||
%% Opti Toolbox
|
||||
seOpti=Opti();
|
||||
seOpti=seOpti.init(mVolt,PDi,QDi,wPD,wQD,wVolt,wLoadCurrent,mPD,mQD,rPD(PDi),rQD(QDi),Y,Angle,r,c,PG,QG,Balance,mLoadCurrent,noLoadi);
|
||||
%opts=nloptset('algorithm','ipopt');
|
||||
opts = optiset('solver','ipopt');
|
||||
opts.maxiter=85500;
|
||||
opts.maxtime=30000;
|
||||
opts.maxfeval=85000;
|
||||
opts.maxnodes=85000;
|
||||
opts.tolrfun=1e-4;
|
||||
opts.tolafun=1e-4;
|
||||
opts.warnings='all';
|
||||
opts.display='off';
|
||||
x0=[0.1*rPD(PDi);0.1*rQD(QDi); ...
|
||||
ones(length(Volt),1); ...
|
||||
zeros(length(Volt),1)];
|
||||
% x0=[PD(PDi);QD(QDi);xVolt';xUAngel'];
|
||||
[~,seOpti]=seOpti.equ(x0);
|
||||
cl=seOpti.Getcl();
|
||||
cu=seOpti.Getcu();
|
||||
Opt = opti('fun',@seOpti.obj,'ndec',length(Volt)*2+length(PDi)+length(QDi),'nl',@seOpti.equ,cl,cu,'options',opts)
|
||||
% Opt = opti('fun',@seOpti.obj,'ndec',length(Volt)*2+length(PDi)+length(QDi),'options',opts)
|
||||
[x,fval,exitflag,info] = solve(Opt,x0);
|
||||
info
|
||||
fval=seOpti.obj(x);
|
||||
fprintf('目标函数: %.20f\n',fval);
|
||||
toc
|
||||
rVolt=Volt0';
|
||||
rVAngel=xUAngel';
|
||||
SEVolt=x(length(PDi)+length(QDi)+1:length(Volt)+length(PDi)+length(QDi));
|
||||
SEVAngel=x(length(Volt)+length(PDi)+length(QDi)+1:end);
|
||||
fprintf('最大偏差\n')
|
||||
PD=x(1:length(PDi));
|
||||
QD=x(length(PDi)+1:length(PDi)+length(QDi));
|
||||
maxDev1=MaxDeviation(sigma,mVolt,SEVolt,rVAngel,SEVAngel,rPD(PDi),rQD(QDi),PD,QD)
|
||||
fprintf('统计偏差\n')
|
||||
statDev1=StatDeviation(sigma,rVolt,SEVolt,rVAngel,SEVAngel,rPD(PDi),rQD(QDi),PD,QD)
|
||||
%% 约束检查
|
||||
% load('maxDev');
|
||||
% load('statDev');
|
||||
% maxDev=[maxDev;maxDev1];
|
||||
% statDev=[statDev;statDev1];
|
||||
% save('maxDev','maxDev');
|
||||
% save('statDev','statDev');
|
||||
% seOpti.equ(x);
|
||||
% sum([SEVolt;PD;QD]>cu(length(SEVolt)*2+2:end));
|
||||
% sum([SEVolt;PD;QD]<cl(length(SEVolt)*2+2:end));
|
||||
% RealValuePlot(mPD(PDi),mQD(QDi),rPD(PDi),rQD(QDi),mVolt,rVolt,rVAngel);
|
||||
NormalizedResiduals(x,sigma,PDi,QDi,Volt0,mPD,mQD);
|
||||
SECurrent=LoadCurrent( SEVolt,SEVAngel,PD,QD,PDi,QDi );
|
||||
[flag,t1,t2]=MaxSigma( x,PDi,QDi,mPD,mQD,mVolt,mLoadCurrent,sigma,rPD,rQD,rVolt,rLoadCurrent );
|
||||
figure();
|
||||
SEMeasDeivation(PD,full(PD0(PDi)),QD,full(QD0(QDi)),rPD(PDi),rQD(QDi));
|
||||
[ok,msg] = checkSol(Opt);
|
||||
figure();
|
||||
plotError( SEVolt,SEVAngel,rVolt,rVAngel,mVolt,PD,mPD(PDi),rPD(PDi),QD,mQD(QDi),rQD(QDi),PDi );
|
||||
% LineCurrent( Linei,Linej,Liner,Linex,Volt,VAngle )
|
||||
if flag==1
|
||||
I
|
||||
t1
|
||||
t2
|
||||
break;
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,147 @@
|
|||
clc
|
||||
clear
|
||||
close all
|
||||
% yalmip('clear')
|
||||
tic
|
||||
for I=1:1
|
||||
[kmax,Precision,UAngel,Volt,Busnum,PVi,PVu,Balance,Y,Angle,P0,Q0,r,c,GB, ...
|
||||
Linei,Linej,Transfori,Transforj,GenU,GenL,GenC,PG,QG,PD,QD,CenterA,PGi,PVQU,PVQL, ...
|
||||
Liner,Linex,Lineb,Transforr,Transforx,Transfork0]=pf('E:\算例\feeder33\feeder33.txt');
|
||||
%pf('C:\bpa\长虹世纪线_556844_2013-10-28\长虹世纪线_556844_2013-10-28_iPso_newFil
|
||||
%e.txt');
|
||||
% pf('E:/算例/东际911_2751267_2012-09-05/pyth-增加3倍.txt'); 20131125
|
||||
% pf('E:/算例/东际911_2751267_2012-09-05/newFIle20-使用.txt');
|
||||
|
||||
%% 潮流等式
|
||||
AngleIJ=sparse(r,c,UAngel(r)-UAngel(c)-Angle',Busnum,Busnum);
|
||||
PGBal=PD+diag(Volt)*Y.*cos(AngleIJ)*Volt';
|
||||
QGBal=QD+diag(Volt)*Y.*sin(AngleIJ)*Volt';
|
||||
%% 初值-即测量值
|
||||
PG0=PG;
|
||||
QG0=QG;
|
||||
PD0=PD;
|
||||
QD0=QD;
|
||||
PDReal=PD;%真值
|
||||
QDReal=QD;%真值
|
||||
PG0(Balance)=PGBal(Balance);
|
||||
QG0(Balance)=QGBal(Balance);
|
||||
QG0(PVi)=QGBal(PVi);
|
||||
PG(Balance)=PGBal(Balance);
|
||||
QG(PVi)=QGBal(PVi);
|
||||
Volt0=Volt;
|
||||
% PF=1;
|
||||
% AngleIJ=sparse(r,c,UAngel(r)-UAngel(c)-Angle',Busnum,Busnum);
|
||||
% dP=PG-PD-diag(Volt)*Y.*cos(AngleIJ)*Volt';
|
||||
% dPD=abs(dP./PD);
|
||||
% dQ=QG-QD-diag(Volt)*Y.*sin(AngleIJ)*Volt';
|
||||
% dQD=abs(dQ./QD);
|
||||
% maxdPQ=max([dPD(dPD<10);dQD(dQD<10)]);
|
||||
xVolt=Volt;
|
||||
xUAngel=UAngel;
|
||||
% VMatrix=sparse(r,c,UAngel(r)-UAngel(c)-Angle',Busnum,Busnum);
|
||||
% dP=PG-PD-diag(xVolt)*(Y.*cos(VMatrix))*xVolt';
|
||||
rPD=PD;
|
||||
rQD=QD;
|
||||
rVolt=Volt';
|
||||
rVAngel=UAngel';
|
||||
BalVolt=Volt(Balance);
|
||||
Busnum=length(Volt);
|
||||
PDi=find(PD~=0);
|
||||
QDi=find(QD~=0);
|
||||
rLoadCurrent=LoadCurrent( rVolt,rVAngel,rPD(PDi),rQD(QDi),PDi,QDi );
|
||||
%% 电流真实值
|
||||
[Volt,UAngel,Init_Z,Init_W,Init_L,Init_U,Init_Y,PG,QG,RestraintCount,wPG,wQG,wPD,wQD,wVolt,wLoadCurrent,PD,PD0,QD,randPDind,Loadi,noLoadi]=OPF_Init(Busnum,Balance,PG,QG,rVolt,GenU,GenL,PVi,PGi,PVQU,PVQL,PD0,QD0,rQD,rPD,rLoadCurrent);
|
||||
%% 开始
|
||||
%% 加噪音
|
||||
load('PD0');
|
||||
load('QD0');
|
||||
load('mVolt');
|
||||
load('mLoadCurrent');
|
||||
%% 17号负荷上加负数
|
||||
% PD0(17)=-10;
|
||||
%% 负荷用Pd=(1+k)Pd0添加负荷
|
||||
% QD0(11)=(1.+0.01*I)*rQD(11);
|
||||
% % load('mLoadCurrent');
|
||||
% load('I');
|
||||
sigma=0.03;
|
||||
%
|
||||
% [ mVolt,PD0,QD0,mLoadCurrent ] = GetMeasure(sigma,rVolt,rPD,rQD,rLoadCurrent );
|
||||
% sigma=sigma*(I-1)/50;
|
||||
% 排除大于3倍sigma的数据
|
||||
% save('mVolt','mVolt');
|
||||
% save('PD0','PD0');
|
||||
% save('QD0','QD0');
|
||||
%% 电流测量值
|
||||
% save('mLoadCurrent','mLoadCurrent');
|
||||
mPD=PD0;
|
||||
mQD=QD0;
|
||||
%% 目标函数
|
||||
%% Opti Toolbox
|
||||
seOpti=Opti();
|
||||
seOpti=seOpti.init(mVolt,PDi,QDi,wPD,wQD,wVolt,wLoadCurrent,mPD,mQD,rPD(PDi),rQD(QDi),Y,Angle,r,c,PG,QG,Balance,mLoadCurrent,noLoadi);
|
||||
%opts=nloptset('algorithm','ipopt');
|
||||
opts = optiset('solver','ipopt');
|
||||
opts.maxiter=85500;
|
||||
opts.maxtime=30000;
|
||||
opts.maxfeval=85000;
|
||||
opts.maxnodes=85000;
|
||||
opts.tolrfun=1e-4;
|
||||
opts.tolafun=1e-4;
|
||||
opts.warnings='all';
|
||||
opts.display='off';
|
||||
x0=[0.1*rPD(PDi);0.1*rQD(QDi); ...
|
||||
ones(length(Volt),1); ...
|
||||
zeros(length(Volt),1)];
|
||||
% x0=[PD(PDi);QD(QDi);xVolt';xUAngel'];
|
||||
[~,seOpti]=seOpti.equ(x0);
|
||||
cl=seOpti.Getcl();
|
||||
cu=seOpti.Getcu();
|
||||
Opt = opti('fun',@seOpti.obj,'ndec',length(Volt)*2+length(PDi)+length(QDi),'nl',@seOpti.equ,cl,cu,'options',opts)
|
||||
% Opt = opti('fun',@seOpti.obj,'ndec',length(Volt)*2+length(PDi)+length(QDi),'options',opts)
|
||||
[x,fval,exitflag,info] = solve(Opt,x0);
|
||||
info
|
||||
fval=seOpti.obj(x);
|
||||
fprintf('目标函数: %.20f\n',fval);
|
||||
toc
|
||||
rVolt=Volt0';
|
||||
rVAngel=xUAngel';
|
||||
SEVolt=x(length(PDi)+length(QDi)+1:length(Volt)+length(PDi)+length(QDi));
|
||||
SEVAngel=x(length(Volt)+length(PDi)+length(QDi)+1:end);
|
||||
fprintf('最大偏差\n')
|
||||
PD=x(1:length(PDi));
|
||||
QD=x(length(PDi)+1:length(PDi)+length(QDi));
|
||||
maxDev1=MaxDeviation(sigma,mVolt,SEVolt,rVAngel,SEVAngel,rPD(PDi),rQD(QDi),PD,QD)
|
||||
fprintf('统计偏差\n')
|
||||
statDev1=StatDeviation(sigma,rVolt,SEVolt,rVAngel,SEVAngel,rPD(PDi),rQD(QDi),PD,QD)
|
||||
%% 约束检查
|
||||
% load('maxDev');
|
||||
% load('statDev');
|
||||
% maxDev=[maxDev;maxDev1];
|
||||
% statDev=[statDev;statDev1];
|
||||
% save('maxDev','maxDev');
|
||||
% save('statDev','statDev');
|
||||
% seOpti.equ(x);
|
||||
% sum([SEVolt;PD;QD]>cu(length(SEVolt)*2+2:end));
|
||||
% sum([SEVolt;PD;QD]<cl(length(SEVolt)*2+2:end));
|
||||
% RealValuePlot(mPD(PDi),mQD(QDi),rPD(PDi),rQD(QDi),mVolt,rVolt,rVAngel);
|
||||
%measurementN=sum(find(wVolt)>0)+sum(find(wPD)>0)+sum(find(wQD)>0);
|
||||
stE=StErrorS(SEVolt,SEVAngel,PD,QD,rVolt,rVAngel,rPD(PDi),rQD(QDi));
|
||||
fprintf('真实值统计误差为: %f',stE);
|
||||
stE=StErrorZ(SEVolt,PD,QD,rVolt,mPD(PDi),mQD(QDi),noLoadi);
|
||||
fprintf('测量值统计误差为: %f',stE);
|
||||
NormalizedResiduals(x,sigma,PDi,QDi,Volt0,mPD,mQD);
|
||||
SECurrent=LoadCurrent( SEVolt,SEVAngel,PD,QD,PDi,QDi );
|
||||
[flag,t1,t2]=MaxSigma( x,PDi,QDi,mPD,mQD,mVolt,mLoadCurrent,sigma,rPD,rQD,rVolt,rLoadCurrent );
|
||||
figure();
|
||||
SEMeasDeivation(PD,full(PD0(PDi)),QD,full(QD0(QDi)),rPD(PDi),rQD(QDi));
|
||||
[ok,msg] = checkSol(Opt);
|
||||
figure();
|
||||
plotError( SEVolt,SEVAngel,rVolt,rVAngel,mVolt,PD,mPD(PDi),rPD(PDi),QD,mQD(QDi),rQD(QDi),PDi );
|
||||
% LineCurrent( Linei,Linej,Liner,Linex,Volt,VAngle )
|
||||
if flag==1
|
||||
I
|
||||
t1
|
||||
t2
|
||||
break;
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
function SEMeasDeivation(SEPD,mPD,SEQD,mQD,rPD,rQD)
|
||||
% SEPD=[0.008764457
|
||||
% 0.00662037
|
||||
% 0.003138456
|
||||
% 0.013582449
|
||||
% 0.01033048
|
||||
% 0.062267498
|
||||
% 0.001892282
|
||||
% -0.058256191
|
||||
% ]*100;
|
||||
% mPD=[0.011028937;
|
||||
% 0.017491189;
|
||||
% 0.010876707;
|
||||
% 0.02326443;
|
||||
% 0.022649452;
|
||||
% 0.070719554;
|
||||
% 0.022716132;
|
||||
% -0.044759963]*100;
|
||||
% SEQD=[0.034669982;
|
||||
% 0.012889814;
|
||||
% -0.032514034;
|
||||
% -0.000517975;
|
||||
% 0.045225053;
|
||||
% -0.014760862;
|
||||
% 0.011850806;
|
||||
% -0.03903512]*100;
|
||||
% mQD=[0.035592708;
|
||||
% 0.014869678;
|
||||
% -0.03100282;
|
||||
% 0.003020169;
|
||||
% 0.050043998;
|
||||
% -0.011974413;
|
||||
% 0.018825594;
|
||||
% -0.033640186]*100;
|
||||
|
||||
% SEPD=[0.001561905;
|
||||
% -0.020073342;
|
||||
% 0.005002623;
|
||||
% 0.021636979;
|
||||
% 0.006405464;
|
||||
% -0.018023242;
|
||||
% -0.013238746;
|
||||
% 0.019036188;
|
||||
% ]*100;
|
||||
% mPD=[0.002577934;
|
||||
% -0.025909585;
|
||||
% 0.000976724;
|
||||
% 0.016575811;
|
||||
% -0.00020548;
|
||||
% -0.022269055;
|
||||
% -0.023089977;
|
||||
% 0.011141364;
|
||||
% ]*100;
|
||||
% SEQD=[-0.008447744;
|
||||
% 0.000738829;
|
||||
% 0.003884989;
|
||||
% 0.017023719;
|
||||
% -0.029683839;
|
||||
% 0.017385226;
|
||||
% 0.016485919;
|
||||
% -0.014714749;
|
||||
% ]*100;
|
||||
% mQD=[-0.005321255;
|
||||
% 0.003146241;
|
||||
% 0.005934332;
|
||||
% 0.021667621;
|
||||
% -0.024133979;
|
||||
% 0.020898732;
|
||||
% 0.025052645;
|
||||
% -0.007311454;
|
||||
% ]*100;
|
||||
SEPD=(SEPD-rPD)./rPD;
|
||||
SEQD=(SEQD-rQD)./rQD;
|
||||
mPD=(mPD-rPD)./rPD;
|
||||
mQD=(mQD-rQD)./rQD;
|
||||
x=1:length(mPD);
|
||||
subplot(2,1,1);
|
||||
plot(x,SEPD,'k');
|
||||
hold on;
|
||||
plot(x,mPD,'k:');
|
||||
legend('负荷有功估计值','负荷有功量测值');
|
||||
xlabel('节点号');
|
||||
ylabel('偏差/%')
|
||||
subplot(2,1,2);
|
||||
plot(x,SEQD,'k');
|
||||
hold on;
|
||||
plot(x,mQD,'k:');
|
||||
legend('负荷无功估计值','负荷无功量测值');
|
||||
xlabel('节点号');
|
||||
ylabel('偏差/%')
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
function SEMeasDeivation(SEPD,mPD,SEQD,mQD,rPD,rQD)
|
||||
% SEPD=[0.008764457
|
||||
% 0.00662037
|
||||
% 0.003138456
|
||||
% 0.013582449
|
||||
% 0.01033048
|
||||
% 0.062267498
|
||||
% 0.001892282
|
||||
% -0.058256191
|
||||
% ]*100;
|
||||
% mPD=[0.011028937;
|
||||
% 0.017491189;
|
||||
% 0.010876707;
|
||||
% 0.02326443;
|
||||
% 0.022649452;
|
||||
% 0.070719554;
|
||||
% 0.022716132;
|
||||
% -0.044759963]*100;
|
||||
% SEQD=[0.034669982;
|
||||
% 0.012889814;
|
||||
% -0.032514034;
|
||||
% -0.000517975;
|
||||
% 0.045225053;
|
||||
% -0.014760862;
|
||||
% 0.011850806;
|
||||
% -0.03903512]*100;
|
||||
% mQD=[0.035592708;
|
||||
% 0.014869678;
|
||||
% -0.03100282;
|
||||
% 0.003020169;
|
||||
% 0.050043998;
|
||||
% -0.011974413;
|
||||
% 0.018825594;
|
||||
% -0.033640186]*100;
|
||||
|
||||
% SEPD=[0.001561905;
|
||||
% -0.020073342;
|
||||
% 0.005002623;
|
||||
% 0.021636979;
|
||||
% 0.006405464;
|
||||
% -0.018023242;
|
||||
% -0.013238746;
|
||||
% 0.019036188;
|
||||
% ]*100;
|
||||
% mPD=[0.002577934;
|
||||
% -0.025909585;
|
||||
% 0.000976724;
|
||||
% 0.016575811;
|
||||
% -0.00020548;
|
||||
% -0.022269055;
|
||||
% -0.023089977;
|
||||
% 0.011141364;
|
||||
% ]*100;
|
||||
% SEQD=[-0.008447744;
|
||||
% 0.000738829;
|
||||
% 0.003884989;
|
||||
% 0.017023719;
|
||||
% -0.029683839;
|
||||
% 0.017385226;
|
||||
% 0.016485919;
|
||||
% -0.014714749;
|
||||
% ]*100;
|
||||
% mQD=[-0.005321255;
|
||||
% 0.003146241;
|
||||
% 0.005934332;
|
||||
% 0.021667621;
|
||||
% -0.024133979;
|
||||
% 0.020898732;
|
||||
% 0.025052645;
|
||||
% -0.007311454;
|
||||
% ]*100;
|
||||
SEPD=(SEPD-rPD)./rPD;
|
||||
SEQD=(SEQD-rQD)./rQD;
|
||||
mPD=(mPD-rPD)./rPD;
|
||||
mQD=(mQD-rQD)./rQD;
|
||||
x=1:length(mPD);
|
||||
subplot(2,1,1);
|
||||
plot(x,SEPD,'k');
|
||||
hold on;
|
||||
plot(x,mPD,'k:');
|
||||
legend('负荷有功估计值','负荷有功量测值');
|
||||
xlabel('节点号');
|
||||
ylabel('偏差/%')
|
||||
subplot(2,1,2);
|
||||
plot(x,SEQD,'k');
|
||||
hold on;
|
||||
plot(x,mQD,'k:');
|
||||
legend('负荷无功估计值','负荷无功量测值');
|
||||
xlabel('节点号');
|
||||
ylabel('偏差/%')
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
function [ output_args ] = StError( SEVolt,SEVangle,SEPD,SEQD,rVolt,rVangle,rSEPD,rSEQD );
|
||||
%STERROR Summary of this function goes here
|
||||
% Detailed explanation goes here
|
||||
t1=[SEVolt;SEVangle;SEPD;SEQD];
|
||||
t2=[rVolt,rVangle,rSEPD,rSEQD];
|
||||
t3=t1-t2
|
||||
|
||||
end
|
||||
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
function [ output_args ] = StErrorS( SEVolt,SEVangle,SEPD,SEQD,rVolt,rVangle,rSEPD,rSEQD)
|
||||
%STERROR Summary of this function goes here
|
||||
% Detailed explanation goes here
|
||||
t1=[SEVolt;SEVangle;SEPD;SEQD];
|
||||
t2=[rVolt;rVangle;rSEPD;rSEQD];
|
||||
m=length(t1);
|
||||
t3=sum( ((t1-t2)./0.03).^2)/m;
|
||||
output_args=t3^.5;
|
||||
|
||||
end
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
function [ output_args ] = StErrorZ( SEVolt,SEPD,SEQD,rVolt,rSEPD,rSEQD,noLoadi)
|
||||
%STERROR Summary of this function goes here
|
||||
% Detailed explanation goes here
|
||||
SEVolt(noLoadi)=0;
|
||||
rVolt(noLoadi)=0;
|
||||
SEPD(noLoadi)=0;
|
||||
SEQD(noLoadi)=0;
|
||||
rSEPD(noLoadi)=0;
|
||||
rSEQD(noLoadi)=0;
|
||||
t1=[SEVolt;SEPD;SEQD];
|
||||
t2=[rVolt;rSEPD;rSEQD];
|
||||
m=sum(find(t1>0));
|
||||
t3=sum( ((t1-t2)./0.03).^2)/m;
|
||||
output_args=t3^.5;
|
||||
|
||||
end
|
||||
|
||||
|
|
@ -1,16 +1,21 @@
|
|||
function [ output_args ] = StatDeviation( this,PG0,QG0,PD0,QD0 )%ͳ¼ÆÎó²î
|
||||
function [ output_args ] = StatDeviation(sigma,rVolt,SEVolt,rVAngel,SEVAngel,rPD,rQD,PD,QD)%ͳ¼ÆÎó²î
|
||||
%STATDEVIATION Summary of this function goes here
|
||||
% Detailed explanation goes here
|
||||
PDArray=PD;
|
||||
PD0Array=repmat(PD0,1,1);
|
||||
QD0Array=repmat(QD0,1,1);
|
||||
PDDev=(PDArray-PD0Array)/0.05;
|
||||
QDDev=(QDArray-QD0Array)/0.05;
|
||||
wholeMat=[PDDev;QDDev;];
|
||||
QDArray=QD;
|
||||
% QD0Array=rVAngel;
|
||||
PD0Array=repmat(rPD,1,1);
|
||||
QD0Array=repmat(rQD,1,1);
|
||||
PDDev=(PDArray-PD0Array)./PD0Array;
|
||||
QDDev=(QDArray-QD0Array)./QD0Array;
|
||||
VoltDev=(SEVolt-rVolt)./rVolt;
|
||||
VAngelDev=(SEVAngel-rVAngel)/sigma;
|
||||
wholeMat=[PDDev;QDDev;VoltDev;];
|
||||
t1=wholeMat.^2;
|
||||
t2=sum(t1,1);
|
||||
t3=t2/size(t1,1);
|
||||
t4=t3.^.5;
|
||||
output_args=sum(t4)/length(t4);
|
||||
output_args=sum(abs(wholeMat))/length(wholeMat);
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
function [ output_args ] = StatDeviation(rVolt,SEVolt,rVAngel,SEVAngel,rPD,rQD,PD,QD)%ͳ¼ÆÎó²î
|
||||
function [ output_args ] = StatDeviation(sigma,rVolt,SEVolt,rVAngel,SEVAngel,rPD,rQD,PD,QD)%ͳ¼ÆÎó²î
|
||||
%STATDEVIATION Summary of this function goes here
|
||||
% Detailed explanation goes here
|
||||
PDArray=PD;
|
||||
|
|
@ -6,15 +6,19 @@ QDArray=QD;
|
|||
% QD0Array=rVAngel;
|
||||
PD0Array=repmat(rPD,1,1);
|
||||
QD0Array=repmat(rQD,1,1);
|
||||
PDDev=(PDArray-PD0Array)/0.05;
|
||||
QDDev=(QDArray-QD0Array)/0.05;
|
||||
VoltDev=(SEVolt-rVolt)/0.05;
|
||||
VAngelDev=(SEVAngel-rVAngel)/0.05;
|
||||
wholeMat=[VoltDev;VAngelDev];
|
||||
t1=wholeMat.^2;
|
||||
t2=sum(t1,1);
|
||||
t3=t2/size(t1,1);
|
||||
t4=t3.^.5;
|
||||
output_args=sum(t4)/length(t4);
|
||||
PDDev=(PDArray-PD0Array)./PD0Array;
|
||||
QDDev=(QDArray-QD0Array)./QD0Array;
|
||||
VoltDev=(SEVolt-rVolt)./rVolt;
|
||||
VAngelDev=(SEVAngel-rVAngel)./rVAngel;
|
||||
% PDDev=(PDArray-PD0Array)./sigma;
|
||||
% QDDev=(QDArray-QD0Array)./sigma;
|
||||
% VoltDev=(SEVolt-rVolt)./sigma;
|
||||
wholeMat=[PDDev;QDDev;VoltDev;VAngelDev(2:end)];
|
||||
% t1=wholeMat.^2;
|
||||
% t2=sum(t1,1);
|
||||
% t3=t2/size(t1,1);
|
||||
% t4=t3.^.5;
|
||||
% output_args=sum(t4)/length(t4);
|
||||
output_args=sum(abs(wholeMat))/length(wholeMat);
|
||||
end
|
||||
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue