|
"John D'Errico" <woodchips@rochester.rr.com> wrote in message <ir9538$9td$1@newscl01ah.mathworks.com>...
> "Nic Roberts" wrote in message <iqlrke$oul$1@newscl01ah.mathworks.com>...
> > Hi
> > I am using lsqcurvefit to model an exponential like curve that starts at (0,0). My problem is that when I plot the lsq-fitted function I notice that it doiesnt start at (0,0).
> >
> > Is there a way of making this a necessary condition of the curve fit?
>
>
> Yes, there often is, but in order to help you more, we need
> to know more about your model.
>
> For example, is there a constant term in it? What is the exact
> form of the model?
>
> John
Hi John,
Its a model of the biaxial stress-strain behavour of a fibre embedded hyper elastic membrane. I have two stress-strain curves for the stress response of the membrane in the two directions of interest (lets call them x and y) and am trying to fit an exponetial like function to the curves.
options=optimset('MaxFunEvals',1e6,'MaxIter',1e6,'TolFun',1e-25,'TolX',1e-20);
xdata=[c_stretch r_stretch];
ydata=[c_stress r_stress]/0.5e-3;
x0=[10; 10; 10; 10; 10; 10];
[x,resnorm]=lsqcurvefit(@Constit,x0,xdata,ydata,[],[],options)
function Ein=Constit(x,xdata)
F_11=xdata(:,1); % x direction
F_22=xdata(:,2); % y direction
p=x(1)+x(2)*(F_11.^2+F_22.^2);
% Stress due to embedding substance
Moon11=x(1)+x(2)*(F_22.^2+1/(F_11.^2*F_22.^2));
Moon22=x(1)+x(2)*(F_11.^2+1/(F_11.^2*F_22.^2));
% Stress due to fibre stretch
Walpha=x(3)*x(4)*exp((x(4)/2)*(F_11.^2-1));
Wbeta=x(5)*x(6)*exp((x(6)/2)*(F_22.^2-1));
% Lagrangian multiplier to enforce incompressiblity
p=x(1)+x(2)*(F_11.^2+F_22.^2);
% Total directional stress
S11x=Moon11+Walpha-p;
S22x(i)=Moon22+Wbeta-p;
Ein=[S11x S22x];
Does this help?
Nic
|