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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Calibrating Models with Simulated Annealing?

ptc-4365574
1-Visitor

Calibrating Models with Simulated Annealing?

I asked Dan and he said, "Good question and a little out of my area of expertise. How do you feel about re-posting your question as a discussion in the Mathcad community for our resident experts to help out? ". I am a software developer working on a science team studying the effects of climate change on the Earth’s vegetation systems. We want to try using Simulated Annealing to calibrate our model(s). I have been using MathCad for a few years to test and study limits of the various algorithms we are including in our model. The computer that I did that work on, and on which I had originally installed MathCad, died and now I have installed it on my new computer. All seems fine, but in reading and searching for a Simulated Annealing method I see mention of Numeric Recipes (a disk?) which included SA. I also found an email that said the Numeric Recipes disk is no longer available, but that many of the functions had been incorporated into the MathCad software. So, my question is, is Simulated Annealing included somewhere within MathCad and if so, where is it?

Thanks, John Wells

541-750-7436

9 REPLIES 9

Short of programming your own solutions to problems in mathcad devolve to solve blocks. These come as Given:and

Find()

Maximize()

Minimize()

Minerr()

When I right-click on maximize and minimize I ca select linear or non-linear methods

Conjugate gradient

Quasi-Newton

There are advanced options available for the non-linear methods; the help dialog for those includes the following:

Multistart

Makes the nonlinear solver attempt to find a global maximum or minimum within the feasible region, rather than merely a local one.

Evolutionary

Finds good, though not necessarily optimal, solutions for problems where "classical" gradient methods are not sufficient. "Classical" gradient methods assume that the problem functions (objective and constraints) are smooth functions of the variables (that is, the gradients of these functions are everywhere continuous); the ability to converge to a local optimum depends on this assumption. In problems with non-smooth or even discontinuous functions, these methods often have difficulty reaching a solution. In such problems, the Evolutionary option, which makes no assumptions about the problem functions, can often help you find a good solution.

Even in smooth nonlinear problems, the "classical" gradient methods only find a locally optimal solution, and may miss a better solution far from the starting point you provide. The Evolutionary option gives you a much better chance of finding the globally optimal solution in such problems.

It looks to me like someone has wrapped simulated annealing into these two options (without using the phrase. I don't know how to find out.

It looks like you have several options:

  1. See what these solver options give you. Easy to do, may be difficult to interpret.
  2. It appears that simulated annealing is alive and well in Matlab. If you have that software you can embed a matlab object in mathcad and exchange the information that way.
  3. Find the original Numerical recipe C or Fortran code (it looks like that's still out there in the internet) and build a dll for mathcad. (Good Luck, but there are people here, not me, that can help with that.)
  4. Roll your own in mathcad. This software has the chops to do that, but you'd have to understand the math behind the technique well enough to put it down.
  5. Hope that one of the old collaboratory players (Stuart?) has already done this and can still find it. There were some really classy examples of Monte-Carlo simulations that I recall--this falls in a ssimilar category.

Good Luck.

Fred Kohlhepp wrote:

Short of programming your own solutions to problems in mathcad devolve to solve blocks. These come as Given:and

Find()

Maximize()

Minimize()

Minerr()

When I right-click on maximize and minimize I can select linear or non-linear methods

Conjugate gradient

Quasi-Newton

and Levenberg–Marquardt Method too see http://communities.ptc.com/videos/2418

john wells wrote:

I asked Dan and he said, "Good question and a little out of my area of expertise. How do you feel about re-posting your question as a discussion in the Mathcad community for our resident experts to help out? ". I am a software developer working on a science team studying the effects of climate change on the Earth’s vegetation systems. We want to try using Simulated Annealing to calibrate our model(s). I have been using MathCad for a few years to test and study limits of the various algorithms we are including in our model. The computer that I did that work on, and on which I had originally installed MathCad, died and now I have installed it on my new computer. All seems fine, but in reading and searching for a Simulated Annealing method I see mention of Numeric Recipes (a disk?) which included SA. I also found an email that said the Numeric Recipes disk is no longer available, but that many of the functions had been incorporated into the MathCad software. So, my question is, is Simulated Annealing included somewhere within MathCad and if so, where is it?

Thanks, John Wells

541-750-7436

It was the anneal function in the Numeric Recipes for the solving of the salesman task.

See http://twt.mpei.ac.ru/ochkov/Mathcad_12/3_16_Salesman_2.png

I just joined this group and I am now asking myself, "Where have you been?". The two responses I received so far are so appropos I am well on my way to solving this challenge I have. Thank you .

RichardJ
19-Tanzanite
(To:ptc-4365574)

Numerical Recipies is a very well known book on algorithms for numerical analysis. It comes in various flavors, depending on your programming language of choice. The older editions are available online for free: http://apps.nrbook.com/c/index.html

There did used to be a an extension pack for Mathcad based on this book, but it only worked up to and including version 11. When they went to version 12 the compute engine was rewritten, and the old extension packs no longer worked. Some of the extension packs were rewritten so that they did work, but Numerical Recipies was one that didn't make the transition. The justification for that was that by the time version 12 was released most of the functions were native to Mathcad anyway. That was true, but not all the functions were, and one that wasn't was the "anneal" function. That's a pity, because simulated annealing is very good for certain problems . Since then, if anyone has written their own simulated annealing function in Mathcad they have certainly not posted to the Mathcad forums. If they had, I would have saved a copy! I have thought about writing one myself, but unfortunately have never found the time. So your only option (in Mathcad) would be to write a function yourself. If you are familiar with Fortran or C you could base it on the functions in the Numerical Recipies books.

If you do write your own there would be a few people that would be very grateful if you posted it to these forums

Richard Jackson promised to send us a function of annealing, but ...

See

http://communities.ptc.com/videos/1366

I did not promise to write it. I said that if I had more time than I do I would write it. That still applies. I don't have a project that I am working on right now that needs it, and therefore I don't have the time to write it. Sorry.

Richard Jackson wrote:

I did not promise to write it. I said that if I had more time than I do I would write it. That still applies. I don't have a project that I am working on right now that needs it, and therefore I don't have the time to write it. Sorry.

Sori, Ai nou inglish veri bet

Sori, Ai nou inglish veri bet

No problem.

If it was only a small task I would do it, but it looks like a lot of work. Some day I'll need that function again, in which case I may have to put the work in, but not until then.

Announcements

Top Tags