Group Abstract Group Abstract

Message Boards Message Boards

0
|
10.9K Views
|
7 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Solve system of linear Diophantine equations with conditions

Posted 10 years ago
POSTED BY: Juan Frias
7 Replies

Seems to me you are trying to use FindInstance to find a symbolic instance. I don't think it does that.

POSTED BY: Frank Kampas
Posted 10 years ago

Hi. I think you are missing some constraints.

const = Thread[ {a, b, n, c1, c2, b - a*n, a - c1, a - c2, b - c1 - c2} >= 0 ]
POSTED BY: Dana DeLouis
Posted 10 years ago

Thank you for your comment, I didn't know Thread. That was a problem with FindInstance, such constraints for the constants made the mistake. I just try with Thread before FindInstance and the mistake remains, but before Solve and considering only the linear system everything works fine. Indeed, I didn't use SetAttributes and requiring integer solutions, in the conditional expression obtained appears the hypothesis that $a,b,c_1,c_2,n$ are integer numbers.

POSTED BY: Juan Frias
Posted 10 years ago

Thank you for your comment. I obtain the following using Solve: If I try to write the conditions on the constant I obtain the same mistake as in FindInstance. Now, if I don't write the conditions for the constants, then I obtain a solution but some of the constants $n,a,b,c_1, c_2$ has assigned values. However, using SetAttributes[{n,a,b,c1,c2}, Constant] and only writting the conditions for the constants, the mistake was fixed and I obtain conditional expressions in terms of $n,a,b,c_1,c_2$.

Edit: Solve works writing only the conditions for the constants, and in the solution some of them has assigned values in terms of other constants.

POSTED BY: Juan Frias

That's interesting. Could you attach your notebook? I'd like to see exactly how that worked.

POSTED BY: Frank Kampas
Posted 10 years ago

Sure, I attached the notebook. I'm sorry, I got lost among all the calculations and attempts that I did: Solve works if I write the conditions for the constants, and in the solution some of them has assigned values in terms of other constants.

Now, I am trying to obtain a solution using the conditions for the constants and the condition that the solution is nonnegative.

Attachments:
POSTED BY: Juan Frias

I think it's complaining about b, c1 and c2, which are not variables or numbers. Since your equations are all linear, try Solve or Reduce.

POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard