Path Integral from n*n array

I have an n * n array, which represents a scalar field. I wish to determine the path(line?) integral of a closed path around the centre of the array.
I think the values of the field change by angle rather than distance, so the distance from the centre of the array at which the closed path is measured should not be important, but I would like to confirm this too.
I have a number of questions
1) Must the path be "smooth"? Does it need to be a circle of radius (1/2n(*some fraction)) if the area of the path is critical which I need to determine) centred on the array
Or
2) Can I just sum the perimeter values of the array - i.e. the path is a square.
3) Is there a matlab function for this, or do I need to manually tell matlab which values of the array to sum?
4) Is this the correct methodology for a line integral (I have never calculated such a thing before)
thanks a lot!

7 个评论

Hi William,
For a scalar field there are two possible ways to do the path integral. For each small step dl along the path, the first way sums up [scalar times dl], keeping track of the vector nature of dl. The second way simply sums up [scalar times length of dl] for each step. I believe in all cases the answer does depend on the path taken from point a to point b, with one exception: the first way, when the scalar field is constant everywhere. Then the integration is independent of path and proportional to the vector displacement b - a, and the integral around a closed loop = 0. But that case is not very interesting.
Hi David, thanks for the response, and sorry for the delay. I have two analytical forms for a two-dimensional displacement.
Ux and Uy
Where Ux is the scalar displacement in the x-direction and Uy is the scalar displacement in the y-direction
So, when I calculate the displacements, I have two separate arrays, Ux and Uy which are the displacements Ux and Uy at every point.
In this case I assume I do not need to keep track of the vector nature of dl? Because in an array, dl is the same?
I was assuming I just add up the "perimeter" of each array which will give the total displacments Ux_total and Uy_total and the displacment is the vector sum of these totals?
Is this correct thinking?
kind regards William
Hi William,
Now you have a two-component vector field, which changes the story considerably. For some fields it is possible for the line integral to be independent of path. However, you say that Ux and Uy represent displacement. Do these mean small displacements at every point, compared to their initial positions, as in the theory of elasticity? In that case it does not appear to be very useful to do line integrals.
Hi David, Well observed, yes, this is about elasticity in a solid.
Particularly, the displacement due to an edge dislocation (an extra half-plane of atoms). In two dimensions (for simplicity), if the dislocation is at the origin, there is a displacment in all space around the origin given:
ux = (b./(2.*pi)).*((atan2(y,x))+((x.*y)./(2.*(1-nu) .* (x.^2+y.^2))));
uy = -(b./(2.*pi)).*(((((1-(2.*nu))./(4.*(1-nu))).*(log(x.^2 + y.^2)))+((x.^2-y.^2)./(4.*(1-nu).*(x.^2+y.^2)))));
where ux is the x displacement and uy is the y displacment
where b and nu are material parameters (typical values 0.25nm and 0.3 respectively).
Far from the origin, I expect the total displacement around the origin, to be equal to b.
So, if I set up a meshgrid, I get two arrays ux and uy which are the displacments at all points in space in the material.
With this in mind, I am wondering how to get the line integral around the origin? I was thinking I could just sum the "perimeter" of the arrays?
kind regards, and thanks for your patience William
Hi William,
It's true that you can do an integral on a path around the origin to find the net displacement, but not with these functions. The ux and uy functions here are the results after the integration has been done. With b = 1, nu (almost) arbitrary, the values for ux are
just above neg x axis 1/2
just below neg x axis -1/2
just above pos x axis small
just below pos x axis -small
so the net displacement is b on the negative x axis and 0 on the positive x axis.
To do this by integration you will need expressions for the the derivatives of ux and uy, called the distortion tensor.
Hi David, Thanks for that...You have jumped a few steps (or so it seems). I have a few questions if you don't mind...
1) These functions are for displacements, so why cannot I get the net displacement? I dont understand why the integration (summation) has already been done?
2) How did you come by those results?
3) I was under the impression that the total displacement at a point was the vector sum of the Ux and Uy displacements at that point?
4) The crux is, I have different formulae (from the literature) which appear to give different solutions (displacement fields); and I figured a sure-fire way to confirm the validity was to take a path around the origin, which, if correct, would equal b?
kind regards W
Hi William, Since this is not a Matlab topic this website is not the right forum, but if you want to discuss further feel free to contract me via my profile.

请先登录,再进行评论。

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by