Using fmincon while computing one of the variables in the objective function to satisfy another condition

I am solving a nonlinear curve-fitting problem based on two uniaxial tensile test data performed on two strip specimens along two perpendicular directions. For this optimization problem, I am trying to use the fmincon function, since I have some linear and nonlinear constrains on the material constants to be satisfied.
I am minimizing the objective function in the least squares sense, i.e., to minimize [ Sum ( Sigma_model - Sigma_exp )^2 ].
Here, Sigma_model is a function involving a set of material constants and strains obtained from uniaxial test data.
The problem I am facing is:
In case of uniaxial test along direction 1, the strain along direction 2 needs to be obtained by solving another expression {Sigma_2 = 0} which is again a function of material constants and strains obtained from experimental data. This expression is used to satisfy the condition that stress along direction 2 is equal to zero. Then the strain along direction 3 can be obtained by directly invoking the incompressibility codition, i.e, {stretch1 * stretch2 * stretch3 = 1}.
How to solve the above expression {Sigma_2 = 0} to obtain strain along direction 2 at each experimental strain value, while performing the optimization of material consants using the fmincon function?
Would there be any way to solve an additional function to obtain one of the variables in the objective function of fmincon, at each experimental data point, while the optimization is being performed?

 Accepted Answer

function cost = myobjective(x, Sigma_exp)
strain2 = calculate_strain2(x);
strain3 = calculate_strain3(x, strain2);
Sigma_model = calculate_model_values(x, strain2, strain3);
cost = sum((Sigma_model - Sigma_exp).^2);
end

9 Comments

Thank you for such a quick answer, @Walter Roberson!
As far as I understand, an anonymous function has to be created which contains:
  1. the expression to evaluate {Sigma2 = 0} to calculate strain2
  2. the expression to calculate strain3
  3. and the objective function to be minimized.
