Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
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!
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
?
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
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.
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!
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
Converted Mathcad worksheet "Simulated Annealing for publication" for Mathcad Prime 3.1 can be found in attachment.