Prev: Part specification... is neither an integer nor a
Next: GeometricTransformation causes dislocated Arrowheads in Graphics3D
From: Ala on 13 May 2010 07:25 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/fieldHierarchyTable.gif best regards
From: Ala on 17 May 2010 07:10
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...(a)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(a)tuwien.ac.at Web: www.thvt.at ------------------------------------------------------------------------------ |