Optimization of parameter in Matlab ?
46 次查看(过去 30 天)
显示 更早的评论
Hi I have 10 parameter to optimize. These are material parameter which define the material properties. When the material is simulated in Ansys with initial 10 parameter value I get Admittance curve. I already have my experimental Admittance curve. Now i have to find the set of 10 parameter that will make my Simulated and experimental curve same. How can i do this?
9 个评论
Mario Malic
2020-10-6
编辑:Mario Malic
2020-10-6
Edit: moved to answers
I assume that you have no analytic expressions that relate your admittance curve with your parameters.
Well, first of all, you need to set up connection with ANSYS through actxserver, or play with input/output files and scripting the simulation procedure.
See question and answer here to get an idea how to set up the optimisation procedure, it's different software but principle is the same. To solve the problem this way is hard, especially if simulating the model takes long or if you're looking for global minima. Good luck.
回答(2 个)
George Ghimire
2020-10-6
1 个评论
Alan Stevens
2020-10-6
Your simulated curve is, presumably, constructed using your 10 parameters. Is that not a mathematical form?
Mario Malic
2020-10-6
编辑:Mario Malic
2020-10-6
I assume that you have no analytic expressions that relate your admittance curve with your parameters.
Well, first of all, you need to set up connection with ANSYS through actxserver, or play with input/output files and scripting the simulation procedure.
See question and answer here to get an idea how to set up the optimisation procedure, it's different software but principle is the same. To solve the problem this way is difficult, especially if simulating the model takes long or if you're looking for global minima.
Choosing the optimisation solver, algorithms, optimisation options depends on your objective function, which is minimising the difference between these curves.
Good luck.
3 个评论
Mario Malic
2020-10-6
编辑:Mario Malic
2020-10-6
problem.objective = @(x)Obj_Function(x)
%along with the rest of the inputs for the problem structure
[x, fval] = fmincon(problem)
How do you explicitly say what's your objective to MATLAB, or what is its value?
function f_obj = Obj_Function(x)
% Prepare an input file (text) of simulation, find where are these parameters that you're trying to optimise
% Write a function that reads input file, modifies the parameters and returns the modified input file
% Run the modified file in batch mode
% Once the simulation is finished, you have to postprocess the results. If you're able to automatically generate results in text file through an input file, that's great, otherwise, you have to look for a way to do it
% Read text file with results and compare it with experimental curve, you have to determine some sort of measure to describe the differences between curves. For simplicity, this measure can be a scalar value, a single number.
% Return this measure as a value for objective function
fobj = calculate_obj_value;
end
If you check the link I wrote in previous reply, in that example, objective was to minimise sum of energies, so in that case
fobj = MyK1_Energy + MyK2_Energy
For your case, it's a bit more difficult, since you minimise difference of two curves, and that is up to you to define a measure. Should it be sum of differences at measured points, sum of least squares or something else.
Edit: It doesn't have to be fmincon, you can choose what's appropriate for your problem.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!