coefficientCheck function

Home > User Guides >


mfeval.coefficientCheck validates that model coefficients pass any restrictions placed on them. Only works with MF 6.1 models.

Syntax

[res, c, vals] = mfeval.coefficientCheck(mfStruct)
[res, c, vals] = mfeval.coefficientCheck(mfStruct, paramGroup)

Description

res is a struct of logical results for each coefficient check where (0 = pass, 1 = fail)

c is a struct of values for which an optimiser must satisfy c <= 0 to make the coefficient check pass.

vals is a struct of the values for each coefficient check.

mfStruct is structure of Magic Formula parameters.

paramGroup is a string defining the Magic Formula parameter group for which to conduct the coefficient checks for. Leaving blank will run all.

Contents

Read TIR files

Use readTIR to store the magic formula parameters into structures

modelA = mfeval.readTIR('Model_Unstable.tir');
modelB = mfeval.readTIR('MagicFormula61_Parameters.tir');

Call to coefficientCheck

Use coefficientCheck the check if the models are passing the restrictions explained in the Pacejka book

[resA, ~, ~] = mfeval.coefficientCheck(modelA);
[resB, ~, ~] = mfeval.coefficientCheck(modelB);

Check results

% Loop through the results for model A and display a message if a
% coefficient fails
fields = fieldnames(resA);
for i = 1:numel(fields)
  if resA.(fields{i}) == 1
   fprintf([ 'Model A: Coeff. Fail: ' fields{i} '\n']);
  end
end

% Loop through the results for model A and display a message if a
% coefficient fails
fields = fieldnames(resB);
for i = 1:numel(fields)
  if resB.(fields{i}) == 1
   fprintf([ 'Model B: Coeff. Fail: ' fields{i} '\n']);
  end
end
Model A: Coeff. Fail: Cx
Model A: Coeff. Fail: Dx
Model A: Coeff. Fail: Ey
Model A: Coeff. Fail: Bt
Model A: Coeff. Fail: Et