Fmincon where objective function comes from an external program batch file
조회 수: 4 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Problem-Based Optimization Setup에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!