From: Alice on
Hello,

I am trying to calculate the magnetic flux though a surface.

I have interpolated a curve through 4 data points using

cscvn
plot is here:
http://imgur.com/qqGxh.png
The black filled points on this plot is data.
The blue curve is from cscvn.
I then returned this curve fit as an array of points, which I use to interpolate a surface.
The open black points are those returned from cscvn.
The surface is then a fit with fittype of cubic interpolation from the open black points.

What I want to do is integrate a vector field through this surface bounded by the curve. I know the vector field analytically.
I guess this has to be done numerically, but cannot think of a way to get say a array/matrix of points or normals to the surface within the boundary curve.
Does anyone have any suggestions on the best way to do it?

Alternatively, I did a surface fit with fittype polynomial of order 3 in x and 3 in y
Plot is here:
http://imgur.com/Byn00.png
The advantage of this is it returns an analytical form on the surface, which might make it easier to do the vector field integral across.
However it does have the problem that I cannot get an analytical form of the spline that defines the boundary. So for this reason I was thinking the first method is best?

I am quite inexperienced with Matlab, and really quite stuck.
Any pointers towards suitable algorithms or functions would be greatly appreciated.

Thanks
Alice
From: Bruno Luong on
"Alice " <a.lynch(a)physics.ox.ac.uk> wrote in message <i1knu0$426$1(a)fred.mathworks.com>...
> Hello,
>
> I am trying to calculate the magnetic flux though a surface.
>
> I have interpolated a curve through 4 data points using
>
> cscvn
> plot is here:
> http://imgur.com/qqGxh.png
> The black filled points on this plot is data.
> The blue curve is from cscvn.
> I then returned this curve fit as an array of points, which I use to interpolate a surface.
> The open black points are those returned from cscvn.
> The surface is then a fit with fittype of cubic interpolation from the open black points.
>
> What I want to do is integrate a vector field through this surface bounded by the curve. I know the vector field analytically.
> I guess this has to be done numerically, but cannot think of a way to get say a array/matrix of points or normals to the surface within the boundary curve.
> Does anyone have any suggestions on the best way to do it?
>

I assume the magnetic field is divergence free. Because of that, integrating on any surface that contains the curve leads to same result. You could use delaunay triangulation in the (x,y) plane, linear map each triangle to the corresponding z elevation, then compute the flux on each triangle (the normal is well defined), then sum them. This approximates the curve by a polygon, and you can select the number of points on the spline fine enough to have a good approximation of the final flux.

Bruno