saving results after optimization with pyomo - callback

I am looking for straightforward way to save the results after the optimization.
On the online documentation I was able to find the function "pyomo_save_results", but there is no clear example or description.
Thanks

Related

Why some ETABS API methodes doesn't work in matlab?

I try to write a code by MATLAB that use ETABS to analyze a building and design its elements and give me the design results. The code doesn't have any problem but when I wanna use the GetSummaryResult_2 method I face this error "No method 'GetSummaryResult_2' with matching signature found for class 'ETABSv1.cDesignSteel' ". It's maybe caused MATLAB can't support all the API methods, anyway if you know any solution or another method that can give me the design results please help me. it has vital of importance to me, thank you!

How to find appropriate functions for PureScript?

PureScript have lots of functions available like filter lenth and more. But how can we find the function that we need and its examples with implementation? I am facing problem solving exercises of the book purescript by examples. Any tips how show I go about solving those? Example in the book does not explain everythin.
Really, the most straightforward way would be to use the tooling that comes with the compiler through an editor plugin. You can use ?typehole to get the type of the type hole and get search results for relevant functions.
I also quite often type in a partial identifier and use the completion to look through the implementations, e.g. fil <complete to find various filter definitions.
For all newbie to PureScript who are following PureScript by example book this github link has all the solutions with updated libraries
https://github.com/kvsm/purescript-by-example

how to understand the linkagemex function inside of the defaule linkage function in matlab

I need to rewrite the linkage function in matlab. Now, as I examine it, I realized there is a method called linkagemex inside of it. But I simply cannot step into this method to see its code. Can anyone help me out with this strange situastion?
function Z= linkage (Y, method, pdistArg, varargin)
Z=linkagemex(Y,method);
PS. I think I am pretty good at learning, but matlab is not so easy to learn. If you have good references to learn it well, feel free to let me know. Thanks very much for your time and attention.
As #m.s. mentions, you've found a call to a MEX function. MEX functions are implemented as C code that is compiled into a function callable by MATLAB.
As you've found, you can't step into this method (as it is compiled C code, not MATLAB code), and you don't have access to the C source code, as it's not supplied with MATLAB.
Normally, you would be at kind of a dead end here. Fortunately, that's not quite the case with linkagemex. You'll notice on line 240 of linkage.m that it actually does a test to see whether linkagemex is present. If it isn't, it instead calls a local subfunction linkageold.
I think you can assume that linkageold does at least roughly the same thing as linkagemex. You may like to test them out with a few suitable input arguments to see if they give the same results. If so, then you should be able to rewrite linkage using the code from linkageold rather than linkagemex.
I'm going to comment more generally, related to your PS. Over the last few days I've been answering a few of your questions - and you do seem like a fast learner. But it's not really that MATLAB is hard to learn - you should realize that what you're attempting (rewriting the clustering behaviour of phytree) is not an easy thing to do for even a very advanced user.
MathWorks write their stuff in a way that makes it (hopefully) easy to use - but not necessarily in a way that makes it easy for users to extend or modify. Sometimes they do things for performance reasons that make it impossible for you to modify, as you've found with linkagemex. In addition, phytree is implemented using an old style of OO programming that is no longer properly documented, so even if you have the code, it's difficult to work out what it even does, unless you happen to have been working with MATLAB for years and remember how the old style worked.
My advice would be that you might find it easier to just implement your own clustering method from scratch, rather than trying to build on top of phytree. There will be a lot of further headaches for you down the road you're on, and mostly what you'll learn is that phytree is implemented in an obscure old-fashioned way. If you take the opportunity to implement your own from scratch, you could instead be learning how to implement things using more modern OO methods, which would be more useful for you in the future.
Your call though, that's just my thoughts. Happy to continue trying to answer questions when I can, if you choose to continue with the phytree route.
You came across a MEX function, which "are dynamically linked subroutines that the MATLAB interpreter loads and executes". Since these subroutines are natively compiled, you cannot step into them. See also the MATLAB documentation about MEX functions.

Where can I find good and simple test functions for evolutionary algorithms?

I've started learning evolutionary algorithms (GA, PSO, ...) and I want to implement them in Matlab and play with different parameters to get a hold of the algorithms' structures and how they work.
My problem is, I don't have some simple test functions to use. For example, functions with multiple peaks/valleys, one global minimum and multiple local ones, .... Nothing complicated, just some simple mathematical functions with their formulas.
I can try to make some up with putting some sin/cos/exp together, but it'll take time and is really frustrating!
Anybody knows of a resource (site, book, ...) that have these listed?
Here is a set from our very own #Rody Oldenhuis:
Test functions
You might want to try those in the BBOB benchmark set. There is also some nice accompanying literature to this set in form of the corresponding GECCO workshop.
Some of the classic functions were mentioned by AGS already and include Rastrigin, Rosenbrock and Generalized Rosenbrock, Schwefel, Sphere, Griewank, etc.. We have also implemented these and more in HeuristicLab, so if you want to experiment you can also try that (PSO and GA are included also).

MATLAB code analysis and visualization tools?

I just picked up a MATLAB codebase that's light on documentation and original developers (who all shot through long ago).
I'm comfortable with MATLAB but could still use some static analysis tools to visualize the program for a quick idea how it works, without acquainting myself with all 148 source files...
I can't find anything like this for MATLAB -- searches return plenty on m-lint results but that's not what I'm looking for, I'm particularly interested in code structure visualization.
Cheers
You can use doxygen plus an appropriate filter, such as UsingDoxygenwithMatlab.
Be sure to set EXTRACT_ALL = YES to get auto-generated documentation for code without comments. There are other parameters for generating call trees and such, not sure if they work with the converted MatLab code.
Some of this answer may be useful. And don't forget the publish function.