Goodevening, I’am trying to reproduce the example present in user_manual_inversion at chapter 2.3, the example is working fine but when I substitute the model function with the one needed for my case study I always get the same error:

Error using uq_inversion_likelihood

Unable to perform assignment because the size of the left side is 100-by-27 and the size of the right side is 1-by-27.

When I consider a single output the algorithm works fine, Nevertheless the definition of my response function for the model is carrying out a row vector (1x27) and the observations have the same size. Using multiple models with one single output I can bypass the problem but the computational cost of the analysis become huge since I have to evaluate 27 single models. If someone could kindly spot where is the problem it will be perfect, thank you very much, the code is pasted as a reference:

uqlab

rng(100,‘twister’)

ModelOpts.Name = ‘Forward model’;

ModelOpts.mFile = ‘FM’;

myForwardModel = uq_createModel(ModelOpts);

modelopts.isVectorized = false;

PriorOpts.Marginals(1).Name = ‘T1’;

PriorOpts.Marginals(1).Type = ‘uniform’;

PriorOpts.Marginals(1).Parameters = [0.5 2]; % (m)

PriorOpts.Marginals(2).Name = ‘T2’;

PriorOpts.Marginals(2).Type = ‘uniform’;

PriorOpts.Marginals(2).Parameters = [0.5 2]; % (m)

PriorOpts.Marginals(3).Name = ‘T3’;

PriorOpts.Marginals(3).Type = ‘uniform’;

PriorOpts.Marginals(3).Parameters = [0.01 5]; % (m)

PriorOpts.Marginals(4).Name = ‘T4’;

PriorOpts.Marginals(4).Type = ‘uniform’;

PriorOpts.Marginals(4).Parameters = [0.01 2.5] ; % (N/mˆ2)

myPriorDist = uq_createInput(PriorOpts);

DiscrepancyOpts.Type = ‘Gaussian’;

DiscrepancyOpts.Parameters = 2e3;

BayesOpts.Discrepancy = DiscrepancyOpts;

V = transpose(B_1(:,3));

myData.Name = ‘Critical Massflowrate’;

myData.y = V;

BayesOpts.Type = ‘Inversion’;

BayesOpts.Data = myData;

BayesOpts.Prior = myPriorDist;

myBayesianAnalysis = uq_createAnalysis(BayesOpts);

uq_postProcessInversion(myBayesianAnalysis,‘priorPredictive’,1000);

uq_print(myBayesianAnalysis)

uq_display(myBayesianAnalysis)