Optimization of parameter in Matlab ?

49 visualizzazioni (ultimi 30 giorni)
George Ghimire
George Ghimire il 5 Ott 2020
Modificato: Mario Malic il 6 Ott 2020
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 Commenti
Mario Malic
Mario Malic il 6 Ott 2020
Modificato: Mario Malic il 6 Ott 2020
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 il 6 Ott 2020
Hi @Mario after simulation i already will have the simulated results in a folder. Now whats the next procedure

Accedi per commentare.

Risposte (2)

George Ghimire
George Ghimire il 6 Ott 2020
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 Commento
Alan Stevens
Alan Stevens il 6 Ott 2020
Your simulated curve is, presumably, constructed using your 10 parameters. Is that not a mathematical form?

Accedi per commentare.


Mario Malic
Mario Malic il 6 Ott 2020
Modificato: Mario Malic il 6 Ott 2020
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 Commenti
George Ghimire
George Ghimire il 6 Ott 2020
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 il 6 Ott 2020
Modificato: Mario Malic il 6 Ott 2020
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.

Accedi per commentare.

Categorie

Scopri di più su Problem-Based Optimization Setup in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by