MATLAB Answers

0

Find the parameters of integration

Asked by Kim Jeong Min on 2 Jul 2018
Latest activity Commented on by Ameer Hamza
on 3 Jul 2018
Hello everyone, I have a question that hasn't been able to find it on my own though, so any help is greatly appreciated.
I try to find the parameters a, b, c, d and e which satisfy below equations.
Where T_1~T_5 and q_1~q_5 are input parameters which already know.
Are there any functions that can solve these kinds of problem in MATLAB?
Thanks for any helpful ideas.

  6 Comments

I do not have "Curve Fitting Toolbox" right now, but I am willing to purchase if it is necessary to solve the problem.
It is not necessary -- it just makes it easier, probably.
If the problem is very easy to solve using "Curve Fitting Toolbox" (or the problem is too complicated without "Curve Fitting Toolbox"). Please tell me the solution with "Curve Fitting Toolbox".

Sign in to comment.

1 Answer

Answer by Ameer Hamza
on 2 Jul 2018

Try this. This requires optimization toolbox. This uses the sum of squared error from your equations as an objective function.
T0 = 1;
Tx = [2; 3; 4; 5; 6]; % from T1 to T5
qx = [2; 3; 4; 5; 6];
f = @(a,b,c,d,e, T) (a+b*T+c*T.^2).^(1./(d+e*T));
f_int = @(a,b,c,d,e, T0, T1) integral(@(T) f(a,b,c,d,e,T), T0, T1);
obj_fun = @(a,b,c,d,e) sum((arrayfun(@(T0, T1) f_int(a,b,c,d,e, T0, T1), T0*ones(size(Tx)), Tx)-qx).^2);
sol = fmincon(@(x) obj_fun(x(1),x(2),x(3),x(4),x(5)), [1;1;1;1;1], [], []);
The sol contain value of a, b, c, d and e in order.

  7 Comments

Could you post some sample T and q values for us to test with?
Thank you for using so much personal time to solve this problem.
The conditions are:
Sorry for the mistake I made (missing exponential) for the specific form of function.
As Walter pointed out, the difficulty is finding a suitable starting point for optimization. After the introduction of exp() term, it is even more difficult. The new integrand is very sensitive to the value of b and c, for the given value of integral limits. I don't have curve fitting toolbox but maybe it is able to estimate parameters for this new integrand.

Sign in to comment.