+ Post New Thread
Page 2 of 2 FirstFirst 1 2
Results 21 to 37 of 37
  1. #21
    Full Member level 5
    Points: 2,939, Level: 12

    Join Date
    Jul 2004
    Posts
    250
    Helped
    30 / 30
    Points
    2,939
    Level
    12

    mathlab hfss

    has anybody got working examples on antenna in HFSS11 not earlier versions



    •   AltAdvertisement

        
       

  2. #22
    Newbie level 6
    Points: 1,519, Level: 8

    Join Date
    Jun 2007
    Posts
    14
    Helped
    13 / 13
    Points
    1,519
    Level
    8

    hfss11.2 download

    Hi,
    This is the famous HFSS-API. It works well with HFSS9x. You could just follow these examples, and adapt them to HFSS11.

    Have fun!


    1 members found this post helpful.

  3. #23
    Newbie level 5
    Points: 1,172, Level: 7

    Join Date
    Jan 2008
    Posts
    10
    Helped
    1 / 1
    Points
    1,172
    Level
    7

    matlab api hfss

    very useful!!!



  4. #24
    Junior Member level 3
    Points: 2,613, Level: 11

    Join Date
    Mar 2006
    Posts
    25
    Helped
    5 / 5
    Points
    2,613
    Level
    11

    matlab hfssv11

    hi couless
    thanks for your kindness,
    but i found that the script.pdf file you uploaded is the same as my own.
    ansoft didn't update their this file correctly.

    the outputvariable script has been deprecated as indicated in HFSS, although it still works.

    i try to implement an API to export the network parameters, such as S,Y,Z,Gamma,Zo, just like the built-in script "oModule.ExportNetworkData"

    but I can only export the results of the first frequency point, the later ones are all outflow, i don't know why



  5. #25
    Member level 2
    Points: 1,635, Level: 9

    Join Date
    Jul 2008
    Posts
    53
    Helped
    1 / 1
    Points
    1,635
    Level
    9

    hfss-api

    abc


    1 members found this post helpful.

    •   AltAdvertisement

        
       

  6. #26
    Newbie level 4
    Points: 1,557, Level: 9

    Join Date
    Jun 2004
    Posts
    6
    Helped
    0 / 0
    Points
    1,557
    Level
    9

    hfss matlab scripting

    i try to optim antenna using PSO with HFSS



    •   AltAdvertisement

        
       

  7. #27
    Newbie level 5
    Points: 882, Level: 6

    Join Date
    Apr 2008
    Posts
    9
    Helped
    3 / 3
    Points
    882
    Level
    6

    hfss-matlab

    Quote Originally Posted by tyenergy
    i try to implement an API to export the network parameters, such as S,Y,Z,Gamma,Zo, just like the built-in script "oModule.ExportNetworkData"
    but I can only export the results of the first frequency point, the later ones are all outflow, i don't know why
    You can implement an API to create a report and extract its data. I did it and it worked.



  8. #28
    Newbie level 4
    Points: 1,282, Level: 8

    Join Date
    Sep 2009
    Location
    VietNam
    Posts
    5
    Helped
    0 / 0
    Points
    1,282
    Level
    8

    Re: hfss-matlab

    Quote Originally Posted by danieldani
    You can implement an API to create a report and extract its data. I did it and it worked.
    Did you build a function which can report Gain of antenna? Can you upload this function? Thanks :)



  9. #29
    Newbie level 2
    Points: 481, Level: 4

    Join Date
    May 2010
    Location
    USA
    Posts
    2
    Helped
    3 / 3
    Points
    481
    Level
    4

    Re: MATLAB-HFSSv11

    This post has not been active for some time, but I haven't seen this information mentioned elsewhere; I will post it in the hopes that it is useful for someone.

    Instead of generating VBscript code as text, writing it to a file, then executing in HFSS as the oft-mentioned MATLAB-HFSS api operates, the current version of MATLAB supports COM objects directly. This means that Matlab scripts and functions can be created to directly execute and control HFSS live, without the delay caused by generating and executing a script. This is very handy for debugging purposes and the original design of the scripts.

    (Note - I don't know which versions of Matlab support COM objects. I feel as though it is a relatively new feature ( I use R2009a ), but I don't remember.)

    (Another note - since the real interface is the collection of COM objects and the methods that they implement, any programming language/framework that supports COM interop would work to control HFSS, not only Matlab and VBscript)

    All of the same objects and function calls as the VBscript version will apply. The only difference between the vbscript and the Matlab version of the interface is different calling semantics.

    For example: Where the vbscript uses an Array(...) in a method signature, use a cell array {..} in matlab. Use single quotes instead of double quotes. Wrap all of the arguments to the functions in parentheses, unlike the VB convention. Boolean values in matlab to be passed to HFSS functions can be either in Matlab booleans (true, false), or in string format ('true','false').

    Here are some examples of how to translate between VB to matlab:

    The setup code is nearly the same:
    Code:
    hfss = actxserver('AnsoftHfss.HfssScriptInterface');
    desktop = hfss.GetAppDesktop();
    project = desktop.GetActiveProject();
    design = project.GetActiveDesign();
    editor = design.SetActiveEditor('3D Modeler');
    boundary = design.GetModule('BoundarySetup');
    Calling functions to modify the geometry is also very similar, except for the syntactic differences required by matlab. For example, the Box and Move commands:

    Code:
    %name = HFSSBox(editor,name,position,size,varargin)
    %name/value parameters: Material, Color, SolveInside,Transparency
    function var = HFSSBox(editor,name,position,size,varargin)
    
        p = inputParser;
        p.addParamValue('Material','pec');
        p.addParamValue('Color','(132 132 193)');
        p.addParamValue('SolveInside',false);
        p.addParamValue('Transparency',0);
        p.parse(varargin{:});
        mm = @(x)sprintf('%0.4fmm',x);
        var = editor.CreateBox({'NAME:BoxParameters','CoordinateSystemID:=',-1,...
                'XPosition:=',mm(position(1)),'YPosition:=',mm(position(2)),'ZPosition:=',mm(position(3)),...
                'XSize:=',mm(size(1)),'YSize:=',mm(size(2)),'ZSize:=',mm(size(3))},...
                {'NAME:Attributes','Name:=',name,'Flags:=','','MaterialName:=',p.Results.Material,...
                'SolveInside:=',false,'Color:=',p.Results.Color,'Transparency:=',p.Results.Transparency,...
                'PartCoordinateSystem:=','global'});
    
    end

    Code:
    %HFSSMove(editor,name,vector)
    %Arguments:
    %   editor: HFSS Editor COM object
    %   name: Name of object to be moved
    %   vector: [x,y,z] movement vector.
    function HFSSMove(editor,name,vector)
    
        error(nargchk(3,3,nargin,'struct'));
        mm = @(x)sprintf('%0.4fmm',x);
        editor.Move({'NAME:Selections','Selections:=',name},{'NAME:TranslateParameters',...
            'TranslateVectorX:=',mm(vector(1)),'TranslateVectorY:=',mm(vector(2)),...
            'TranslateVectorZ:=',mm(vector(3))});
        
    end
    I am using this interface for extensive HFSS automation for creating complex parametrized geometry, and am building a library of wrapper functions by adding new functions as I need them. My code has functioned identically on HFSS 11.2 and 12.1.


    3 members found this post helpful.

  10. #30
    Full Member level 2
    Points: 2,452, Level: 11
    Achievements:
    7 years registered

    Join Date
    Apr 2010
    Posts
    132
    Helped
    89 / 89
    Points
    2,452
    Level
    11

    Re: MATLAB-HFSSv11

    There is no easy way of optimizing antenna structure using your own generic algorithm in Matlab.I have successfully modelled and simulated my antenna structure in HFSS.Now i just want to Export this structure to Matlab so i can optimize it using some generic algorithm e.g PSO algorithm. There is no way or File format in which we can export the structure to matlab from HFSS.Is it a must to use VBS scripting language for this purpose and there is no other way???



  11. #31
    Newbie level 1
    Points: 427, Level: 4

    Join Date
    Jul 2010
    Posts
    1
    Helped
    0 / 0
    Points
    427
    Level
    4

    Re: MATLAB-HFSSv11

    Do you know any method that can save HFSS result by Matlab?
    I executed Eigenmode calculation in HFSS controlled by Matlab code as follows.

    Code:
    oAnsoftApp=actxserver('AnsoftHfss.HfssScriptInterface.12');
    oDesktop=oAnsoftApp.GetAppDesktop;
    oProject=oDesktop.NewProject;
    oDesign=oProject.InsertDesign('HFSS', 'HFSSDesign1','DrivenModal', '');
    oEditor=oDesign.SetActiveEditor('3D Modeler');
    
    ...........
    
    oDesign.Analyze('Setup1');
    But, I don't know how to save result.
    I made codes as follows but error message appears.

    Code:
    oSolutions=oDesign.GetModule('Solutions');
    invoke(oSolutions,'ExportEigenmodes','Setup1', '', 'C:\Documents and Settings\sh\My Documents\Ansoft\eig1.eig')
    If there is any good idea to solve this problem, please let me know.



  12. #32
    Newbie level 2
    Points: 481, Level: 4

    Join Date
    May 2010
    Location
    USA
    Posts
    2
    Helped
    3 / 3
    Points
    481
    Level
    4

    Re: MATLAB-HFSSv11

    Quote Originally Posted by H.K.
    Do you know any method that can save HFSS result by Matlab?
    I executed Eigenmode calculation in HFSS controlled by Matlab code as follows.

    [...]

    But, I don't know how to save result.
    I made codes as follows but error message appears.

    Code:
    oSolutions=oDesign.GetModule('Solutions');
    invoke(oSolutions,'ExportEigenmodes','Setup1', '', 'C:\Documents and Settings\sh\My Documents\Ansoft\eig1.eig')
    What is the error message? Remember to check the HFSS error console for more detailed error messages than appear in the Matlab terminal.

    Most of the data export to file commands can be found in the script recorder and translated to Matlab. I haven't used this function, however, so I would need to have a better idea of the error message to be of any more assistance.

    Another resource is to look in the HFSS scripting help documentation for the function you are working with. Their example code for this function:

    Code:
    Set oModule = oDesign.GetModule("Solutions")
    oModule.ExportEigenmodes "Setup1 : LastAdaptive", "", _
    "C:\mydir\myeigenmode" & _ 
    ".eig"
    They use "Setup1 : LastAdaptive" instead of simply "Setup1"; Could that be an issue?



  13. #33
    Member level 1
    Points: 774, Level: 6

    Join Date
    Dec 2009
    Posts
    41
    Helped
    1 / 1
    Points
    774
    Level
    6

    Re: hfss 和matlab

    Quote Originally Posted by isilb View Post
    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.
    Hello Isilb,

    I'm working on designing a patch array antenna using HFSS and I want to ingrate SPST switch to make short and long range. Do you have any idea how to implement this? I'm a newbie and I just started working on it.

    Thanks,



  14. #34
    Full Member level 3
    Points: 3,033, Level: 12
    Achievements:
    7 years registered

    Join Date
    Feb 2007
    Location
    WhiteHouse
    Posts
    183
    Helped
    15 / 15
    Points
    3,033
    Level
    12

    Re: MATLAB-HFSSv11

    Hello; has someone a book about this prob? thanks.



    •   AltAdvertisement

        
       

  15. #35
    Newbie level 2
    Points: 397, Level: 4

    Join Date
    Oct 2010
    Posts
    2
    Helped
    0 / 0
    Points
    397
    Level
    4

    Re: hfss matlab ink

    Quote Originally Posted by svia View Post
    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.
    The program is useful for me.After read it,I know how to use it!



  16. #36
    Newbie level 4
    Points: 364, Level: 4

    Join Date
    Jan 2011
    Posts
    6
    Helped
    0 / 0
    Points
    364
    Level
    4

    Re: hfss 和 matlab

    hii..
    im new to hfss.rght now im learing how to write the files i mean only some files are there relted to matlab hfss api.so i need the steps how to run it.
    i know the commands but im not understanding to generate it.
    can u please help me



  17. #37
    Junior Member level 3
    Points: 1,626, Level: 9
    Achievements:
    7 years registered

    Join Date
    Apr 2010
    Location
    Pakistan
    Posts
    26
    Helped
    0 / 0
    Points
    1,626
    Level
    9

    Re: hfss 和 matlab

    samyuk!

    I am also having the same problem. Have you found the solution? Or can anyone tell us how to do it?

    ---------- Post added at 07:50 ---------- Previous post was at 07:29 ----------

    I am having this error, when I run code in MATLAB
    First it says


    The Initial Dipole Length is 1.00 meter ...
    Running iteration #1 ...
    Creating the Script File ...


    then it says

    ??? Error using ==> fprintf
    Invalid file identifier. Use fopen to generate a valid file identifier.

    Error in ==> hfssNewProject at 36
    fprintf(fid, 'Dim oHfssApp\n');

    Error in ==> example_antenna at 61
    hfssNewProject(fid);



--[[ ]]--