How can I fit 3-D scatter points with value?

1 回表示 (過去 30 日間)
Zihao Huang
Zihao Huang 2020 年 8 月 7 日
編集済み: Abdolkarim Mohammadi 2020 年 8 月 8 日
Hi,
I have an output file from a fluent simulation. The output file contains the coordinates of each of the nodes and the pressure value of each node. In other words, each point has its coordinate (theta, r, z) and its pressure value p. Is there a way I could fit these scatter points and output an expression p(theta,r,z)?
Thank you,
Joseph

採用された回答

Abdolkarim Mohammadi
Abdolkarim Mohammadi 2020 年 8 月 7 日
編集済み: Abdolkarim Mohammadi 2020 年 8 月 7 日
If your model for the relationship between (theta, r, z) triplets and the pressure is linear, use regress. Otherwise, use lsqcurvefit or nlinfit. You cannot use the curve fitting app (cftool) because it only supports up to two independent variables.
  4 件のコメント
Zihao Huang
Zihao Huang 2020 年 8 月 7 日
Thank you for your clarification. In my dataset, I have only 3 sets of thetas, do you think I can maybe fit the surface (r,z,p) for a theta, and then move on to get all three equations, and find out the relationship between them? I tried cftool on (r,z,p) in theta 1, and it fits well using cubic interpolant method. However, I don't know how to export the function of that surface. Can you help me with this?
Abdolkarim Mohammadi
Abdolkarim Mohammadi 2020 年 8 月 7 日
編集済み: Abdolkarim Mohammadi 2020 年 8 月 8 日
(1) When you split apart values of theta, you are treating it as a moderator variable. In other words, you are assuming that theta does not directly affect pressure; it is just affecting the model (r,z)=>p. This is in contrast with the assumption of the direct effect of theta in the model (r,p,theta)=>p.
(2) As I mentioned in my previous comment, interpolation does not produce equation. It just interpolates between your data points to fill the gaps between datapoints. For example, if you have only two data points of (x=0,y=0) and (x=1,y=2) then you create interpolation and evaluate the interpolation at x=0.5, then it returns y=1, which is the intermediate between your points.
(3) You should not judge the quality of interpolation models based on . Any type of interpolation will always lead to . It's because they do not produce error at datapoints.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLinear and Nonlinear Regression についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by