Group Abstract Group Abstract

Message Boards Message Boards

0
|
7.1K Views
|
11 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Calculate the derivative from experimental data?

Posted 3 years ago
POSTED BY: nahal ghanadi
11 Replies

Here is how I would transform your data into cylindrical coordinates:

dataForInterpolate = 
  yourData /. {x_, y_, z_} :> 
    With[{theta = ArcTan[x, y]}, {{Cos[theta], Sin[theta]}, z}];

You could also use CoordinateTransform[.....]

I am not familar with the Polar Spectrum graph.

POSTED BY: W. Craig Carter
POSTED BY: W. Craig Carter
Posted 3 years ago
POSTED BY: nahal ghanadi

Your data is a bit noisy which is normal for experimental data:

yourData = Import["~/tmp/ASmappa-niccolini90-0.dat", "TSV"];

you will want to use your path to your data.

dataForInterpolate = yourData /. {x_, y_, z_} :> {{x, y}, z};

zInterpolation = Interpolation@dataForInterpolate

Interpolate complains that your data is not on a regular (i.e., rectangular grid) so it reduces the order of interpolation.

Plot3D[zInterpolation[x, y], {x, 0.005, 5}, {y, 0, 3.95`}]

That means that your first-order derivatives will be extra noisy. However, we can proceed:

dzdxInterpolation = Derivative[1, 0][zInterpolation]
dzdyInterpolation = Derivative[0, 1][zInterpolation]

NIntegrate[
 Sqrt[1 + dzdxInterpolation[x, y]^2 + dzdyInterpolation[x, y]^2], {x, 
  0.005, 5}, {y, 0, , 3.95`}]

Complains that convergences is slow. This is likely from your derivatives. Integrate prints a result and an error estimate.

Possible fixes are to resample your data onto a regular grid, smooth a bit, and use Splines to approximate your data.

POSTED BY: W. Craig Carter
exampleData = Flatten[Table[{{x, y}, f {x, y}}, {x, 0, 1, .01}, {y, 0, 1, .01}], 1]

Has a syntax error f{x,y} should be f[x,y] if f is a function that takes two arguments. I will check your data sometime later.

POSTED BY: W. Craig Carter
Posted 3 years ago

I am so grateful for your time and help. I applied your method to my calculations, but there is an error! I will attach the link for downloading my full data. Can you please check the example data in this case? Thank you so much in advance

exampleData = Flatten[Table[{{x, y}, f {x, y}}, {x, 0, 1, .01}, {y, 0, 1, .01}], 1] 

https://drive.google.com/file/d/1t0ZWf6BdzatNFC9DIr4yqulEz6c2fCe8/view?usp=sharing

POSTED BY: nahal ghanadi
Posted 3 years ago

Thank you so much for your help. I am developing a platform based on the data that I have to calculate some surface parameters. so I don't have a specific number for A and Ar. that is why I used dimx and dimy to limit the surface as desired. the data file was not readable in here so you can download it from the following link. I appreciate your help in advance. enter link description here

POSTED BY: nahal ghanadi

Use the following code to construct $f$ from you data.

f[data_] := Interpolation(data, Method -> "RBF");

If you post your data together with $A$ and $A_R$ (i.e. the domain of integration), then I can show you a complete code on how to evaluate your formula numerically using NIntegrate.

POSTED BY: Ta'a Nwa Dombou

Click on the link which is in my post and It will bring you to the Wiki page on RBF interpolation. I

POSTED BY: Ta'a Nwa Dombou
Posted 3 years ago

Can I kindly ask you what is the code for RBF? I can't find something good to transform z to f(x,y).

POSTED BY: nahal ghanadi

You must first reconstruct the surface $z = f(x,y)$. One way to do it is via Radial Basis Function (RBF) interpolation. One you are satisfied with your interpolation, use it in the double integral. You may use NIntegrate to evaluate the integral.

POSTED BY: Ta'a Nwa Dombou
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard