Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

4 Pages«<234
Options
Go to last post Go to first unread
Online Razonar  
#61 Posted : 26 March 2019 15:48:28(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 385
Uruguay

Was thanked: 194 time(s) in 119 post(s)
Originally Posted by: Ber7 Go to Quoted Post
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 (48kb) downloaded 19 time(s).
DistMod 2.pdf (168kb) downloaded 11 time(s).

Best regards.
Alvaro.
thanks 2 users thanked Razonar for this useful post.
on 26/03/2019(UTC),  on 26/03/2019(UTC)
Offline Ber7  
#62 Posted : 26 March 2019 22:00:30(UTC)
Ber7


Rank: Advanced Member

Groups: Registered
Joined: 15/07/2010(UTC)
Posts: 328
Man
Israel
Location: Beer-Sheva

Was thanked: 425 time(s) in 230 post(s)
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 (56kb) downloaded 16 time(s).
Online Razonar  
#63 Posted : 27 March 2019 04:07:38(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 385
Uruguay

Was thanked: 194 time(s) in 119 post(s)
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 (54kb) downloaded 22 time(s).
DistBer.pdf (182kb) downloaded 15 time(s).

Best regards.
Alvaro.
thanks 2 users thanked Razonar for this useful post.
on 27/03/2019(UTC),  on 27/03/2019(UTC)
Offline Jean Giraud  
#64 Posted : 27 March 2019 16:49:18(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 3,956
Canada

Was thanked: 707 time(s) in 553 post(s)
Originally Posted by: Razonar Go to Quoted Post
I guess that the al_nleqsolve calls could be implemented as Draghilev method too.

Is that what you mean ?

Contour_10 Draghilev [Electron].sm (26kb) downloaded 21 time(s).

Online Razonar  
#65 Posted : 28 March 2019 10:12:54(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 385
Uruguay

Was thanked: 194 time(s) in 119 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
Originally Posted by: Razonar Go to Quoted Post
I guess that the al_nleqsolve calls could be implemented as Draghilev method too.

Is that what you mean ?

Contour_10 Draghilev [Electron].sm (26kb) downloaded 21 time(s).



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.

Offline Jean Giraud  
#66 Posted : 28 March 2019 16:29:30(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 3,956
Canada

Was thanked: 707 time(s) in 553 post(s)
Originally Posted by: Razonar Go to Quoted Post
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.
Offline Ber7  
#67 Posted : 02 April 2019 21:52:56(UTC)
Ber7


Rank: Advanced Member

Groups: Registered
Joined: 15/07/2010(UTC)
Posts: 328
Man
Israel
Location: Beer-Sheva

Was thanked: 425 time(s) in 230 post(s)
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 (64kb) downloaded 17 time(s).
thanks 4 users thanked Ber7 for this useful post.
on 02/04/2019(UTC),  on 03/04/2019(UTC),  on 03/04/2019(UTC),  on 03/04/2019(UTC)
Offline Jean Giraud  
#68 Posted : 03 April 2019 05:05:12(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 3,956
Canada

Was thanked: 707 time(s) in 553 post(s)
You may have interest in that stuff:

[url=https://www.geometrictools.com/Documentation/DocUpdateHistory.pdf]
thanks 2 users thanked Jean Giraud for this useful post.
on 03/04/2019(UTC),  on 03/04/2019(UTC)
Offline Ber7  
#69 Posted : 03 April 2019 07:31:18(UTC)
Ber7


Rank: Advanced Member

Groups: Registered
Joined: 15/07/2010(UTC)
Posts: 328
Man
Israel
Location: Beer-Sheva

Was thanked: 425 time(s) in 230 post(s)
Many thanks for the link.I will study this material.
https://www.geometrictools.com/D...ation/Documentation.html
Online Razonar  
#70 Posted : 04 April 2019 04:20:28(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 385
Uruguay

Was thanked: 194 time(s) in 119 post(s)
Originally Posted by: Ber7 Go to Quoted Post
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 (173kb) downloaded 14 time(s).
Dist.pdf (501kb) downloaded 15 time(s).

Best regards.
Alvaro.

thanks 1 user thanked Razonar for this useful post.
on 04/04/2019(UTC)
Offline Ber7  
#71 Posted : 04 April 2019 11:06:25(UTC)
Ber7


Rank: Advanced Member

Groups: Registered
Joined: 15/07/2010(UTC)
Posts: 328
Man
Israel
Location: Beer-Sheva

Was thanked: 425 time(s) in 230 post(s)
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 (66kb) downloaded 16 time(s).
thanks 3 users thanked Ber7 for this useful post.
on 04/04/2019(UTC),  on 04/04/2019(UTC),  on 05/04/2019(UTC)
Online Razonar  
#72 Posted : 05 April 2019 02:43:22(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 385
Uruguay

Was thanked: 194 time(s) in 119 post(s)
Originally Posted by: Ber7 Go to Quoted Post
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 (66kb) downloaded 16 time(s).


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 (74kb) downloaded 12 time(s).

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 (191kb) downloaded 13 time(s).

This shows the importance of the initial guess value for seek the global solution
Dist_InitialGuess.sm (72kb) downloaded 12 time(s).

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.

thanks 3 users thanked Razonar for this useful post.
on 05/04/2019(UTC),  on 05/04/2019(UTC),  on 05/04/2019(UTC)
Offline алексей_алексей  
#73 Posted : 05 April 2019 15:15:14(UTC)
алексей_алексей


Rank: Member

Groups: Registered
Joined: 30/09/2012(UTC)
Posts: 27
Russian Federation

Was thanked: 10 time(s) in 5 post(s)
“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.

Edited by user 05 April 2019 15:29:57(UTC)  | Reason: Not specified

Offline Jean Giraud  
#74 Posted : 05 April 2019 19:40:08(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 3,956
Canada

Was thanked: 707 time(s) in 553 post(s)
Originally Posted by: алексей_алексей Go to Quoted Post
“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 (83kb) downloaded 12 time(s).


Offline алексей_алексей  
#75 Posted : 05 April 2019 20:41:42(UTC)
алексей_алексей


Rank: Member

Groups: Registered
Joined: 30/09/2012(UTC)
Posts: 27
Russian Federation

Was thanked: 10 time(s) in 5 post(s)
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.
Online Razonar  
#76 Posted : 06 April 2019 14:10:49(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 385
Uruguay

Was thanked: 194 time(s) in 119 post(s)
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 (72kb) downloaded 20 time(s).
Dist2Dragilev.pdf (375kb) downloaded 13 time(s).

Best regards.
Alvaro.
thanks 3 users thanked Razonar for this useful post.
on 06/04/2019(UTC),  on 06/04/2019(UTC),  on 06/04/2019(UTC)
Users browsing this topic
Similar Topics
Draghilev method revisited [Isocurves] (Samples)
by Jean Giraud 27/03/2019 18:17:33(UTC)
4 Pages«<234
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.