Dymola Store Outputs Options Greyed Out - dymola

I'm running a batch of simulations in Dymola 2021x and in terms of outputs, I only care about some of the state variables. I figured the easiest way to limit the selection would be to go into Simulation Setup>Output>Store and leave only the "State variables" box checked. But all the options are greyed out and checked so I can't limit the outputs.
Is there a setting in Dymola that would disable the store output options?
I've tried restarting Dymola and rebooting my PC but as kind of expected, nothing changed.

Yes, the variable dependencies disable the outputs.
From the command line:
Advanced.GenerateVariableDependencies = true;
Maybe there are others as well, but that's the only one I am currently aware of.

Related

Output logs from pyscipopt

It may be a basic question, but how can I view the log of the solver after the model is optimized. I came across the option to hide the outputs by specifying model.hideOutput(). Is there an option to show the outputs (by default, I don't see any output log. I am using Spyder IDE).
Printing the SCIP output is activated by default in PySCIPOpt. As you already wrote, you would have to manually disable it by calling hideOutput(). Have you tried running your code in a terminal outside of Spyder? Is the model even solved, so did you check whether there is a solution in the end?
To complete the other answer: if your PySCIPOpt model has been created by third-party code, it is possible the output has been turned off upstream.
You can still call model.hideOutput(False) -- see the documentation of hideOutput().

Turning off Presolve option in CPLEX OPL

Does anyone know how to disable "presolve" in CPLEX? (without using Java, C++, etc.)
My CPLEX Version is 12.4, in case it makes a difference.
Thanks in advance,
Although the question was asked for OPL, it is also useful to know how to do this in Java/CPP/interactive optimizer.
Solution: set parameter preind to false
Java: IloCplex.Param.Preprocessing.Presolve E.g. java: cplex.setParam(IloCplex.BooleanParam.PreInd, false);
CPP: IloCplex::Param::Preprocessing::Presolve
C: CPXPARAM_Preprocessing_Presolve
.net: Cplex.Param.Preprocessing.Presolve
Iteractive optimizer: preprocessing presolve
See: http://www-01.ibm.com/support/knowledgecenter/SSSA5P_12.6.2/ilog.odms.cplex.help/CPLEX/Parameters/topics/PreInd.html
After trying to find how certain parameters can be changed in CPLEX, I have found the answer to my own question.
To change parameters (using CPLEX only) you don't need to type in any code. All you have to do is creating a "Settings" file within your project file.
You can follow these steps:
In the "OPL Projects" window right click and select "New->Settings"
Give a name to your settings file and click OK.
Change the parameters as you wish (to find the related setting you can type in the name of the parameter in the search bar, in my case it worked when i searched for "Preprocessing". From the menu that appeared I unchecked the box called "Presolve indicator")
Add the "Settings" file to your desired Run Configuration file to apply changes. In this case, CPLEX uses the parameters in your Settings file instead of the default values.
And that is all :)

Office VBA Editor not capitalizing some recognized terms

I'm getting a strange behavior from the Office VBA Editor: certain terms no longer capitalize when they are recognized. In fact, I can use the autoselect to choose the term, which is properly capitalized until the compiler validates the line and the editor actually changes it to lower case.
For example, today I typed this Set wFramework = application.ActiveWorkbook using the auto-select to choose .ActiveWorkbook, but as soon as I pressed [Enter], the compiler changed it to Set wFramework = Application.activeworkbook. Notice that the compiler properly capitalized Application but improperly removed the capitalization from .activeworkbook.
For now the number of objects / methods that don't capitalize correctly is small, but seems to be growing.
I've tried things like turning off all the code settings in hopes this would somehow reset things, but that was a non-starter. I can't find anywhere with controls for that function. I wondered if this is handled through the References, but there doesn't seem to be anyway those should be editable, especially without my doing it on purpose. I'm also wondering if this is somehow a function of Windows improperly tracking case management, but again it seems like that would be specific to a Windows session, and this symptom persists even if I have shut down the computer completely and restarted.
Does anyone know what might cause this, and whether it is possible to reset?
I had the same behaviour with the Enabled property always being displayed as e.g. chkReportFinance.enabled = False.
This was easily fixed by adding a line Dim Enabled, which capitalised all instances, then removing the line.
Tim Williams said:
"Sometime if you have (eg) defined a variable with the name application then the compiler gets "stuck" on that case and doesn't correct later uses to Application, even after renaming the variable. If the problem persists try exporting and re-importing your code modules (see Rob Bovey's "code cleaner" tool for an easy way to do this: appspro.com/Utilities/CodeCleaner.htm)"
This solved the problem. Question answered!

Howto enable stronger optimization builds

I am trying to build PETSc and have problems to enable optimization. Without specifying, PETSc always creates a debugging build, but I can turn that off with passing --with-debugging=0 to cmake. However, this only enables -O1 by default, but as my application is extreme time consuming and very time critical, I want to have at least -O2. I can't find an option except --CFLAGS, which works, but always appends options to the end, so -O1 would override my -O2.
I greped for "-O" to set the flag manually, this gave me a million lines, mostly from the configure.log file and doesn't help.
Does anybody know the file where to set the flag, or a workaround like ...another option that disables the usage of the last specified -O#, but enables the strongest or first?
Citing PETSc' install instructions:
Configure defaults to building PETSc in debug mode. One can switch to
using optimzed mode with the toggle option --with-debugging [defaults
to debug enabled]. Additionally one can specify more suitable
optimization flags with the options COPTFLAGS, FOPTFLAGS, CXXOPTFLAGS.
./configure --with-cc=gcc --with-fc=gfortran --with-debugging=0
COPTFLAGS='-O3 -march=p4 -mtune=p4' FOPTFLAGS='-O3 -qarch=p4
-qtune=p4'

Ipython QtConsole %edit

When using the magic function %edit from QtConsole with IPython, the call does not block, and does not execute the saved code. It does however save a temporary file...
I think this is intended behavior due to GUI editors and uncertainty, and whatever that reason is for not being able to communicate with subprocess (pyZMQ?).
What do you suggest as the best way to mix %edit/%run magics?
I would not mind calling two different commands (one to edit, and one after I have saved and execution is safe). But those commands need a way to synchronize this target file location, or someone to persist storage, and probably need some crude form of predicatably generating filenames such that you can edit more than one file at a time, and execute in arbitrarily. Session persistence is not a must.
Would writing my own magic do any good? Hope we can %edit macros soon, that would do well enough to make it work.
you shoudl be able to do %edit filename.py and %run filename.py. The non blocking behavior is expected, and IIRC due to technical reason. Not unsurmountable but difficult.
You could define your own magic if you wish, improvement are welcomed.
Hope we can %edit macros soon, that would do well enough to make it work.
For that too, PR are welcomed. I guess as a workaround/option you can %load macro which would put macro on input n+1 , edit it and redefine it, that might be a good extension for a cell magic %%macro macroname
If you have some executable code on your input (from QtConsole), you can type
%edit 1-5
This fires the editor, creates a temporarily file (automatically managed), and loads your input lines. This is nearly enough, now how to retrieve the name of that temp file pragmatically?
I see the print statement on Stdout, but its not visible to QtConsole AFAIK. Could maybe redirect stdout to catch that line, but that may not be an option anyway if your doing something else with stdout.
If I could retrieve the full pathname that was just created, this would be cake. Store it where some magics will know how to find it. Then issue a followup command when ready,pops the name off the stack, loads it into a macro, and run. All this with 2 input commands and no names to remember (unless you want to find and use that macro again, but for 1 shot stuff...)
How do I catch or retrieve the path of that temporary file?