Draghilev method revisited

Draghilev method revisited - Mensajes

#61 Publicado: 26/3/2019 9:48:28
Alvaro

Alvaro

1.139 me gusta en 1.805 mensajes.

Grupo: User

Wrote

Refined the algorithm and added examples



Hi. This solver is great, it's very stable and works in cases where I can't figure how it do things right. In the attached, I just clean the code a little, but the application it's entirely the same.

DistMod 2.sm (47,99 KiB) descargado 1717 vez(es).
DistMod 2.pdf (167,91 KiB) descargado 1002 vez(es).

Best regards.
Alvaro.
A 2 usuarios les gustó este mensaje
NDTM Amarasekera 26/3/2019 12:54:00, Fridel Selitsky 26/3/2019 11:54:00
#62 Publicado: 26/3/2019 16:00:30
Fridel Selitsky

Fridel Selitsky

520 me gusta en 451 mensajes.

Grupo: User

Thank you very much, Alvaro, for modifying the program. In your version I reduced the number
of arguments in the Dist and al_nleqsolve functions. Your program began to work much faster.

DistRazonar.sm (55,92 KiB) descargado 1724 vez(es).
#63 Publicado: 26/3/2019 22:07:38
Alvaro

Alvaro

1.139 me gusta en 1.805 mensajes.

Grupo: User

Hi Ber. Added Lagrange multipliers for refine the last nearest point in the curve. this enables to decrease the number of steps, up to a factor of ten.

I guess that the al_nleqsolve calls could be implemented as Draghilev method too.

DistBer.sm (53,4 KiB) descargado 1667 vez(es).
DistBer.pdf (181,65 KiB) descargado 997 vez(es).

Best regards.
Alvaro.
A 2 usuarios les gustó este mensaje
Fridel Selitsky 27/3/2019 2:46:00, sergio 27/3/2019 7:46:00
#64 Publicado: 27/3/2019 10:49:18
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: User

Wrote

I guess that the al_nleqsolve calls could be implemented as Draghilev method too.


Is that what you mean ?

Contour_10 Draghilev [Electron].sm (25,13 KiB) descargado 1533 vez(es).

#65 Publicado: 28/3/2019 4:12:54
Alvaro

Alvaro

1.139 me gusta en 1.805 mensajes.

Grupo: User

Wrote

Wrote

I guess that the al_nleqsolve calls could be implemented as Draghilev method too.


Is that what you mean ?

Contour_10 Draghilev [Electron].sm (25,13 KiB) descargado 1533 vez(es).



Hi Jean. Yes, that, and the use of Dragilev (without h, I forgot that) method for solve nonlinear equations, as uni teach sometime ago.

Best regards.
Alvaro.

#66 Publicado: 28/3/2019 10:29:30
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: User

Wrote

Hi Jean. Yes, that, and the use of Dragilev (without h, I forgot that) method for solve nonlinear equations, as uni teach sometime ago.


From recollection, original Uni [Viacheslav]
further exploited by Ber7 [smart cat !]
Buenos dias, Amigo.
#67 Publicado: 2/4/2019 15:52:56
Fridel Selitsky

Fridel Selitsky

520 me gusta en 451 mensajes.

Grupo: User

Finding Distance of a Point from Surface
The difference from the program distance to the curve in only one expression:
in the top line instead of i: = (1 ... 2)) we have i: = (1 ... 3).
A is a given point, a is its projection to the surface, Аa (k) is the length of the segment Аa (k)
to the surface, the h-step of decreasing the distance, a (k) is the intermediate coordinate of
the point touch.The red line is the normal, the green is the trajectory of the movement of the
point a (k) from the initial the position of a (1) to the final a.I borrowed the trajectory
demonstration from Razonar,to whom I express my gratitude.

Dist3d.sm (63,12 KiB) descargado 1705 vez(es).

Dist3d (5).png
A 4 usuarios les gustó este mensaje
Вячеслав Мезенцев 2/4/2019 18:23:00, Alvaro 2/4/2019 17:46:00, NDTM Amarasekera 3/4/2019 12:15:00, Andrey Ivashov 3/4/2019 3:23:00
#68 Publicado: 2/4/2019 23:05:12
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: User

You may have interest in that stuff:

