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
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.
George Ghimire
George Ghimire 2020-10-6
Hi @Mario after simulation i already will have the simulated results in a folder. Now whats the next procedure

请先登录,再进行评论。

回答(2 个)

George Ghimire
George Ghimire 2020-10-6
The mathematical form cannot be expressed exactly for optimization. I am looking for solution on Matlab . Consider I have simulated curve or value which is related to my 10 initail parameter ( but there is no mathematical equation). Also i have my experimental curve. Now i want to fit my simulated curve to experimental curve. By this way simulated curve changes and it should give new 10 value. This new value will be my optimised value
  1 个评论
Alan Stevens
Alan Stevens 2020-10-6
Your simulated curve is, presumably, constructed using your 10 parameters. Is that not a mathematical form?

请先登录,再进行评论。


Mario Malic
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 个评论
George Ghimire
George Ghimire 2020-10-6
Hi Mario i think i am only left with last two point. I can read text file and compare with my experimental curve. After that you said measure sort of measure to to describe difference between two curve and return to objective function. What is it exactly mean. Can you explain in bit detail these two points
Mario Malic
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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by