How to set up the Matrix variables to use Options = optimoptions(‘lsqcurvefit’,’algorithm’,’levenberg-marquardt’)
I have two sets of M1 and M2 vectors (1×20) of experimental values that correspond to two sets of K1 and K2 inputs (1×20) respectively. Theoretlcal values of M1 and M2 (call them M1T and M2T) have a relationship with K1 and K2 such that M1-T is a function of K1 and K2, and M2-T is also a function of K1 and K2 with a series of a1 to a6 coefficients.
I am trying to find those a1 to a6 coefficients by minimizing the error function Total Error = (M1 – M1T)^2 + (M2-M2T)^2 by the use of
options = optimoptions(‘lsqcurvefit’,’Algorithm’,’levenberg-marquardt’), however, I don’t know how to set up my variables into these names/function (i.e. don’t know the approriate coding syntax).
As an example;
the inputs are: M1 = [ i1 i2 i3 ………… i20], M2 = [ i1 i2 i3 ………….i20], K1 = [ i1 i2 i3 ………… i20], K2 = [ i1 i2 i3 ………….i20],
the relationship between theroretical values of M1, M2 and the K1 and K2 are:
M1T(i) = a1*K1(i) + a2*K1(i)*K2(i) + a3*K2(i) + a4*(K1(i))^2
M2T(i) = a2*K2(i) + a2*K1(i) + a5*(K2(i))^2 + a6*K1(i)*K2(i)I have two sets of M1 and M2 vectors (1×20) of experimental values that correspond to two sets of K1 and K2 inputs (1×20) respectively. Theoretlcal values of M1 and M2 (call them M1T and M2T) have a relationship with K1 and K2 such that M1-T is a function of K1 and K2, and M2-T is also a function of K1 and K2 with a series of a1 to a6 coefficients.
I am trying to find those a1 to a6 coefficients by minimizing the error function Total Error = (M1 – M1T)^2 + (M2-M2T)^2 by the use of
options = optimoptions(‘lsqcurvefit’,’Algorithm’,’levenberg-marquardt’), however, I don’t know how to set up my variables into these names/function (i.e. don’t know the approriate coding syntax).
As an example;
the inputs are: M1 = [ i1 i2 i3 ………… i20], M2 = [ i1 i2 i3 ………….i20], K1 = [ i1 i2 i3 ………… i20], K2 = [ i1 i2 i3 ………….i20],
the relationship between theroretical values of M1, M2 and the K1 and K2 are:
M1T(i) = a1*K1(i) + a2*K1(i)*K2(i) + a3*K2(i) + a4*(K1(i))^2
M2T(i) = a2*K2(i) + a2*K1(i) + a5*(K2(i))^2 + a6*K1(i)*K2(i) I have two sets of M1 and M2 vectors (1×20) of experimental values that correspond to two sets of K1 and K2 inputs (1×20) respectively. Theoretlcal values of M1 and M2 (call them M1T and M2T) have a relationship with K1 and K2 such that M1-T is a function of K1 and K2, and M2-T is also a function of K1 and K2 with a series of a1 to a6 coefficients.
I am trying to find those a1 to a6 coefficients by minimizing the error function Total Error = (M1 – M1T)^2 + (M2-M2T)^2 by the use of
options = optimoptions(‘lsqcurvefit’,’Algorithm’,’levenberg-marquardt’), however, I don’t know how to set up my variables into these names/function (i.e. don’t know the approriate coding syntax).
As an example;
the inputs are: M1 = [ i1 i2 i3 ………… i20], M2 = [ i1 i2 i3 ………….i20], K1 = [ i1 i2 i3 ………… i20], K2 = [ i1 i2 i3 ………….i20],
the relationship between theroretical values of M1, M2 and the K1 and K2 are:
M1T(i) = a1*K1(i) + a2*K1(i)*K2(i) + a3*K2(i) + a4*(K1(i))^2
M2T(i) = a2*K2(i) + a2*K1(i) + a5*(K2(i))^2 + a6*K1(i)*K2(i) optimization, minimization algorithm MATLAB Answers — New Questions