Fmincon where objective function comes from an external program batch file
12 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello everyone,
I have a script for APDL (Finite Element Analysis software) where I would like to perform an optimization.
I can get MATLAB to run the APDL script and store the output data for a single run analysis only. However, for the optimization I am having difficulty understanding how to link all the variables and function calling to fmincon.
First: I allocate memory, specify program to be run and the input and output files.
SET KMP_STACKSIZE=4096k & "D:\ANSYS Inc\ANSYS Student\v192\ansys\bin\winx64\ansys192.exe" -b -C:\Users\user\Desktop\macs -i "trial3.mac" -o "matlabout2.txt"
Trial3.mac, the analysis file is long and not needed here (though i can post if needed), it basically performs the FEA analysis in APDL using input parameters from a .inp file and at the end stores the value of the objective function parameter in a seperate file, .parm.
How do i link all of these so fmincon calls the batch file, change inputs and pass new inputs each time after analyzing the new objective function?
For reference I am also attaching a video where the problem is completely identical: https://www.youtube.com/watch?v=sE3NkH1m24w however, the video does not show how to use fmincon.
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Problem-Based Optimization Setup dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!