cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

block solve

XDN
14-Alexandrite
14-Alexandrite

block solve

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

5 REPLIES 5
Werner_E
25-Diamond I
(To:XDN)

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.

XDN
14-Alexandrite
14-Alexandrite
(To:Werner_E)

Hi Werner

See the attached file for more explanations

Werner_E
25-Diamond I
(To:XDN)

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.

 

XDN
14-Alexandrite
14-Alexandrite
(To:Werner_E)

I understand the approach, but it seems "strange" to me.

isn't the operation of the solver documented somewhere?

Thanks

Werner_E
25-Diamond I
(To:XDN)


@XDN wrote:

I understand the approach, but it seems "strange" to me.

isn't the operation of the solver documented somewhere?

Thanks


Not in detail, I fear.

This part of the help explains which algorithms you may chose for various functions

Choosing a Solving Algorithm

 

For "find" the default still seems to be the LM algorithm but Prime is using the KNITRO engine as far as I understood.

 

I suppose that the algorithm somehow concentrates on the absolute 'error'.

If x=y=0.1 and the constraints are x=0 and 1000*y=0, the absolute error for x is 0.1 but the absolute error for y is 100. So the algorithm may concentrate to obtain a lower error for the constraint 1000*y=0 but may be satisfied with x=0.

 

Announcements

Top Tags