[url=https://www.geometrictools.com/Documentation/DocUpdateHistory.pdf]
A 2 usuarios les gustó este mensaje
Fridel Selitsky 3/4/2019 1:30:00, Andrey Ivashov 3/4/2019 3:23:00
#69 Publicado: 3/4/2019 1:31:18
Fridel Selitsky

Fridel Selitsky

520 me gusta en 451 mensajes.

Grupo: User

Many thanks for the link.I will study this material.
https://www.geometrictools.com/Documentation/Documentation.html
#70 Publicado: 3/4/2019 22:20:28
Alvaro

Alvaro

1.139 me gusta en 1.805 mensajes.

Grupo: User

Wrote

Finding Distance of a Point from Surface
The difference from the program distance to the curve in only one expression:
in the top line instead of i: = (1 ... 2)) we have i: = (1 ... 3).



Hi. Attached version have some reformulations, but is essentially the same, just added Lagrange multipliers for refine last point and join 3D and 2D in only one procedure. Maybe don't works in all cases, I guess that because use less points, but is more pedagogical from my point of view.

Dist.sm (172,04 KiB) descargado 1727 vez(es).
Dist.pdf (500,48 KiB) descargado 1030 vez(es).

Best regards.
Alvaro.

A 1 usuarios les gustó este mensaje
Fridel Selitsky 4/4/2019 1:24:00
#71 Publicado: 4/4/2019 5:06:25
Fridel Selitsky

Fridel Selitsky

520 me gusta en 451 mensajes.

Grupo: User

Thank you, Razonar, for improving the program. I would like to
have a criterion to verify the accuracy of our calculations. For example,
you can use the vector product of unit vectors dist and normals,
whose modulus with perfect accuracy will be equal to to zero.
he magnitude of the deviation from zero characterizes the accuracy.
Agree Are you with this criterion?

Cross.sm (65,4 KiB) descargado 1740 vez(es).
A 3 usuarios les gustó este mensaje
sergio 4/4/2019 5:19:00, Alvaro 4/4/2019 20:44:00, NDTM Amarasekera 4/4/2019 7:05:00
#72 Publicado: 4/4/2019 20:43:22
Alvaro

Alvaro

1.139 me gusta en 1.805 mensajes.

Grupo: User

Wrote

Thank you, Razonar, for improving the program. I would like to
have a criterion to verify the accuracy of our calculations. For example,
you can use the vector product of unit vectors dist and normals,
whose modulus with perfect accuracy will be equal to to zero.
he magnitude of the deviation from zero characterizes the accuracy.
Agree Are you with this criterion?

Cross.sm (65,4 KiB) descargado 1740 vez(es).



Hi Ber. Thanks for say "our" calculations, but actually are yours. I just make some few modifications. Some general notes: It's a numerical procedure, so, guess values are part of the solution. Because of that, and the fact that you take a random external point I guess that my major modification can't get the global solution, and sometimes get only local ones. Each curve or surface need an specific general expression for the guess value in such case.

This is a small modification of your implementation, with some notes:
Cross.sm (73,37 KiB) descargado 1734 vez(es).

This is the modified implementation, and shows that the introduction of the Lagrangian multipliers for refine the last point get a very small cross third component value in all the cases where can find a solution.
Dist.sm (190 KiB) descargado 1763 vez(es).

This shows the importance of the initial guess value for seek the global solution
Dist_InitialGuess.sm (71 KiB) descargado 1805 vez(es).

So, answering your question, my conclusion is: Yes, you can use cross to show that, in 2D case the circle is locally tangent to the curve and, for the 3D case, a sphere is. But guess that for construction of your algorithm can't be used as a stop criteria because in your setup you need to move the point along the curve for seek the better approach.

But what I see is that I can find only local solutions, but not the global one. For that, given a random external point A to a curve or a surface you must to get the initial guess xo as a function of the given function and the point A, that's specific for each function.

Dragilev method can help here for finding the global distance because with that you know that you have a curve parametrization, so guess that only need to know in which direction you need to move, and estimate for how many 'time' you need to do that. Next, you use your algorithm and refine the last point with the Laplace multiplier to ensure that the circle centered in A is tangent to the curve.

But for the 3D case I don't see any help here, because with two parameters you lost the sort property of reals: plane points can't be sorted.

Hope that this notes helps.

Best regards.
Alvaro.

A 3 usuarios les gustó este mensaje
Fridel Selitsky 5/4/2019 4:29:00, sergio 5/4/2019 11:00:00, frapuano 5/4/2019 6:44:00
#73 Publicado: 5/4/2019 9:15:14
алексей

алексей

17 me gusta en 78 mensajes.

Grupo: User

“Finding Distance of a Point from curve or surface” - not far the best application of the Draghilev method.
An example of the projection of points from one surface to another using the optimization methods in Maple.

projection  of curve3.gif
#74 Publicado: 5/4/2019 13:40:08
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: User

Wrote

“Finding Distance of a Point from curve or surface”


