help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Integrating a Circular Shaped Loop in a Vector Field


From: Juan Pablo Carbajal
Subject: Re: Integrating a Circular Shaped Loop in a Vector Field
Date: Sat, 14 Dec 2013 12:53:11 +0100

On Sat, Dec 14, 2013 at 12:46 PM, Juan Pablo Carbajal
<address@hidden> wrote:
> On Sat, Dec 14, 2013 at 1:16 AM, astaton <address@hidden> wrote:
>> Sir..sorry for not quickly responding,
>>
>> It is a line integral in the shape of a circle circumference.
>>
>> I found the below code snippet that uses the trapz function to numerically
>> integrate a vector:
>>
>> x=0:pi/357:pi;
>> y=??????
>> area=pi/357*trapz(y);
>>
>> The problem is I do not have a function to integrate..per say.  It is a
>> vector field of 3 dimensions with only values and no function.
>>
>> I suppose I could simplify and only integrate the 'z' component?  Maybe
>> B_field= |Z|*sin (theta)?  That creates another problem because I still need
>> to vary the circle radius?
>>
>> Any help is still greatly appreciated.
>>
>> -AS
>>
>>
>>
>> --
>> View this message in context: 
>> http://octave.1599824.n4.nabble.com/Integrating-a-Circular-Shaped-Loop-in-a-Vector-Field-tp4660038p4660058.html
>> Sent from the Octave - General mailing list archive at Nabble.com.
>> _______________________________________________
>> Help-octave mailing list
>> address@hidden
>> https://mailman.cae.wisc.edu/listinfo/help-octave
>
> I understand then that you vector field is data based and you do not
> know its mathematical formulation.
> Question:
> a. Is your vector sampled on a uniform 3d mesh?
>
> If yes, can:
> 1. Interpolate the vector field to get values that lay in your curve,
> e.g. using trilinear interpolation[1] (I have tried to use interp3
> many times, but it isn't that useful), that is find the cube that
> encloses each point on your curve and interpolate the vector to that
> point.
> 2. Calculate the nodal dot product between interpolated vector field
> and tangent of your curve, this gives you samples of a scalar
> function: the integrand.
> 3. Parametrize your curve with the length of arc in [0,1].
> 4. Find the interpolating polynomial for the integrand, e.g. using
> interp1 or data2fun in signal package.
> 5. Use any scalar integration formula to find the integral along your
> curve, e.g. *quad or trpz or whatever.
>
> The validity of this approach is highly dependent on the nature of
> your vector field and your curve, if everything is smooth or at least
> continuous, I think the results should be reasonably good. Do check it
> against an exact result (i.e. write your own mathematical toy problem
> and solve it exactly).
>
> [1] http://en.wikipedia.org/wiki/Trilinear_interpolation

Oh, you can also think of your vector field as the result of a FEM
simulation and use all available tools to calculate line integral s on
the solution. Check FEMM, Fenics, etc...


reply via email to

[Prev in Thread] Current Thread [Next in Thread]