Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

HFSS - MATLAB - Exporting Matrix Data

Status
Not open for further replies.

Jasmin1212

Newbie level 3
Joined
Jun 23, 2008
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,332
export matrix matlab

Hello,

I am simulating an optimization in HFSS. I start the simulation within matlab and wrote an appropriate script file. The optimization is working good, but I have a problem with exporting the matrix data.

HFSS always writes the following error message:
Script Error (Code 80070203) in file: X.vbs
Description: Solution data is not available for %s:%s. It was either not solved or was made invalid by subsequent design changes.
Line(X): "oModule.ExportNetworkData_"


I know that the solution is always been solved.
Did anyone of you experience such a problem and can help me?

Best regards,
Jasmin
 

export matrix to file matlab

Are you following these steps properly: (done on HFSS v10.1)


Right Click "Results" and Select "Solution Data"

Click on "Matrix Data" Tab

Click on "Export Matrix Data.." Button

Save it as an M-File


This has always worked fine for me, you may want to try re-installing HFSS?
 

export a matrix from matlab

Exporting a file in HFSS works really good, but I have a problem with exporting the results of HFSS using MATLAB.

I use the matlab function "hfssExportNetworkData.m" from the HFSS API which I found in the internet:

% Copyright 2004, Vijay Ramasami (rvc@ku.edu)

function hfssExportNetworkData(fid, fileName, setupName, sweepName, ...
varargin)

% Export File Type - default is MATLAB.
if (length(varargin) > 0)
expFileType = varargin{1};
else
expFileType = 'm';
end;

% Renormalizing Impedance.
if (length(varargin) > 1)
renormZ = varargin{2};
else
renormZ = 50.0;
end;

% Export File Type Switch.
switch (expFileType)
case 'h', expType = 1;
case 't', expType = 2;
case 's', expType = 3;
case 'c', expType = 4;
case 'm', expType = 7;
case 'z', expType = 8;
otherwise, error('Export File Type Unknown !');
end;

% The usual fprintf()'s
fprintf(fid, '\n');
fprintf(fid, 'Set oModule = oDesign.GetModule("Solutions")\n');
fprintf(fid, 'oModule.ExportNetworkData _\n');
fprintf(fid, ' "", _\n');
fprintf(fid, ' Array("%s:%s"), _\n', setupName, sweepName);
fprintf(fid, ' %d, _\n', expType);
fprintf(fid, ' "%s", _\n', fileName);
fprintf(fid, ' Array("All"), _\n');
fprintf(fid, ' true, _\n');
fprintf(fid, ' %.2f \n', renormZ);
 

hfss matrix data

For those who are interested in the solution...

Rewrite the function "hfssExportNetworkData.m":
(eps, Leitfaeh, tanDelta are the variables which are determined by HFSS Optimization.)

function hfssExportNetworkData_Opt(fid, fileName, setupName, sweepName, path, ...
varargin)

% Export File Type - default is MATLAB.
if (length(varargin) > 0)
expFileType = varargin{1};
else
expFileType = 'm';
end;

% Renormalizing Impedance.
if (length(varargin) > 1)
renormZ = varargin{2};
else
renormZ = 50.0;
end;

% Export File Type Switch.
switch (expFileType)
case 'h', expType = 1;
case 't', expType = 2;
case 's', expType = 3;
case 'c', expType = 4;
case 'm', expType = 7;
case 'z', expType = 8;
otherwise, error('Export File Type Unknown !');
end;

fprintf(fid, '\n');
% Get the project variables values:
fprintf(fid, 'eps = oProject.GetVariableValue("$eps") \n');
fprintf(fid, 'Leitfaeh = oProject.GetVariableValue("$Leitfaeh") \n');
fprintf(fid, 'tanDelta = oProject.GetVariableValue("$tanDelta") \n');


% The usual fprintf()'s
fprintf(fid, '\n');
fprintf(fid, 'Set oModule = oDesign.GetModule("Solutions")\n');
fprintf(fid, 'oModule.ExportNetworkData _\n');
fprintf(fid, ' "$Leitfaeh=''" + Leitfaeh + "'' $eps=''" + eps + "'' $tanDelta=''" + tanDelta + "''", _\n');
fprintf(fid, ' Array("%s:%s"), _\n', setupName, sweepName);
fprintf(fid, ' %d, _\n', expType);
fprintf(fid, ' "%s", _\n', fileName);
fprintf(fid, ' Array("All"), _\n');
fprintf(fid, ' true, _\n');
fprintf(fid, ' %.2f \n', renormZ);
 

matlab matrix exportieren

my opinion

the current hfss-api can export the result when the variables are not defined in HFSS.
if the variables exist in HFSS, the export script should specify the corresponding variables you want export, just as you did above.

another simple solution is to define the variables in matlab rather than in hfss, and do the optimization in matlab, avoiding using variables in hfss.

this is what i have done in research.
 

varargin matlab

I agree with you, when you are recommending "define the variables in matlab rather than in hfss... and do the optimization in matlab... avoiding using variables in hfss".

The last optimization I did (optimizing dipole length and width), I did in Matlab. I defined the variables in Matlab and it was a lot more comfortable to do so, than to optimize directly in HFSS.
 

matrix filetype m

perform the whole routine you are trying to do manually, but with record script on.
and then play with vbs that HFSS creates for you.
i personally think VBS can be really easy, if you first record the macro, and play with variable.

also another thing, are the variable names you set on HFSS the same as what the API is trying to read?
The experience I had is that my solution name was completely different from what was in the script, and basically, my data was junk.
 

export variable matlab

hi Jasmin
whould you please upload your hfss file. i have some error in simulation of dipole.
 

export the data of hfss to matlab

I have been used toobox delivered by Vijay Ramasami for connecting Matlab and HFSS.However,when I run the example:dipole_example,it seems to me that the results have problem
-The simulated resonant frequency of dipole doesn't change through different iterations->I guest it is due to the results have not been updated through iterations

Does anyone experiences similar problems?Could you help me overcome this trouble?
At the moment,I am assigned the mission to develop GA optimizers to optimize antenna design.If anyone find it of interest,could you discuss with me at haidt102@yahoo.com

Thanks in advance
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top