Multi variable parameter estimation from data set

1 view (last 30 days)
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 Comments
Torsten
Torsten on 29 Mar 2022
Edited: Torsten on 29 Mar 2022
And you have 36 data for I and x ? And all other parameters are unknown ?
Kabir Shariff
Kabir Shariff on 29 Mar 2022
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

Sign in to comment.

Accepted Answer

Torsten
Torsten on 29 Mar 2022
Edited: Torsten on 29 Mar 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 Comment
Kabir Shariff
Kabir Shariff on 30 Mar 2022
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

Sign in to comment.

More Answers (0)

Categories

Find more on Get Started with Curve Fitting Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!