Turn on suggestions

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

Showing results for

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

Showing results for

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

Jan 31, 2021
10:45 PM

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

Jan 31, 2021
10:45 PM

Limit to solution to Integers

What would be the simplest way to limit solutions to integers. Mathcad attached

Solved! Go to Solution.

1 ACCEPTED SOLUTION

Accepted Solutions

Feb 01, 2021
12:30 AM

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

Feb 01, 2021
12:30 AM

Prime is not suitable for solving Diophantine equations. The algorithm used in the solve block needs to be able to change the variables in small steps and see if the overall error gets smaller or not. If you add constraints like the ones shown in the picture below, small changes will not alter the error and so Prime gives up.

You may use the symbolic solver, but it only finds the trivial solution 0/0/0. And demanding it to give all solutions (modifier "fully") gives a rather useless result.

So in case of your task, a brute force attack seems to be the best approach.

In case you also want solutions with negative integers, you should filter the solutions containing a zero as otherwise you would see too many solutions of the form -5/0/5.

1 REPLY 1

Feb 01, 2021
12:30 AM

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

Feb 01, 2021
12:30 AM

Prime is not suitable for solving Diophantine equations. The algorithm used in the solve block needs to be able to change the variables in small steps and see if the overall error gets smaller or not. If you add constraints like the ones shown in the picture below, small changes will not alter the error and so Prime gives up.

You may use the symbolic solver, but it only finds the trivial solution 0/0/0. And demanding it to give all solutions (modifier "fully") gives a rather useless result.

So in case of your task, a brute force attack seems to be the best approach.

In case you also want solutions with negative integers, you should filter the solutions containing a zero as otherwise you would see too many solutions of the form -5/0/5.