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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Help needed for optimization function

calex
1-Visitor

Help needed for optimization function

Hi everybody,

I need some help with Mathcad, from some experienced users in solving a little math problem:

Let\s assume a parameter which varies inside an interval and I need to to find the exact value for which a function of that parameter becomes minimum, let's say:

- Variable x is in between 10..20, taking all values with 3 decimals

- Based on the variable x, I'm calculating an error function which is supposed to be in between an interval  -2<f(x)<2

- I need the value of x for which my function f(x) satisfies the conditions described above

The above described problem is for a single variable function, but I would also need to do the same thing when I have a few initial parameters: x,y, z, each of them with a few decimals and with their own intervals of variations, and a function f(x,y,z) which again should satisfy a condition like -2<f(x,y,z)<2.

So in conclusion, what I need is the Mathcad syntax for defining such variables (all numbers in a range with a certain precision of decimals), and the optimizing command that would return the exact value of those variables for which the function of the given variables satisfies a range condition ( exact values of x, y, z from their own intervals of variation, for which -2<f(x,y,z)<2 )

Thank you!

6 REPLIES 6
LucMeekes
23-Emerald III
(To:calex)

Do you 'know' the function f(x) or f(x,y,z). That is, do you have a mathematical expression for the function

e.g. f(x) = sin(x)+x-2

?

LucMeekes
23-Emerald III
(To:calex)

If you do not 'know' the function, have a look here: Minimizing a Function using Simulated Annealing to see i it can help you.

Success!
Luc

calex
1-Visitor
(To:LucMeekes)

Hi,

Thank you for your reply. The provided link Minimizing a Function using Simulated Annealing is not usable since it only has two videos without explanations about what is represented and most importantly how it can be used, and the attached file Simulated Annealing for publication.xmcdz.zip can not be opened even in the latest Mathcad express prime 4.0.

Regarding my function f(x,y,z) I can not say a definite expression, since I actually have multiple functions like that, so my question remains about some general Mathcad syntax for defining such variables and general functions for getting the right parameters for which a such function comes close to 0.

Fred_Kohlhepp
23-Emerald I
(To:calex)

The document you were trying to read with Prime is a Mathcad version 15 file.  No version of Prime can open this file--you must translate it first, an operation which requires that you have Mathcad 15 on your computer.  (This has the fortunate effect of giving you the best, most versatile version of Mathcad available.  (You can download a 30 day trial version I believe.  If you purchase Prime you are entitled to a complimentary version of 15 enabled by the same license.)

I have attached a pdf of this file so you may see what Luc was referring to, although I'm not sure it applies to your case and in any rate Prime 4.0 in it's full version cannot do some of what's being shown.

Enjoy!

LucMeekes
23-Emerald III
(To:calex)

Besides, if you have Express Prime, you cannot do programming; and a lot of other Prime functions are not available because considered Premium features.

But...You do have mathematical expression(s) describing your function(s)...?!?

Make a good start and attach a Prime 4 sheet with at least one such function entered, and as much as possible what you need.

Seems like you're starting with Mathcad, so you need to learn. In order to learn you need to make mistakes...

We can help you, by correcting those.

Success!
Luc

VladimirN
24-Ruby II
(To:calex)

Converted Mathcad worksheet "Simulated Annealing for publication" for Mathcad Prime 3.1 can be found in attachment.

Announcements

Top Tags