So, can I directly optimize the function "myobjective" using fmincon?
load Sigma_exp
objective = @(x) myobjective(x, Sigma_exp);
x0 = whatever
[bestx, fval] = fmincon(objective, x0);
So exactly one anonymous function.
the strain along direction 2 needs to be obtained by solving another expression
You were not specific about how that solving happens. If it is by using fzero() or fsolve(), then whether you need an anonymous function or not depends on what the calculation needs to be. Plausibly you do -- you need an anonymous function if you are passing in values as (temporarily) constant not to be optimized over.
Then the strain along direction 3 can be obtained by directly invoking the incompressibility codition
That doesn't sound like it needs another anonymous function.
Note: if you use shared variables you might not need anonymous functions at all.
Thank you very much for providing this explanation. It was extremely helpful.
The strain along direction 2 (say, strain2) has to be obtained by solving a nonlinear equation similar to Sigma_model, which also contains the set of material constants to be optimized. And as you mentioned, it is a constant temporarily and is not to be optimized.
I think I will need fslove() to solve the expression. So, I will try this by creating an anonymous function, as you have suggested.
Will get back with how it worked out. Thanks!
I am not sure what is happening with my code. But its not seem to be working. It is not proceeding to the fmincon function, and there is no error notification nor is anything returning from fmincon function.
This is the "MyUniObjective.m" file in which I am setting up the equations to obtain strain2 from Sigma2 = 0 [uniaxial load in direction 1] and strain1 from Sigma1 = 0 [uniaxial load in direction 2] and finally the objective function to be minimized 'min_obj'.
% Objective function to be minimized along with calculation of strain2 or 1
% from boundary condition of Sigma2 = 0 or Sigma1 = 0
function min_obj = MyUniObjective(x,xdata,xdatacirc,xdatalong,ydata)
eps_2 = CalculateStrain2(x,xdatacirc);
eps_1 = CalculateStrain1(x,xdatalong);
SigmaUniFunc = Calculate_Model_Values(x, eps_2, eps_1);
function eps_2 = CalculateStrain2(x,xdatacirc)
% Evaluating strain in direction 2 due to a uniaxial load in direction 1
eps_2 = fsolve(@(eps_2) ( 2.*x(1).*((1+abs(eps_2)).^2.*(x(5).*sqrt(x(2).*x(3)).*0.5.*((1+abs(xdatacirc)).^2-1) + x(3).*0.5.*((1+abs(eps_2)).^2-1) + x(6).*sqrt(x(3).*x(4)).*0.5.*((1+abs(xdatacirc)).^-2.*(1+abs(eps_2)).^-2-1)) - (1+abs(xdatacirc)).^-2.*(1+abs(eps_2)).^-2.*( x(7).*sqrt(x(4).*x(2)).*0.5.*((1+abs(xdatacirc)).^2-1) + x(6).*sqrt(x(3).*x(4)).*0.5.*((1+abs(eps_2)).^2-1) + x(4).* 0.5.*((1+abs(xdatacirc)).^-2.*(1+abs(eps_2)).^-2-1))).*exp(x(2).*0.25.*((1+xdatacirc).^2-1).^2 + x(3).*0.25.*((1+abs(eps_2)).^2-1).^2 + x(4).*0.25.*((1+abs(xdatacirc)).^-2.*(1+abs(eps_2)).^-2-1).^2 + 2.*x(5).*sqrt(x(2).*x(3)).*0.25.*((1+xdatacirc).^2-1).* ((1+abs(eps_2)).^2-1) + 2.*x(6).*sqrt(x(3).*x(4)).*0.25.*((1+abs(eps_2)).^2-1).* ((1+abs(xdatacirc)).^-2.*(1+abs(eps_2)).^-2-1) + 2.*x(7).*sqrt(x(4).*x(2)).*0.25.*((1+abs(xdatacirc)).^-2.*(1+abs(eps_2)).^-2-1).*((1+xdatacirc).^2-1)) ),0);
end
function eps_1 = CalculateStrain1(x,xdatalong)
% Evaluating strain in direction 1 due to a uniaxial load in direction 2
eps_1 = fsolve(@(eps_1) ( 2.*x(1).*((1+abs(eps_1)).^2.*(x(2).*0.5.*((1+abs(eps_1)).^2-1) + x(5).*sqrt(x(2).*x(3)).*0.5.*((1+abs(xdatalong)).^2-1) + x(7).*sqrt(x(4).*x(2)).*0.5.*((1+abs(eps_1)).^-2.*(1+abs(xdatalong)).^-2-1)) - (1+abs(eps_1)).^-2.*(1+abs(xdatalong)).^-2.*( x(7).*sqrt(x(4).*x(2)).*0.5.*((1+abs(eps_1)).^2-1) + x(6).*sqrt(x(3).*x(4)).*0.5.*((1+abs(xdatalong)).^2-1) + x(4).* 0.5.*((1+abs(eps_1)).^-2.*(1+abs(xdatalong)).^-2-1))).*exp(x(2).*0.25.*((1+eps_1).^2-1).^2 + x(3).*0.25.*((1+abs(xdatalong)).^2-1).^2 + x(4).*0.25.*((1+abs(eps_1)).^-2.*(1+abs(xdatalong)).^-2-1).^2 + 2.*x(5).*sqrt(x(2).*x(3)).*0.25.*((1+eps_1).^2-1).* ((1+abs(xdatalong)).^2-1) + 2.*x(6).*sqrt(x(3).*x(4)).*0.25.*((1+abs(xdatalong)).^2-1).* ((1+abs(eps_1)).^-2.*(1+abs(xdatalong)).^-2-1) + 2.*x(7).*sqrt(x(4).*x(2)).*0.25.*((1+abs(eps_1)).^-2.*(1+abs(xdatalong)).^-2-1).*((1+ eps_1).^2-1)) ),0);
end
function SigmaUniFunc = Calculate_Model_Values(x, eps_2, eps_1)
% Function containing uniaxial stress-strain relationships along circumferential and longitudinal directions differentiated from one another by logical indexing
SigmaUniFunc = ( ( 2.*x(1).*((1+abs(xdata)).^2.*(x(2).*0.5.*((1+abs(xdata)).^2-1) + x(5).*sqrt(x(2).*x(3)).*0.5.*((1+abs(eps_2)).^2-1) + x(7).*sqrt(x(4).*x(2)).*0.5.*((1+abs(xdata)).^-2.*(1+abs(eps_2)).^-2-1)) - (1+abs(xdata)).^-2.*(1+abs(eps_2)).^-2.*( x(7).*sqrt(x(4).*x(2)).*0.5.*((1+abs(xdata)).^2-1) + x(6).*sqrt(x(3).*x(4)).*0.5.*((1+abs(eps_2)).^2-1) + x(4).* 0.5.*((1+abs(xdata)).^-2.*(1+abs(eps_2)).^-2-1))).*exp(x(2).*0.25.*((1+xdata).^2-1).^2 + x(3).*0.25.*((1+abs(eps_2)).^2-1).^2 + x(4).*0.25.*((1+abs(xdata)).^-2.*(1+abs(eps_2)).^-2-1).^2 + 2.*x(5).*sqrt(x(2).*x(3)).*0.25.*((1+xdata).^2-1).* ((1+abs(eps_2)).^2-1) + 2.*x(6).*sqrt(x(3).*x(4)).*0.25.*((1+abs(eps_2)).^2-1).* ((1+abs(xdata)).^-2.*(1+abs(eps_2)).^-2-1) + 2.*x(7).*sqrt(x(4).*x(2)).*0.25.*((1+abs(xdata)).^-2.*(1+abs(eps_2)).^-2-1).*((1+xdata).^2-1)) ).*(xdata >= 0) + ( 2.*x(1).*((1+abs(xdata)).^2.*(x(5).*sqrt(x(2).*x(3)).*0.5.*((1+abs(eps_1)).^2-1) + x(3).*0.5.*((1+abs(xdata)).^2-1) + x(6).*sqrt(x(3).*x(4)).*0.5.*((1+abs(eps_1)).^-2.*(1+abs(xdata)).^-2-1)) - (1+abs(eps_1)).^-2.*(1+abs(xdata)).^-2.*( x(7).*sqrt(x(4).*x(2)).*0.5.*((1+abs(eps_1)).^2-1) + x(6).*sqrt(x(3).*x(4)).*0.5.*((1+abs(xdata)).^2-1) + x(4).* 0.5.*((1+abs(eps_1)).^-2.*(1+abs(xdata)).^-2-1))).*exp(x(2).*0.25.*((1+ eps_1).^2-1).^2 + x(3).*0.25.*((1+abs(xdata)).^2-1).^2 + x(4).*0.25.*((1+abs(eps_1)).^-2.*(1+abs(xdata)).^-2-1).^2 + 2.*x(5).*sqrt(x(2).*x(3)).*0.25.*((1+ eps_1).^2-1).* ((1+abs(xdata)).^2-1) + 2.*x(6).*sqrt(x(3).*x(4)).*0.25.*((1+abs(xdata)).^2-1).* ((1+abs(eps_1)).^-2.*(1+abs(xdata)).^-2-1) + 2.*x(7).*sqrt(x(4).*x(2)).*0.25.*((1+abs(eps_1)).^-2.*(1+abs(xdata)).^-2-1).*((1+ eps_1).^2-1)) ).*(xdata <= 0));
end
% Function to find the minimum of the residual between the experimental stress and predicted stress using the least-square method, i.e., minimizing the sum of square of the fitting error => min ( sum(Sig_Model - Sig_Exp)^2 )
min_obj = sum((SigmaUniFunc - ydata).^2);
end
In the main script file, I have defined fmincon for the optimization in this manner:
% Fit model to data starting with x0 by invoking the optimization routine.
A = [];
b = [];
Aeq = [];
beq = [];
lb = [0 0 0 0 0 0 0];
ub = [Inf Inf Inf Inf 1 1 1];
nonlcon = @(x) nonlinineqcon_Uni(x,Eeq1_circ,Eeq2_long);
options = optimoptions('fmincon','Display','iter','Algorithm','interior-point');
x0 = [20 10 3 5 0.4 0.8 0.3];
UniObjective = @(x) MyUniObjective(x,xdata,ydata);
x = fmincon(UniObjective,x0,A,b,Aeq,beq,lb,ub,nonlcon,options)
For some reason, this is not working. I am not able to find my mistake. Could you please assist me, @Walter Roberson. It would be a great help.
Thank you!
You have
function min_obj = MyUniObjective(x,xdata,xdatacirc,xdatalong,ydata)
but you are only passing in x,xdata,ydata without passing in xdatacirc, xdatalong
Note: it would be easier if we had your data to test with.
Thank you very much for responding. Please find the data which I am working with attached here (Book1.xlsx). It contains the experimental data in two directions x and y, which I have combined into one curve just for convenience during curve-fitting.
Because I need to determine one set of material constants for two equations, I have combined the data into one by keeping one directional data in negative and the other in the positive x-axis. Then, during curve-fitting, I use logical indexing to use the appropriate fitting equation for the respective data based on the positive or negative x-axis value.
Since I am not good regarding passing arguments, I think I am making some mistake, as you mentioned in your reply. Maybe I am not passing the required arguments or passing too many arguments.
One more thing, the xdatacirc and xdatalong are just x-axis experimental data which I later extracted from the combined xdata for plotting purpose. I do the following operation to get these two parameters:
% Separating stress-strain data of longitudinal and circumferential curves.
xdatalongfind = find(xdata <= 0);
xdatalong = xdata(xdata <= 0)*-1;
ydatalong = ydata(xdatalongfind);
xdatacircfind = find(xdata >= 0);
xdatacirc = xdata(xdata >= 0);
ydatacirc = ydata(xdatacircfind);
I am thinking these variables - xdatacirc and xdatalong would be useful for solving Sigma2 = 0 to get eps_2 (strain in direction 2) and for solving Sigma1 = 0 to get eps_1 (strain in direction 1).
Please note that Sigma1 and Sigma 2 are functions containing set of material constants (x) and the directional xdata from experiments.
Kindly forgive if my explanation is confusing.
Note: you could make that a bit more efficient with
xdatalongfind = find(xdata <= 0);
xdatalong = xdata(xdatalongfind)*-1;
ydatalong = ydata(xdatalongfind);
xdatacircfind = find(xdata >= 0);
xdatacirc = xdata(xdatacircfind);
ydatacirc = ydata(xdatacircfind);
but more efficient would be
xdatalongfind = (xdata <= 0);
xdatalong = -xdata(xdatalongfind);
ydatalong = ydata(xdatalongfind);
xdatacircfind = (xdata >= 0);
xdatacirc = xdata(xdatacircfind);
ydatacirc = ydata(xdatacircfind);
I notice that 0 exactly is included in both (if it occurs). If it were acceptable to include it in only one, you could
xdatalongfind = (xdata <= 0);
xdatalong = -xdata(xdatalongfind);
ydatalong = ydata(xdatalongfind);
xdatacircfind = ~xdatalongfind;
xdatacirc = xdata(xdatacircfind);
ydatacirc = ydata(xdatacircfind);
Hello Mr. @Walter Roberson! Thank you for this suggestion to improve the program. Actually, I need 0 in case of both the variables. So I have incorporated your first suggestion to my program. Thank you for your time!
Hello Mr. @Walter Roberson. I have made some progress with my program. I have used a rather old-school method to calculate strain2 and strain1 to satisfy Sigma2 and Sigma1 = 0, respectively. I used a while condition, by changing the value of strain, because I know the usual range of values of strains.
However, I am now facing another issue. I have different number of data points in the two directions. Hence, I am having trouble in defining my objective function. I am getting the error related to matrix dimensions not agreeing at the end.
Here is the function file:
% Objective function to be minimized along with calculation of strain2 or 1
% from boundary condition of Sigma2 = 0 or Sigma1 = 0
function [min_obj,eps_2,eps_1] = MyUniObjective_Primitive(x,xdatacirc,xdatalong,ydatacirc,ydatalong)
% In case of uniaxial loading in direction 1 (i.e., along circumferential direction), stretch/strain along direction 2 is unknown, and is determined by the boundary condition of Sigma2 = 0, stretch/strain along direction 3 is determined from the incompressibility condition.
eps_2 = zeros(numel(xdatacirc),1);
% In case of uniaxial loading in direction 2 (i.e., along longitudinal direction), stretch/strain along direction 1 is unknown, and is determined by the boundary condition of Sigma1 = 0, stretch/strain along direction 3 is determined from the incompressibility condition.
eps_1 = zeros(numel(xdatalong),1);
% Tolerance to check if stress2/1 is close to zero for a particular value of lambda2/1
tol = 1.0e-3;
% Function of Cauchy stress in direction 2 = 0 in case of uniaxial loading in direction 1
Sigma2Zero_Func = @(i,x,xdatacirc,eps_2) ( 2.*x(1).*((1+eps_2(i)).^2.*(x(5).*sqrt(x(2).*x(3)).*0.5.*((1+abs(xdatacirc(i))).^2-1) + x(3).*0.5.*((1+eps_2(i)).^2-1) + x(6).*sqrt(x(3).*x(4)).*0.5.*((1+abs(xdatacirc(i))).^-2.*(1+eps_2(i)).^-2-1)) - (1+abs(xdatacirc(i))).^-2.*(1+eps_2(i)).^-2.*( x(7).*sqrt(x(4).*x(2)).*0.5.*((1+abs(xdatacirc(i))).^2-1) + x(6).*sqrt(x(3).*x(4)).*0.5.*((1+eps_2(i)).^2-1) + x(4).* 0.5.*((1+abs(xdatacirc(i))).^-2.*(1+eps_2(i)).^-2-1))).*exp(x(2).*0.25.*((1+abs(xdatacirc(i))).^2-1).^2 + x(3).*0.25.*((1+eps_2(i)).^2-1).^2 + x(4).*0.25.*((1+abs(xdatacirc(i))).^-2.*(1+eps_2(i)).^-2-1).^2 + 2.*x(5).*sqrt(x(2).*x(3)).*0.25.*((1+abs(xdatacirc(i))).^2-1).* ((1+eps_2(i)).^2-1) + 2.*x(6).*sqrt(x(3).*x(4)).*0.25.*((1+eps_2(i)).^2-1).* ((1+abs(xdatacirc(i))).^-2.*(1+eps_2(i)).^-2-1) + 2.*x(7).*sqrt(x(4).*x(2)).*0.25.*((1+abs(xdatacirc(i))).^-2.*(1+eps_2(i)).^-2-1).*((1+abs(xdatacirc(i))).^2-1)) );
% Function of Cauchy stress in direction 1 = 0 in case of uniaxial loading in direction 2
Sigma1Zero_Func = @(i,x,xdatalong,eps_1) ( 2.*x(1).*((1+eps_1(i)).^2.*(x(2).*0.5.*((1+eps_1(i)).^2-1) + x(5).*sqrt(x(2).*x(3)).*0.5.*((1+abs(xdatalong(i))).^2-1) + x(7).*sqrt(x(4).*x(2)).*0.5.*((1+eps_1(i)).^-2.*((1+abs(xdatalong(i))).^-2-1))) - (1+eps_1(i)).^-2.*(1+abs(xdatalong(i))).^-2.*( x(7).*sqrt(x(4).*x(2)).*0.5.*((1+eps_1(i)).^2-1) + x(6).*sqrt(x(3).*x(4)).*0.5.*((1+abs(xdatalong(i))).^2-1) + x(4).* 0.5.*((1+eps_1(i)).^-2.*((1+abs(xdatalong(i))).^-2-1)))).*exp(x(2).*0.25.*((1+eps_1(i)).^2-1).^2 + x(3).*0.25.*((1+abs(xdatalong(i))).^2-1).^2 + x(4).*0.25.*((1+eps_1(i)).^-2.*(1+abs(xdatalong(i))).^-2-1).^2 + 2.*x(5).*sqrt(x(2).*x(3)).*0.25.*((1+eps_1(i)).^2-1).*((1+abs(xdatalong(i))).^2-1) + 2.*x(6).*sqrt(x(3).*x(4)).*0.25.*((1+abs(xdatalong(i))).^2-1).*((1+eps_1(i)).^-2.*(1+abs(xdatalong(i))).^-2-1) + 2.*x(7).*sqrt(x(4).*x(2)).*0.25.*((1+eps_1(i)).^-2.*(1+abs(xdatalong(i))).^-2-1).*((1+eps_1(i)).^2-1)) );
% Evaluating strain in direction 2 due to a uniaxial load in direction 1
for i = 1:numel(xdatacirc)
Sigma2Zero_i = Sigma2Zero_Func(i,x,xdatacirc,eps_2);
while Sigma2Zero_i > tol
eps_2(i) = eps_2(i) - 0.0001;
Sigma2Zero_i = Sigma2Zero_Func(i,x,xdatacirc,eps_2);
end
eps_2(i) = eps_2(i);
end
% Evaluating strain in direction 1 due to a uniaxial load in direction 2
for i = 1:numel(xdatalong)
Sigma1Zero_i = Sigma1Zero_Func(i,x,xdatalong,eps_1);
while Sigma1Zero_i > tol
eps_1(i) = eps_1(i) - 0.0001;
Sigma1Zero_i = Sigma1Zero_Func(i,x,xdatalong,eps_1);
end
eps_1(i) = eps_1(i);
end
% Cauchy stress expression in circumferential direction [Sigma11]
OrthoUni_Sigma1 = @(x,xdatacirc,eps_2) ( 2.*x(1).*((1+abs(xdatacirc)).^2.*(x(2).*0.5.*((1+abs(xdatacirc)).^2-1) + x(5).*sqrt(x(2).*x(3)).*0.5.*((1+eps_2).^2-1) + x(7).*sqrt(x(4).*x(2)).*0.5.*((1+abs(xdatacirc)).^-2.*(1+eps_2).^-2-1)) - (1+abs(xdatacirc)).^-2.*(1+eps_2).^-2.*( x(7).*sqrt(x(4).*x(2)).*0.5.*((1+abs(xdatacirc)).^2-1) + x(6).*sqrt(x(3).*x(4)).*0.5.*((1+eps_2).^2-1) + x(4).* 0.5.*((1+abs(xdatacirc)).^-2.*(1+eps_2).^-2-1))).*exp(x(2).*0.25.*((1+abs(xdatacirc)).^2-1).^2 + x(3).*0.25.*((1+eps_2).^2-1).^2 + x(4).*0.25.*((1+abs(xdatacirc)).^-2.*(1+eps_2).^-2-1).^2 + 2.*x(5).*sqrt(x(2).*x(3)).*0.25.*((1+abs(xdatacirc)).^2-1).* ((1+eps_2).^2-1) + 2.*x(6).*sqrt(x(3).*x(4)).*0.25.*((1+eps_2).^2-1).* ((1+abs(xdatacirc)).^-2.*(1+eps_2).^-2-1) + 2.*x(7).*sqrt(x(4).*x(2)).*0.25.*((1+abs(xdatacirc)).^-2.*(1+eps_2).^-2-1).*((1+abs(xdatacirc)).^2-1)) );
% Cauchy stress expression in longitudinal direction [Sigma22]
OrthoUni_Sigma2 = @(x,xdatalong,eps_1) ( 2.*x(1).*((1+abs(xdatalong)).^2.*(x(5).*sqrt(x(2).*x(3)).*0.5.*((1+eps_1).^2-1) + x(3).*0.5.*((1+abs(xdatalong)).^2-1) + x(6).*sqrt(x(3).*x(4)).*0.5.*((1+eps_1).^-2.*(1+abs(xdatalong)).^-2-1)) - (1+eps_1).^-2.*(1+abs(xdatalong)).^-2.*( x(7).*sqrt(x(4).*x(2)).*0.5.*((1+eps_1).^2-1) + x(6).*sqrt(x(3).*x(4)).*0.5.*((1+abs(xdatalong)).^2-1) + x(4).* 0.5.*((1+eps_1).^-2.*(1+abs(xdatalong)).^-2-1))).*exp(x(2).*0.25.*((1+eps_1).^2-1).^2 + x(3).*0.25.*((1+abs(xdatalong)).^2-1).^2 + x(4).*0.25.*((1+eps_1).^-2.*(1+abs(xdatalong)).^-2-1).^2 + 2.*x(5).*sqrt(x(2).*x(3)).*0.25.*((1+eps_1).^2-1).* ((1+abs(xdatalong)).^2-1) + 2.*x(6).*sqrt(x(3).*x(4)).*0.25.*((1+abs(xdatalong)).^2-1).* ((1+eps_1).^-2.*(1+abs(xdatalong)).^-2-1) + 2.*x(7).*sqrt(x(4).*x(2)).*0.25.*((1+eps_1).^-2.*(1+abs(xdatalong)).^-2-1).*((1+eps_1).^2-1)) );
% Function to find the minimum of the residual between the experimental stress and predicted stress using the least-square method, i.e., minimizing the sum of square of the fitting error => min ( sum(Sig_Model - Sig_Exp)^2 )
min_obj = sum((OrthoUni_Sigma1(x,xdatacirc,eps_2) - ydatacirc).^2 + (OrthoUni_Sigma2(x,xdatalong,eps_1) - ydatalong).^2);
end
I tried to use two functions along two directions [OrthoUni_Sigma1 and OrthoUni_Sigma2]. Then, at the end I need to minimize the error in a least square sense. I am thinking like this:
min { sum( (Sigma_model,1 - Sigma_exp,1)^2 + (Sigma_model,2 - Sigma_exp,2)^2 ) }
But I am facing the error related to matrix dimensions not matching in the objective function. Is there any way to solve this issue. Something I can modify in the objective function, in case of different number of data points?
Pardon me for bothering you again and again!
Kindly reply in your free time. Thank you.

Sign in to comment.

More Answers (0)

Categories

Find more on Stress and Strain 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!