Hi, Maple community
I am trying to integrate a 3D data numerical set. I managed to execute an array interpolation algorithm and apply it to plot a smooth surface but I do not know how to integrate it numerically. I want to be able to integrate the data not only in its domain but also in sub-domains for multiple purposes.
I've found here a topic about it and tried to apply suggestions made with no success.
Here I copy the worksheet steps:
Nx:=8; Points in the x direction
Nz:=6; Points in the z direction
Lx:=3; This means x goes from 0 to 3
Lz:=2; This means z goes from 0 to 2
DataPn:=Matrix(Nx,Nz,0): Matrix to store values in the 3rd direction
The following step is a function that I used to simulate data that I will later on will get by measurings.
for i from 1 to Nx do
for j from 1 to Nz do
Setting data to use ArrayInterpolation
In this step here, I don't really understand what this argument [[a],[b]] means but ArrayInterpolation cannot work without it.
MI:=(a,b)->ArrayInterpolation([datax, dataz],Array(DataPn),[[a],[b]],'method' = 'spline')[1,1];
Plot and display the interpolation and the real function to compare the quality of the interpolation, actually it does an excellent job, at least with this data.
G1:=plot3d(MI, datax..datax[Nx], dataz..dataz[Nz],labels=[x,z,Pn]);
And finally I found this integration method here in mapleprimes
evalf(Int(x->evalf(Int( y->MI(x,y), 0..3,method=_d01akc)),0..2,method=_d01akc));
And the result is 1.102279199. I thought maybe I was setting wrongly the integration limits or the order in the command but in any case the result was near the analytic case which was:
In this scenario I know the result is wrong because I can compute the exact solution, but later on I won't be able to do so. Also, later I'm interested in the integration, let's say, x from 0..0.5 and later from 0.5..1 and so on (keeping z always from 0 to 2) So, the main questions are:
1. Am I setting something wrong?
2. If I delete the method option in the integral, it takes a lot of time for the program to compute any result. Why?
3. Is there any other way to integrate this? I mean, any other way to write the command to compute the integral.
4. What does the [[a],[b]] argument stands for in ArrayInterpolation?
Regards and thanks for your help.