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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

MathCAD URGENT

ptc-5746187
1-Newbie

MathCAD URGENT

I have a question about and algorithm I am creating.

I've got the necesary answer from my equation. But in that loop I need to find out from what combinations that value is given.

"Combinations" means, if you are watching the algorithm, that every variable is taking a valuea between 1 and 4 and entering the eqution.

I think that there are 4 cases in wich that result is given.

How do I find out those 4 cases? (in the same algorithm or even in an other is good; i need and output something like an array)

2 REPLIES 2

As in the attached?

There are only two solutions. You can test this by replacing the "if min..." in your algorithm by "if s=-6"

You only need to post in one category - repeat posts are unnecessary.

Alan

  • Many people here scan all Mathcad relevant subspaced so there is absolutely no need to crosspost in three different areas, even though you may consider your question as exceptionally important.
  • If someone posts a question its generally assumed here that he is interested and in need for an answer. So posting just once and chosing a more descriptive and meaningful subject would be a better idea than posting three times with the same declamatory, lofty, excited and not meaningful title.
  • The time you had put in mutliple postings would have better be invested in a cleared problem description. Why do you expect 4 different solutions for your minimum? How exactly do you need your results laid out (examples in the sheet woul have been a good idea))? ...
  • As your subject let us assume that you have a very great interest in a solution of your problem and that you are hard-pressed for time, I really wonder that you post and don't come back for hours.

Fred has shown you how to get the first of your solutions (you may get the last bychanging the < to <=).

Alan gave you a routine which returns all solutions. But be careful, depending on the target function used you may get additional "solutions" not corresponding with the absolute minimum. This always will happen if the first combination of the four values does not yield the absolute minimum. You can cope with that by inserting the following line in Alan's code (reset vectors if a new min is found).

16.03.png

Find attached a third variant which, as I guess, would also solve your problem.

BTW, sometimes the display name affects if one is taken more or less seriously.

--> May the force be "Avec Toi", Sir.

Top Tags