Main Content

软件制定参数估计如何san Optimization Problem

参数估计作为优化问题的概述

When you perform parameter estimation, the software formulates an optimization problem. The optimization problem solution is the estimated parameter values set. This optimization problem consists of:

  • X-设计变量。旨在估计的模型参数和初始状态。

  • F((X)-Objective function。计算模拟响应和测量响应之间差异的度量的函数。也被称为cost functionorest一世mation error。

  • ((Optional) X X X -边界。估计参数值的限制。

  • ((Optional)C((X)-约束功能。指定对设计变量的限制的函数。

The optimization solver tunes the values of the design variables to satisfy the specified objectives and constraints. The exact formulation of the optimization depends on the optimization method that you use.

Cost Function

该软件调谐模型参数以获得模拟响应(ySIM)跟踪测得的响应或参考信号(y参考)。为此,求解器将cost functionorest一世mation error,衡量模拟和测量响应之间的差异。成本函数,F((X),,,,一世sthe objective function of the optimization problem.

类型

原始估计错误,e((t),定义为:

e (( t = y r e F (( t - y s 一世 m (( t

e((t)一世salso referred to as theerror residuals或者,简单地res一世duals。

金宝app®设计优化™软件为您提供以下成本功能来处理e((t):

Cost Function Formulation Option Name in GUI or Command Line
Sum squared error (default)

F (( X = t = 0 t n e (( t × e (( t

n是样本的数量。

'SSE'
总和绝对错误

F (( X = t = 0 t n | e (( t |

n是样本的数量。

'SAE'
原始错误

F (( X = [[ e (( 0 e (( n 这是给予的

n是样本的数量。

'Residuals'

此选项仅在命令行中可用。

自定义功能 N/A。

此选项仅在命令行中可用。

时间基础

The software evaluates the cost function for a specific time interval. This interval is dependent on themeasured signal time base和模拟信号时间群。

  • The measured signal time base consists of all the time points for which the measured signal is specified. In case of multiple measured signals, this time base is the union of the time points of all the measured signals.

  • 模拟信号时间群由模拟模型的所有时间点组成。

如果模型使用可变步骤求解器,则模拟信号时间群可以从一个优化迭代变为另一种优化。模拟和测量的信号时间库可能不同。该软件仅在两者共有的时间间隔中评估成本函数。默认情况下,该软件仅使用常用时间间隔中测量信号指定的时间点。

  • In the GUI, you can specify the simulation start and stop times in theSimulation timearea of the仿真选项对话框。

  • 在命令行,该软件将仿真停止时间指定为测量信号时间群的最后一点。例如,以下代码模拟模型,直到最长的运行输出信号的结束时间经验, 一个sdo.Experimentobject:

    SIM_obj = createSimulator(exp); sim_obj = sim(sim_obj);

    SIM_objcontains the simulated response for the model associated with经验

界限和约束

You can specify bounds for the design variables (estimated model parameters), based on your knowledge of the system. Bounds are expressed as:

X X X

X and X are the lower and upper bounds for the design variables.

For example, in a battery discharging experiment, the estimated battery initial charge must be greater than zero and less thanInf。这些范围表示为:

0 < X <

有关如何指定这些类型界限的示例,请参见Estimate Model Parameters and Initial States (Code)

You can also specify other constraints,C((X),在命令行的设计变量上。C((X)可以是线性的或非线性的,可以描述平等或不平等。C((X)还可以指定多参数约束。例如,对于简单的摩擦模型,C((X)可以指定静态摩擦系数必须大于或等于动态摩擦系数。表达此约束的一种方法是:

C (( X X 1 - X 2 C (( X 0

X1andX2are the dynamic and static friction coefficients, respectively.

如何指定一个约束的一个例子,看看具有参数约束(代码)的估计模型参数

Optimization Methods and Problem Formulations

优化问题可能是以下类型之一:

  • Minimization problem — Minimizes an objective function,F((X)。You specify the measured signal that you want the model output to track. You can optionally specify bounds for the estimated parameters.

  • 混合最小化和可行性问题 - 最小化目标函数,F((X),受指定的界限和约束约束C((X)。You specify the measured signal that you want the model to track and bounds and constraints for the estimated parameters.

  • Feasibility problem — Finds a solution that satisfies the specified constraints,C((X)。您仅针对估计参数指定界限和约束。这种类型的问题在参数估计中并不常见。

您指定的优化方法确定估计问题的公式。该软件提供以下优化方法:

Optimization Method Name Description 优化问题公式
  • User interface:非线性最小二乘

  • Command line:'lsqnonlin'

Minimizes the squares of the residuals, recommended method for parameter estimation.

This method requires a vector of error residuals, computed using a fixed time base. Do not use this approach if you have a scalar cost function or if the number of error residuals can change from one iteration to another.

此方法使用优化工具箱™函数,LSQNONLIN

Minimization Problem

Mixed Minimization and Feasibility Problem

Feasibility Problem

  • User interface:Gradient Descent

  • Command line:'fmincon'

一般非线性求解器,使用成本函数梯度。

如果要指定以下一个或任何组合,请使用此方法:

  • 自定义成本功能

  • Parameter-based constraints

  • 基于信号的约束

此方法使用Optimization Toolbox function,Fmincon

For information on how the gradient is computed, see梯度计算

Minimization Problem

Mixed Minimization and Feasibility Problem

Feasibility Problem

  • User interface:Simplex Search

  • Command line:'fminsearch'

Based on the Nelder-Mead algorithm, this approach does not use the cost function gradient.

Use this approach if your cost function or constraints are not continuous or differentiable.

此方法使用优化工具箱函数,fminsearchandfminbndfminbnd一世sused if one scalar parameter is being optimized. Otherwise,fminsearch用来。您无法指定参数范围, X X X ,,,,withfminsearch

Minimization Problem

Mixed Minimization and Feasibility Problem

Feasibility Problem

  • User interface:Pattern Search

  • Command line:'patternsearch'

Direct search method, based on the generalized pattern search algorithm, this method does not use the cost function gradient.

Use this approach if your cost function or constraints are not continuous or differentiable.

此方法使用Global Optimization Toolbox功能,patternsearch(全局优化工具箱)

Minimization Problem

Mixed Minimization and Feasibility Problem

Feasibility Problem

也可以看看

||||||||(全局优化工具箱)

相关示例

更多关于