Get Help

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- Root finding of vector function using find

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

11-25-2021
04:40 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

11-25-2021
04:40 AM

Root finding of vector function using find

Hello everyone

I have been a bit puzzled by the error I get when using find with vector variables. I have defined a triangle DEF in 2 dimensions. I am searching for the coordinates of a 4th point S such that the sum of vectors from S to the other points is a zero vector (weighed with parameters g and t). Unfortunately, find does not find a solution.

I thought maybe it was due to a divide by zero error, but adding the constraint that the product of the norms must be strictly positive does not solve the problem. The initial guess is already fairly close to the solution, so I don't believe it is the issue.

I have attached the mcdx file as well as a screenshot for convenience. Any idea of what is going wrong ?

François

Solved! Go to Solution.

Labels:

1 ACCEPTED SOLUTION

Accepted Solutions

11-25-2021
07:22 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

11-25-2021
07:22 AM

The initial guess is already fairly close to the solution

I wouldn't call that "close":

I don't think that your equation has solution!

I am not sure about the properties you demand for your points S and suggest that you check your equation.

Using "minerr" gives us a "solution" very close to point F but there seems to be no solution which fulfills the equation to 100%

7 REPLIES 7

11-25-2021
07:06 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

11-25-2021
07:16 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

11-25-2021
07:16 AM

The x= mean of the three points wasn't meant as an additional condition but was the guess value! 🙂

11-25-2021
07:21 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

11-25-2021
07:21 AM

I slightly changed the conditions of the problem and used it as an example 🙂.

11-25-2021
07:22 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

11-25-2021
07:22 AM

The initial guess is already fairly close to the solution

I wouldn't call that "close":

I don't think that your equation has solution!

I am not sure about the properties you demand for your points S and suggest that you check your equation.

Using "minerr" gives us a "solution" very close to point F but there seems to be no solution which fulfills the equation to 100%

11-25-2021
08:38 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

11-25-2021
08:38 AM

Thank you Werner and Vladimir for suggesting the use of minerr.

Since S has to be inside the triangle DEF, using the centroid seems a good enough guess without further info. That's what I meant by fairly close. In fact Werner's suspicion is correct that the problem simply has no solution with the proposed set of parameters g, t. For instance, changing g from 200 to 400 does work. That will teach me about trying to validate a program with no physical solutions ! 😅

I will try to improve the sheet so that it correctly returns no solution, rather than the error. There again minerr seem to come handy.

Thank you for the swift support !

11-25-2021
08:43 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

11-25-2021
08:43 AM

You're welcome.

11-25-2021
08:01 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

11-25-2021
08:01 PM

For instance, changing g from 200 to 400 does work.

Yes, there is only a solution if the ratio g:t is greater than 4.393 (with this ratio you get S=F).

I will try to improve the sheet so that it correctly returns no solution, rather than the error.

You could turn the solve block into a function dependent on t and g and check for the existence of a solution using "try ..on error...".

With a small modification you may also plot a graphical representation