Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Problem with Nminimize

  • To: mathgroup at smc.vnet.net
  • Subject: [mg109777] Re: Problem with Nminimize
  • From: Ala <amodarre at mail.zserv.tuwien.ac.at>
  • Date: Mon, 17 May 2010 07:10:51 -0400 (EDT)
  • References: <hsgnji$d66$1@smc.vnet.net> <b940257d-313d-43c4-b5ff-19ba1c9c899a@l6g2000vbo.googlegroups.com>

Dear Maxim,

Thank you very much for your very clear guidance.
But I would like to know how one could change use of machine precision. For example I changed The WorkingPrecision, AccuracyGoal and PrecisionGoal but I did not get a shorter computation time.

best regards

Ala



Maxim schrieb:
> On May 13, 6:25 am, Ala <amoda... at mail.zserv.tuwien.ac.at> wrote:
>   
>> I have some questions. How could I reduce computation time during
>> working with Nminimize. I mean how to change tolerance or something
>> like this. Is that possible to interrupt the calculation after 2 days in order to give some values? (in some optimization programs it is possible to have not very desired results by interrupting of calculation.)
>> Another one is that I would like to build graphically a heat exchanger network by mathematica where there are many equations and inequalities. In other words, you have to minimize total annual cost of heat excahnger network by means of function Nminimize. How could I build grid diagram like as below link which works interactively to linear programming. Is there the possibility to develop this network using mathematica?http://www.homepages.ucl.ac.uk/~ucecesf/images/hens-example.png<http://www.homepages.ucl.ac.uk/%7Eucecesf/images/hens-example.png>
>>
>> I wanna create a table which has some cells as checkbox that work
>> dynamically. Unfortunately i did not find any documentations about
>> dynamic function and array together such as Dynamic[Xi]. Could you help
>> me to create dynamically checkbox for each table cell? An example is
>> like:http://www.fittrackingsolutions.com/support/admin/images/fieldHierarc...
>>
>> best regards
>>     
>
> Hi Ala,
>
> Look at Options[NMinimize]. In order to speed up the calculations, you
> may want to decrease AccuracyGoal, PrecisionGoal, MaxIterations (and
> WorkingPrecision if you're not using machine precision). Also,
> tutorial/ConstrainedOptimizationGlobalNumerical lists options that are
> specific to different methods.
>
> StepMonitor or EvaluationMonitor can be used to log the evaluation
> steps:
>
> data = RandomInteger[{-1000, 1000}, 100];
> vars = Array[a, 100];
>
> res = TimeConstrained[
>     NMinimize[{Abs[data.vars - 123],
>       Thread[0 <= vars <= 1], Element[vars, Integers]},
>      vars, StepMonitor :> Sow[{Round[vars], data.Round[vars]}],
>      Method -> "DifferentialEvolution"],
>     10] // Reap;
>
> res[[2, 1, All, 2]]
> ListLinePlot[Abs[res[[2, 1, All, 2]] - 123], PlotRange -> All]
>
> In my tests, NMinimize didn't finish because of the time constraint,
> but the plot of the saved values shows quite reasonable behaviour,
> with non-increasing values of the goal function.
>
> I'm going to pass on the heat network question. There is a function
> LinearProgramming, which may be faster than NMinimize, but I don't
> know how to automatically generate the LP problem from the diagram.
>
> Here's a simple example with a list of controls. You can also use any
> variable created outside of the DynamicModule, if you want to access
> it from other places in the code:
>
> DynamicModule[{a = ConstantArray[False, 5]},
>  Column[{Grid[Transpose@
>      {{"Alpha", "Beta", "Gamma", "Delta", "Epsilon"},
>       Checkbox@ Dynamic@ a[[#]]& /@ Range[5]},
>     Alignment -> Left],
>    Button["Save", Print[a]]}]]
>
> Best regards,
> Maxim Rytin
>
>   

-- 
------------------------------------------------------------------------------
Dipl.-Ing. Ala Modarresi Hosseini
Projektassistent

Technische Universität Wien
Institut für Verfahrenstechnik, Umwelttechnik und Technische Biowissenschaften
Thermische Verfahrenstechnik - Prozess Simulation
Getreidemarkt 9/166-2
1060 Wien, Österreich

Tel.:             ++43-1-58801-15923
Fax.:             ++43-1-58801-15999
Email:            alae.hosseini at tuwien.ac.at
Web:              www.thvt.at                                            
------------------------------------------------------------------------------



  • Prev by Date: Re: Latex, Mathematica, and journals
  • Next by Date: Multiple FindRoot
  • Previous by thread: Problem with Nminimize
  • Next by thread: need your help!