Matlab-Ansys Maxwell interface for optimization error: Error using Interface.4824CFB6_4885_4ECF_B6C8_314CC7C0C148/OpenProject - Error: The remote procedure call failed.
13 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello,
I design an electric motor with Ansys Maxwell and in order to optimize it I have the optimization code writen in Matlab which I have coupled with Ansys Maxwell.
In every iteration of the optimization Matlab puts different values to the variables (according to the optimization method) I use for the design and sends them to Maxwell. Then Maxwell computes the FEA analysis and sends back the results to Matlab.
For my optimization I want to have 30 particles (code PSO) and 40 iterations, which means that there will be a bit more of 1200 FEA from Maxwell to be computed. Every time Matlab has the new variables ready it calls Maxwell to open the project I want to run the FEA on and after the computation is completed the results are sent to back Matlab and the Maxwell project cloeses. The project is called to open again for the next FEA and the same procedure continues until the end of the optimization.
The problem which comes up is this. After a number of iterations are completed, suddenly Matlab cannot call the Maxwell project to open and I get the fallowing error:
Error using Interface.4824CFB6_4885_4ECF_B6C8_314CC7C0C148/OpenProject
Error: The remote procedure call failed.
Error in ObjectiveFunction (line 13)
oProject = invoke(oDesktop,'OpenProject',[project_path project_name '.aedt']);
Error in PSO_myTry_withParameters (line 100)
Run_objF = fobj(currentX);
Error in main (line 27)
[ GBEST , cgcurve , objective_total ] = PSO_myTry_withParameters( noP , maxIter, problem , visFlag) ;
This depending on the optimization code used each time happens at a different iteration. For example, when I use PSO (30 particles - 40 iterations) happens during the 20th iteration, although it has started computing FEA normally in that iteration. Also, in 3 different computers it occured in the same iteration, during the 20th. In that iteration about 570 FEA have been computed by Maxwell and 570 times the project has been opened and closed.
Acoording to the above error it is Matlab that cannot continue working properly. At first I thought that I may keep a lot of information in arrays and probably after a number of info stored Matlab crashes, so I put the code to keep as less info as possible but still the same problem occured.
I also changed the path of the Maxwell problem and put it in the same folder with the Matlab scripts but again the problem occured.
Has anyone come up with a similar problem? Can anyone help me with this inconvenience?
Thank you beforehand.
15 comentarios
supriya Naik
el 19 de Mayo de 2022
@Georgios Krassakopoulos, Hello sir, Can you explain what is "Data Filter" in objective function matlab coding?
hou wa wong
el 29 de Jul. de 2022
hi, i also used the PSO to optimize by using maxwell and matlab. The reason why the RAM become large every time iteration increasing, is that there is a ansys lincense problem. you can just restart the maxwell. For me, i used below command
Desktop.QuitApplication;
clear iMaxwell
clear Desktop
here, you must clear the iMaxwell and Desktop, otherwise, you cannot use command to open maxwell again.
Respuestas (1)
Serhat Duman
el 4 de Mzo. de 2022
I taken error as follow:
Error using Interface.2F9C9B95_5169_4291_A70B_5F095D3FEFA6/invoke
Check for incorrect argument data type or missing argument in call to function 'SetVariableValue'.
How can I define the variable from matlab to ansys?.
9 comentarios
Walter Roberson
el 13 de Mayo de 2022
I do not know.
In http://www.edatop.com/hfss/32309.html it appears that for that software the cause is a resource being used by a different program.
Ver también
Categorías
Más información sobre Introduction to Installation and Licensing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!