Message Boards Message Boards

Fit an experimental data curve?

Posted 7 years ago

Hello everybody,

I am trying to fit a model based on experimental data by using Mathematica 11.0.

My analytical model is generally expressed as: Mu = F(V,T).

The experimental data are shown as below; as you see a set of (Mu,v) data at some special values T.

Mu .......................... v .......................... T

0.10            100             20
0.12            120             20
0.15            140             20
0.18            160             20
0.24            180             20
0.37            200             20

0.30            100             40
0.35            120             40
0.38            140             40
0.42            160             40
0.48            180             40
0.54            200             40

0.60            100             60
0.63            120             60
0.68            140             60
0.72            160             60
0.78            180             60
0.84            200             60

In this case, may somebody has any experience for such this kind of curve fitting in Mathematica?

I would be pleased to share or just let me know which Keyword is corresponded in Mathematica.

Thanks in advance,

POSTED BY: Hassan Giashi
5 Replies
Posted 7 years ago

You might consider some of the following:

data = {{100, 20, 0.1}, {120, 20, 0.12}, {140, 20, 0.15}, {160, 20, 0.18}, {180, 20, 0.24},
   {200, 20, 0.37}, {100, 40, 0.3}, {120, 40, 0.35}, {140, 40, 0.38}, {160, 40, 0.42},
   {180, 40, 0.48}, {200, 40, 0.54}, {100, 60, 0.6}, {120, 60, 0.63}, {140, 60, 0.68},
   {160, 60, 0.72}, {180, 60, 0.78}, {200, 60, 0.84}};

(* Plot the data *)
ListPlot[{data[[{1, 2, 3, 4, 5, 6}, {1, 3}]],
  data[[{7, 8, 9, 10, 11, 12}, {1, 3}]],
  data[[{13, 14, 15, 16, 17, 18}, {1, 3}]]},
 Frame -> True, FrameLabel -> {"v", "mu"},
 PlotLegends -> {"T = 20", "T = 40", "T = 60"}]

(* Fit linear model *)
lm = LinearModelFit[data, {v, t, v *t, v^2, t^2}, {v, t}]

(* Show ANOVA table *)
lm["ANOVATable"]

(* Plot residuals *)
ListPlot[Transpose[{lm["PredictedResponse"], lm["FitResiduals"]}],
 Frame -> True, FrameLabel -> {"Predicted", "Residual"}]

resulting in the following output:

ANOVA output

POSTED BY: Jim Baldwin

Dear Jim,

Actually, I am still beginner in Mathematica. your notes are helpful to me.

In the meantime, I found also some hints by ''Multivariate fitting'' Option in Mathematica help.

I'll follow and hope they can work for my real experimental data ,

Greetings,

Hassan

POSTED BY: Hassan Giashi

Hello Jim,

thanks a lot for your help and notes. it is finally working . ;)

I am not still very experienced in this area and maybe you could please help me for some short questions as below:

  1. what does mean DF SS MS when I use nlm ["ANOVATable"] .I tried to find relevant information in Mathematica tutorial. May you please share any data or let me know from where I can understand these issues?

  2. I used an analytical model for my curve fitting as: model = (A + B x^n) (1 + C(Log[y] - k))* and after that I could find the variables (A,B,n,C,D**).

    Now, I want to evaluate the accuracy of my fitting process. in this case:

2-1. When I use nlm ["SinglePredictionConfidenceIntervalTable"] the difference between Observed and Predicted are very small and the corresponding Standard Error is also very small, around 1 even though smaller. Also, there is a good agreement between Experimental data and predicted values. In this point of view, the fitting process seems fine. Isn't it?

2-2. When I use nlm ["ParameterTable"] then the Standard Error relating the variables (A,B,n,C,D) are very high around 10e8. In this point of view, the fitting process seems not good.

I am confused of these tow different issues of Standard Error in items 2-1 and 2-2.

May I ask you please let me know if you have already and previous experience concerning to this issue.

Thanks in advance, Hassan

POSTED BY: Hassan Giashi

Have you looked at the function Fit? Where is your code? What did you try?

POSTED BY: Sander Huisman

Dear Sander,

I think the best one is ''Multivariate fitting'' .

POSTED BY: Hassan Giashi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract