Skip to main content
14-Alexandrite
October 9, 2024
Question

block solve

  • October 9, 2024
  • 1 reply
  • 1423 views

Hi

In Prime 10, is it possible to impose a domain of definition of variables?

in a geometric calculation, I do not have enough constraints, and it is difficult to have a unique solution. Is it possible to specify the domain of definition of the variables in order to converge ?

Thanks

1 reply

25-Diamond I
October 9, 2024

You can always add constraints like  a>0 or -10 < x < 20 or x>a  in a solve block to force variables to a certain domain.

XDN14-AlexandriteAuthor
14-Alexandrite
October 10, 2024

Hi Werner

See the attached file for more explanations

25-Diamond I
October 10, 2024

How about

Werner_E_0-1728555149645.png

or

Werner_E_4-1728556256807.png

the latter being equivalent to the original constraint but weighted by 10.

 

 

To "weight" a constraint you can multiply it by a larger number.

So instead of

Werner_E_1-1728555410575.png

which is equivalent to

Werner_E_0-1728561611993.png

you may use

Werner_E_3-1728555538400.png

Now this constraint (which in meaning has not changed at all and is equivalent to the original one) will be weighted more, but of course at the cost of the other constraints.

Weighting constraints in a solve bock with minerr can be quite tricky and a matter of trial and error to find the 'weights' that give the most desirable result.

I think multiplying a constraint by a number is equivalent to copy it multiple times in the solve block so that it will considered more than the others. We may think of the algorithm assigning each constraint a number indicating how much off the desired effect it s and tries to minimize the sum of those numbers. If a constraint is multiplied or repeated, of course it gets more weight to the overall effect.

I don't know the underlying algorithm but that seems to be the general way of working.