How to control HFSS v11 from Matlab?
I?m interested in all the information about how to control HFSS v11 from Matlab.
The idea is introducing some parameters of design into HFSS from Matlab. Use HFSS for the simulation. Exporting the results from HFSS using Matlab, computing and optimizing, an going back to enter the variables into HFSS, etc
I have searched in the Internet, but I didn?t find anything very clear and not for HFSS version 11.
The same methods that are used for version 9 can be used in version 11?
Any help?
Thanks
I searched the webb and found the following link:
https://www.cresis.ku.edu/~rvc/proje....html#download
It is a number of free toolboxes where you can control HFSS by using Matlab. I haven't used any of them by my self but it could be a good start for you!
Dont forget press "helped me"
Thanks for your help, but in fact, I had already seen this page: I am looking for more information, specially about version 11 and something I have read about a COM interface.
I let here all the information I have been able to gather myself, but I need more help!!
Please!
https://www.edaboard.com/ftopic295234.html
https://www.edaboard.com/viewtopic.p...ht=matlab+hfss
http://www.ansoft.com/converge/waveguide_components.pdf
Thanks
What exactly do you want to control from Matlab and why?
Please be more specific!
Personally, I do not think it is worth the effort.
:D
I want to control HFSS via Matlab for the following purpose:
I want to simulate a geometric structure with HFSS. This device has some component that can be moved in the geometry, and the result will change.
The aim is to introduce three position vectors (x,y,z), move the geometry of that pieces, do the simulation, import the results to Matlab, treat the results, obtain the results which are interesting for us, optimize this results with an optimizer made by us in Matlab, and input again new position vectors in HFSS.
As I have said, we are using HFSSv11.
Any help?
In the document from ANSOFT : External Control of Ansoft HFSS v9:
For HFSS version 11, this example it has to be modified. The visual basic script, I mean.
line 11: Hfss has to be changed by HFSS
line 24:Geometry3DCmdTab --> LocalVariableTab
line 48: change wg_y='2in' by: "wg_y=" & Chr(39) & "2in" & Chr(39) & ""
About the matlab script, there are two functions I can't find in my Matlab version:
Do you have these functions?
Strip
file2str
any help?
I have not tried to use the COM interface for passing information from MATLAB to HFSS, but I can vouch for the HFSS API linked earlier. I used it to do exactly what you're trying. I implemented an optimization routine in MATLAB that varied parameters of the geometry. Once the parameters were set, my code used the functions in the API to create a VBScript that HFSS could read and executed HFSS with the script. This script generated the geometry, activated the simulation, and exported the results to a text file. Once the script finished, HFSS exited, and MATLAB read the result file to determine the next step in optimization. I believe that the examples directory in the API has a dipole optimization that could show you the basic structure of the routine.
The API was written for v9, but I've not had any problems running it under v10. I think it should work with v11 as well. If it won't, you just need to look at the VBScript specs, and modify the MATLAB functions. You can also use the API as a guide to implement more HFSS functions like discrete and fast sweeps.
I think the API is probably a simpler and clearer method than the COM implementation, but I don't know.
As for the "Strip" and "file2str" functions, I don't believe they are built-in MATLAB commands. I have no idea what "Strip" might do, but "file2str" probably reads an entire file into a single character vector. Googling "MATLAB function file2str" turns up a few implementations.
I have used the Matlab-HFSS API for a while, I found it provides a very good way to control HFSS.
I think the value of this API is it tells us how to control HFSS in matlab, although not all the functions implemented and some functions has some errors. But I can write my own APIs according to thess APIs.
here is some problems I met when using it.
1, the API may be not stable, for some times, it will pop-up error message and can't work. I don't know why. sometimes this problem can be solved by close the matlab and run it again, but sometimes it doesn't work anyway. I don't know why.
2, for the HFSS11, the vb scripts change a little, the most important change I think is the Output Variables script, I can't use the old API now, that makes many inconvinience, but I don't know how to modify the API, because Ansoft doesn't update their help document to HFSS11.
2,
I attach here the modifications I have done to both, the visual script and de matlab script for HFSS version 11. I think it works.
tyenergy,
I had some problems when running very long (several days) optimizations with the API because Windows Power Management would try to put the computer in standby. Windows thought it was idle because there was no user input, so the license server would shut down, causing HFSS to not be able to open at the next iteration. When I disabled power management, the routines ran for much longer with no issues. Maybe that's part of your issue #1?
it is a very useful topic.
where is the location of this api?
i am interested in this...
I'm interested in this api as well. Anybody can upload it here or give some pointers about where to download it?
thanx
Would it be easier to use optimisation / parametrisation features in HFSS?
i think it is useful to control HFSS, because we can make the simulation as programming.
can anyone upload the HFSS11's tutorial file "scripting.pdf".
Thanks for the script file that is uploadad. I am working on the same procedure, desgining a patch antenna in hfss and optimizing it with matlab. This topic will be very useful.
Hi tyenery,
I read that you already used the HFSS_API. Do you know where I can download it? The Kansas state link seems not to work. Do you still need the scripting manual with HFSS 11?
Thanks
can anyone share matlab calculator for the antennas ; cus i need to put matlab codes in my thesis
In my work with antenna ,I find this is a great help to my work .Thank you very much for sharing it !