# Help fitting and selecting data?

Posted 2 months ago
504 Views
|
7 Replies
|
3 Total Likes
|
 Kindly find the data:https://drive.google.com/file/d/1Zw_GBnhFYbEglEKzTXnCv4o5xEMMT9n1/view?usp=sharingI want to fit my data. After using drop and select, I am getting blank {}. I want to fit my data of XZ Plane and potential. Kindly help, as soon as possible
7 Replies
Sort By:
Posted 2 months ago
 Add whatever filtering on values you want (* In DataxzStein, x is column 1 and z is column 2 *) DataxzSteinSubset = Select[DataxzStein, Between[#[[1]], {-0.32, 0.32}] && Between[#[[2]], {-0.22, 0.22}] &] MinMax /@ Transpose@DataxzSteinSubset (* {{-0.315, 0.315}, {-0.215, 0.215}, {0.447852, 0.889891}} *) Use DataxzSteinSubset to fit.
Posted 2 months ago
 I mean to say. I want to command Mathematica that Please select data points with a range from ( -0.32 to +0.32) for x column(1st), a range from ( -0.22 to +0.22) for z column (3rd) along with its corresponding potential data in the 4th columns. Then I will use those data points for fitting.
Posted 2 months ago
 Something like this? (* MinMax for x, y, z, p *) MinMax /@ Transpose@DataxyzStein (* {{-0.495, 0.495}, {-0.495, 0.495}, {-0.305, 0.305}, {0.299106, 0.998006}} *) (* Select positive x values *) DataxzSteinPosX = Select[DataxzStein, #[[1]] >= 0 &] MinMax /@ Transpose@DataxzSteinPosX (* {{0.005, 0.495}, {-0.305, 0.305}, {0.302262, 0.998001}} *)
Posted 2 months ago
 Hi Rohit,Thank you so much for your time and consideration. But let's say I want to extract a specific range of data from my column data points for fitting; how to do that?Sorry for the silly question. For a beginner, I am struggling to learn. It would be helpful if you answer this. Regards, Soumyaranjan
Posted 2 months ago
 Extract columns 1, 3, 4 DataxzStein = DataxyzStein[[All, {1, 3, 4}]] FittXZStein = NonlinearModelFit[ DataxzStein, {ModelxzStein}, {Subscript[T, 0], Subscript[T, 2], Subscript[T, 4], Subscript[T, 6], Subscript[T, 8], Subscript[T, 10]}, {x, z}] FittXZStein["RSquared"] (* 0.9845 *) FittXZStein["ParameterTable"]