Matlab-Ansys Maxwell interface for optimization error: Error using Interface.​4824CFB6_4​885_4ECF_B​6C8_314CC7​C0C148/Ope​nProject - Error: The remote procedure call failed.

조회 수: 13 (최근 30일)
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
supriya Naik
supriya Naik 2022년 5월 19일
@Georgios Krassakopoulos, Hello sir, Can you explain what is "Data Filter" in objective function matlab coding?
hou wa wong
hou wa wong 2022년 7월 29일
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.

댓글을 달려면 로그인하십시오.

답변 (1개)

Serhat Duman
Serhat Duman 2022년 3월 4일
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
Walter Roberson
Walter Roberson 2022년 5월 13일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by