Multi variable parameter estimation from data set

Hello,
I have a set of data from numerical simulation (36 simulations), I want to obtained a generalize empirical relation from the data.
Normally I can use the curve fitting toolbox to find the relation using a specific model equation for one variable, but
My data set is multi variable function that depends on three variables,
The model equation is of the from:
I = a/(b +x);
with a,b =f (Ct,Ia,and R)
0.64 < Ct < 0.98,
0.05 < Ia < 0.2
0.2 < R < 0.6
The empirical relation I want to finnaly obtained can be expressed as
where A, alpha, beta and zeta are constant

6 Kommentare

Torsten
Torsten am 29 Mär. 2022
And what are the fitting parameters ? A, alpha1, alpha2, beta1, beta2, zeta1, zeta2 and x ?
A, alpha1, alpha2, beta1, beta2, zeta1, zeta2 are constant values that I want to obtained after the solution,
x is the independent variable
Torsten
Torsten am 29 Mär. 2022
So again please tell us what the parameters are you want to obtain from the fitting, for which parameters you have fixed values and for which parameters you have the 36 data points.
I would like to obtain all the constant in the expression,
The function I depends on Ct, Ia and R. the dependence is usually a power relation(in form of alpha,beta,zeta) which should be a constant value. The vatiables Ct, Ia and R are inequatity contrained in the function.
Therefore, I would like to obtained the constant (alpha, beta,zeta) for the contrained values.
Thank you
Torsten
Torsten am 29 Mär. 2022
Bearbeitet: Torsten am 29 Mär. 2022
And you have 36 data for I and x ? And all other parameters are unknown ?
No sir, I have a set of 36 numerical result
here is the data for clarification.
for K = [1 2 3] % This call file with different Ct values
if K == 1
Ct = 0.64; % the actual Ct used in the simulation
elseif K == 2
Ct = 0.89;
else
Ct = 0.98;
end
for DH = [20 40 60] % DH is R as mention above; It calls a file with selected Ct
for p = [5 10 15 20] % p is Ia, sorry for the different names!!
filename = sprintf('IaddK%dDH%dp%d.csv',K,DH,p); % file name in the form (IaddK2DH40p10.csv)
file = importdata(filename);
tag = file.data;
x = tag(:,1); Iobs = tag(:,2)*0.01;
Ia = 0.01*p; R = 0.01*DH; % convering percentage
figure
plot(x,Iobs)
end
end
end
For each of the 'filename', is a column for x and I(I_obs is the numerical data)
I want to develop a generalize model for all the sets of data, respecting the constraints.
I have tried to use Nonlinear Least-Squares, Problem-Based
but it gives the parameters for each data, I want to generalize it please,
Thank you very much

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Torsten
Torsten am 29 Mär. 2022
Bearbeitet: Torsten am 29 Mär. 2022
Ok.
Form one big matrix M with the data of all your Excel sheets.
First column: x
Second column: I
Third column: Ct corresponding to x and I
Fourth column: Ia corresponding to x and I
Fifth column: R corresponding to x and I
Then you can use the following code:
M = your big matrix
% Initial values for the parameters
% You might choose better guesses if you know better
A_0 = 1.0;
alpha1_0 = 0.81;
alpha2_0 = 0.81;
beta1_0 = 0.125;
beta2_0 = 0.125;
zeta1_0 = 0.4;
zeta2_0 = 0.4;
x0 = [A_0;alpha1_0;alpha2_0;beta1_0;beta2_0;zeta1_0;zeta2_0];
lb = [-Inf,0.64;0.64;0.05;0.05;0.2;0.2];
ub = [Inf;0.98;0.98;0.2;0.2;0.6;0.6];
fun = @(p) M(:,2) - (p(1)*M(:,3).^p(2).*M(:,4).^p(4).*M(:,5).^p(6))./...
(p(1)*M(:,3).^p(3).*M(:,4).^p(5).*M(:,5).^p(7) - M(:,1));
x = lsqnonlin(fun,x0,lb,ub];
A = x(1)
alpha1 = x(2)
alpha2 = x(3)
beta1 = x(4)
beta2 = x(5)
zeta1 = x(6)
zeta2 = x(7)

1 Kommentar

Hello, I was able to get a model from your explanation. Although the model gives almost the same parameters as defined in the 'ub'. And the accuracy of the model is not encouraging. Maybe I should use another model equation to have better results.
Thanks

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Get Started with Curve Fitting Toolbox finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by