Group Abstract Group Abstract

Message Boards Message Boards

0
|
1.9K Views
|
5 Replies
|
3 Total Likes
View groups...
Share
Share this post:

How to derive an equation with 2 input parameters for data using FindFit?

Posted 1 year ago
POSTED BY: Greg Callaghan
5 Replies

@Henrik - thanks very very much! This tool is quite amazing.

Is there a way to get it to display the full formula with parameters replaced with values? I'm noting if I just type Params-Return I can get these. [I keep looking]. Thanks again

POSTED BY: Greg Callaghan
POSTED BY: Henrik Schachner

ok got it thanks. If I wanted to make it a little more accurate around the low fuel end, would I effectively be able to do this by say (a) doing a few more measurements around this end [e.g. a few more measurements at different tilt angles in the 1L to 3L area], and (b) maybe drop down the number of points at the higher end [e.g. say do 7/9/11/13L, instead of 7/8/9/10/11/12/13] ?

POSTED BY: Greg Callaghan

Well, for me hard to tell. Maybe anyone else has more experience with data fitting. More data in combination with a better model would certainly help. And I would repeat some measurements to get an idea about their general accuracy before making an elaborated model.

POSTED BY: Henrik Schachner

Can mathematic derive best equation to use, ...

No, I am afraid, you have to try with some general expression or with some clever assumptions. Here is a first attempt. Let data be your data, then:

{{xmin, xmax}, {ymin, ymax}} = Most[MinMax /@ Transpose[data]];
(* assumed simple model: *)
model = (a0 + a1 x + a2 x^2 + a3 x^3) + (b0 + b1 y + b2 y^2);
(* calculation of the parameters: *)
params = FindFit[data, model, {a0, a1, a2, a3, b0, b1, b2}, {x, y}];
(* plot of the data: *)
gr = Graphics3D[{PointSize[Large], Point[data]}];
(* plot of the model using the calculated parameters: *)
p3D = Plot3D @@ {model /. params, {x, xmin, xmax}, {y, ymin, ymax}};
(* showing both in the same graphic: *)
Show[p3D, gr]

enter image description here

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