Model Browser User's Guide | ![]() ![]() |
Subfunctions
Those subfunctions that must be edited are as follows:
These are the parameters of the Simulink model that will be fitted.
This subfunction must return a cell array of strings. These are the parameter names that the Simulink model requires from the workspace. These strings must match the parameter names declared in the Simulink model (see Parameters).
These are constant parameters required by the Simulink model from the workspace. They are not fitted. These parameters must be the same as those in the Simulink model and all names must match. Here fuelPuddle
requires no such parameters, and hence we return an empty call array and empty matrix.
Initial conditions (for the integrators) are based on the current parameters, and inputs could be calculated here. The steady state can be passed in and you can calculate this from supplied data.
This is the number of fitted parameters. For fuelPuddle
we have two parameters, x
and tau
.
This is the number of input factors, including time. For fuelPuddle
we input X = [t, u(t)]
and hence the number of input factors is 2.
This subfunction returns a column vector of initial values for the parameters that are to be fitted. The initial values can be defined to be data-dependent, hence there is a flag to signal if the data is not worth fitting. Here we simply define some default initial values for x
and tau
.
Optional Subfunctions
The remaining subfunctions need not be edited unless they are required. The comments in the code describe the role of each function. Mostly these functions are used when you are creating a template for user-defined models. There is only one of these subfunctions relevant here.
These labels are used on plots and so on. You can use Latex notation, and it is correctly formatted.
![]() | Template File | Checking into MBC | ![]() |