problem using fsolve in parameter identification, is it good to add redundancy?

I want to identify 4 parameters of a nonlinear equations f(x,y)=0. Now I got several groups of experimental data: x and y.
Theoretically, only four groups of x and y is needed to create 4 equations to solve and get the 4 parameters.
But is it better for me to use all the groups of x and y as redundancy in fsolve so that I can get a better identification result? How does fsolve works?

 Accepted Answer

fsolve in some sense tries to force the sum of squares of the output of system to zero. If you have a system of non-linear equations then use FSOLVE. Redundant equations will feature in the optimization during the minimization as well.
On the other hand if you have a single nonlinear equation with 4 parameters and several observations (groups of x and y) and would like to estimate the 4 parameters then use lsqnonlin or nlinfit. Can you give us an idea or an example of your f(x,y)

5 Comments

Thank you very much! And sure,it is expressed by an implicit function like: c1-y-(x+c4*y)/c3-c4*(e^((x+c4*y)/0.026)-1)=0 %c1 c2 c3 c4 are the parameters that will be identified %x is independent variable and y is dependent variable, which are derived by experiment
At first, I tried to use nlinfit, by making both x and y as input and 0 as output, but the result is poor. And that's why I tried to use fsolve.
Do you have any suggestion about this?
Create a system using all your observations. The following function will accept c-the parameters to be optimized, x and y your observation vectors:
function Y = Fcn(c,x,y)
n=length(y);
C = repmat(c(:)',n,1);
Y = C(:,1)-y-(x+C(:,4).*y)./C(:,3)-C(:,4).*(exp((x+C(:,4).*y)/0.026)-1);
end
You will use this function in fsolve as follows:
>> x = rand(100,1);y = rand(100,1); %sample x and y, you'll use your data.
>> c0 = [1 1 1 1] %initial values
>> F = fsolve(@(c)(Fcn(c,x,y)),c0)
Got it! But there's another thing that I am confused about: why the input of fsolve should be an anonymous function? Why it is not able to use the function Fcn directly?
Because you have to pass extra arguments in addition (x,y) to C. This link explains what i am talking about:

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!