Main Content

每个实验估计模型参数(GUI)

此示例显示了如何使用多个实验来估计模型参数值的混合;一些使用所有实验估计的,而另一些则是使用单个实验估计的。该示例还显示了如何使用依赖性参数值配置估计实验。

您根据在放电和充电电池充电的数据中估算可充电电池的参数。

打开模型并获取实验数据

此示例估计一个简单,可充电电池模型的参数,Sdobattery。该模型输入是电池电流,电池端子电压是通过电池最先进计算的电池端子电压。

open_system('sdoBattery'

The model is based on the equation

e = (( 1 - Loss v - k max 1 - s s

In the equation:

e 是电压中电池端子电压。

v 电池恒电压是电压的。

k 是欧姆的电池偏振性。

max is the maximum battery capacity in Ampere-hours.

s is the battery charge state, with 1 being fully charged and 0 discharged. The battery state-of-charge is computed from the integral of the battery current with a positive current indicating discharge and a negative current indicating charging. The battery initial state-of-charge is specified by 0 in Ampere-hours.

Loss 充电时的电压下降是电池常数电压的一小部分表示。当电池放电时,该值为零。

v,,,,k,,,,问max,,,,问0,,,,andLoss是模型工作空间中定义的变量。

estimation Experiment Data

进行1.2V(6500mAh)电池进行放电和充电实验。该实验数据已加载到预先配置的估计过程中。

使用以下命令加载预配置的估计会话。

加载sdobattery_spesessionspetool(SDOSessionData)

测量的电荷和放电实验数据被加载并绘制。点击看法选项卡以布局图,以便实验图:Charge_expand实验图:DCHARGE_EXP都可见。点击Plot Model Response查看模型模拟与测量实验数据的匹配程度。

图显示电池初始充电问0is not set correctly for theCharge_Expexperiment and that the modelv,,,,k,,,,andLoss需要估计参数。

Setting Experiment Parameter Values

The previous plot indicates that theCharge_Exp电池初始充电,问0,未正确设置。将初始电荷添加到两个实验中。右键点击Charge_Exp并选择编辑。对话框进行编辑实验。

点击选择参数to open a dialog to add model parameters to the experiment. SelectLossand问0添加到实验中。选择Lossas we need to estimate this parameter using only theCharge_Exp实验。点击Okto add the问0andLoss实验的参数。

设置电池初始充电问0in theCharge_Exp到0,即没有初始费用。

类似地添加电池初始充电问0to theDCharge_Exp实验并将初始电荷设置为6.5。,即对于此实验,有初始电荷。

现在,使用正确的初始电池充电更新实验Plot Model Response模拟模型并比较测量和模拟数据。

The experiment plots show that the experiment initial conditions match but the battery response does not. The next step is to estimate thekandv模型参数。

选择估计参数

The previous plot showed that the model response does not match the measured data and we need to estimate the modelvandk参数。

点击选择参数to open a dialog to select model parameters.

The upper portion of the select parameters dialog has a section for parameters that are tuned using all experiments. Click选择参数and add thevandkmodel parameters to the estimated parameters. Set thevminimum to 0 and the maximum to 2, similarly set thek最小到1E-6,最大为0.1。

对话框的下部有一个针对使用单个实验调整的初始状态和参数的部分。

为了Charge_Exp我们调整Lossparameter and set its minimum to 0 maximum to 0.5. The battery initial charge问0is fixed to 0 and should not be estimated; uncheck估计

选择DCharge_ExpexperimentCombobox查看参数设置DCharge_Exp实验。电池初始充电问0固定为6.5,不应估计;取消选中估计

估计参数值

The experiments and estimated parameters are configured and we a ready to run the estimation. First create a plot to monitor the estimation progress. ClickAdd Plot并选择参数轨迹。这创建了一个图,以显示估计参数值在估计过程中的变化。点击看法选项卡以布局图,以便可见实验和参数轨迹图。

点击估计按钮开始估计。您可以通过设置Cost Function组合和点击更多选择

While the estimation is running the plots update and a dialog showing estimation progress appears. The progress dialog shows the estimation iterations, the number of times the model has been evaluated (F-count),,,,and the estimation cost at each iteration.

After a number of iterations the estimation converges and terminates. The experiment plots show the measured and simulation data matching well. The估计值plot shows thev,,,,k,,,,andLossparameters changing during the estimation; the scale ofv,,,,k,,,,andLossare different, right click on the plot and selectShow scaled valuesto see how all the parameters changed from their original values.

相关示例

要了解如何使用该实验估算参数SDO.优越命令,请参阅估计Model Parameters Per Experiment (Code)

关the model

bdclose('sdoBattery'