If Draghilev method wouldn't have been discovered, it could be solved otherwise,
by more conventional method ... like in the attached
1. Distance between user random triplets pairs.
2. Specified "user random" from one pair triplet [surface/solid]
3. Direction cosines plane [normal to solid] as one pair triplet
the 2nd triplet pair from solid.
Easy but not included: distance between helix/random-Brownian.
I'm lost in that thread, further latest SS don't read previous stable SS.
If Mathcad 11 and earlier can do w/o Draghilev, Smath earlier as well.

Cheers ... Jean

Vector Maths Direction Cosine [Dist-in-Space] Copy.sm (82,89 KiB) descargado 1640 vez(es).


#75 Publicado: 5/4/2019 14:41:42
алексей

алексей

17 me gusta en 78 mensajes.

Grupo: User

It seems to me that the Draghilev method is intended for a “large” number of variables with a “small” number of equations.
For example, as in the case of solving the inverse problem of kinematics for a three-link manipulator with a variable length of the working link. This manipulator has 6 degrees of freedom.
MAN 3  6.gif
#76 Publicado: 6/4/2019 8:10:49
Alvaro

Alvaro

1.139 me gusta en 1.805 mensajes.

Grupo: User

Hi. The distance for 2D parametrizing plane curves by Dragilev method for seek a good guess for using with Laplace multipliers method for minimizing the distance.

Dist2Dragilev.sm (71,68 KiB) descargado 1760 vez(es).
Dist2Dragilev.pdf (374,25 KiB) descargado 959 vez(es).

Best regards.
Alvaro.
A 3 usuarios les gustó este mensaje
Fridel Selitsky 6/4/2019 8:33:00, sergio 6/4/2019 11:20:00, frapuano 6/4/2019 11:18:00
#77 Publicado: 2/10/2020 15:43:22
Fridel Selitsky

Fridel Selitsky

520 me gusta en 451 mensajes.

Grupo: User

Point Orthogonal Projection onto a flat or spatial Curve

Calculation procedure
1. We will use Draghilev's method
a) to parameterizethe curves and find a good initial guess.
We will use the point a0, found by the minimum distance
from the curve to a given point P.
b) to calculate the unit vector of the tangent T (x) to a
point on the curve.
2 To the system of equations we add an equation that
expresses the conditions of perpendicularityof the tangent
at the point x of the curve and the segment connecting the
points P and x. This means that the inner product of the unit
tangent vector to the curve f (x) and the unit vector Px is
equal to zero. As a result, we obtain the system of equations
3. We solve the system with the initial assumption a0

distantion.sm (124,14 KiB) descargado 1735 vez(es).
Trascidental curves.pdf (394,93 KiB) descargado 1038 vez(es).

distantion (2).png
A 3 usuarios les gustó este mensaje
NDTM Amarasekera 3/10/2020 12:08:00, Davide Carpi 2/10/2020 16:26:00, Andrey Ivashov 2/10/2020 17:25:00
#78 Publicado: 20/11/2020 16:27:43
алексей

алексей

17 me gusta en 78 mensajes.

Grupo: User

Draghilev's method and an approach to modeling platforms (parallel manipulators) with the number of degrees of freedom from 1 to 6.
Forum MaplePrimes 1 and 6
#79 Publicado: 2/12/2020 6:12:07
Fridel Selitsky

Fridel Selitsky

520 me gusta en 451 mensajes.

Grupo: User

Distance and projection of a point onto a parametric surface

ParSur.sm (74,98 KiB) descargado 1871 vez(es).
ParSur.pdf (619,79 KiB) descargado 1236 vez(es).
ParSur (3).png
A 1 usuarios les gustó este mensaje
Alvaro 2/12/2020 18:21:00
#80 Publicado: 3/12/2020 19:58:20
Alvaro

Alvaro

1.139 me gusta en 1.805 mensajes.

Grupo: User

Hi. Thanks for the post. Here, my attempt for reproduce your gamma "point of view". I guess that it could be more interesting to change it following the matlab function view(), but I'm not sure if the attached reproduce the matlab's view behavior

https://la.mathworks.com/help/matlab/ref/view.html

https://la.mathworks.com/help/matlab/creating_plots/setting-the-viewpoint-with-azimuth-and-elevation.html?lang=en

Gamma matrix for rotations.sm (74,69 KiB) descargado 1634 vez(es).
Gamma matrix for rotations.pdf (284,1 KiB) descargado 951 vez(es).

Best regards.
Alvaro.
A 1 usuarios les gustó este mensaje
Fridel Selitsky 4/12/2020 6:15:00
  • Nuevos mensajes
  • Sin mensajes nuevos