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.

[SOLVED] Run ADS simulation from Matlab?

Status
Not open for further replies.

SuBill

Junior Member level 3
Joined
Oct 4, 2017
Messages
27
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
308
I know some posts have mentioned about cosimulation between Matlab and ADS Plotemy, but what I need is to run a basic ADS simulation (HB simulation for example) from matlab, so that I can control the optimization from matlab, I guess.

I've also read this thread: **broken link removed** . I tried the command "hypeesofsim netlist.log" in matlab in the same folder of the netlist.log file, but Matlab couldn't compile the command. This is the error: Undefined function or variable 'hypeesofsim'.

Any advices are highly appreciated. Thank you for your time.
 

You can run ADSsim from command Line.
So use system() function in MATLAB.

Dear pancho_hideboo,

Thank you very much for your advice. I've tried the following commands in a Matlab script:
Code:
command = 'hypeesofsim netlist.log';
status = system(command);

And the results:
'hypeesofsim' is not recognized as an internal or external command, operable program or batch file.
 

Simply you don’t include ADS directory in command search path.
What operating system do you use ?
You have to set environment variable.
 

Simply you don’t include ADS directory in command search path.
What operating system do you use ?
You have to set environment variable.

Oh that should be. I'm using Windows 10 and ADS 2015.01. Could you please send me some tutorials how to set environment variables to include ADS directory in command search path? Thank you very much.
 

See windows10 beginners book.

Instead of setting environment variable in operating system, you might add ADS directory in Matlab search path, although I don’t prefer this.
 
  • Like
Reactions: SuBill

    SuBill

    Points: 2
    Helpful Answer Positive Rating
Dear pancho and volker,

Thank you very much for your valuable time and advices. I'm following **broken link removed** to creat a bat file to set the environment variable and run the netlist.log.

Here is my bat file
Code:
set HPEESOF_DIR=C:/Program Files/Keysight/ADS2015_01
set COMPL_DIR=%HPEESOF_DIR%
set SIMARCH=win32_64
set SVECLIENT_DIR=%HPEESOF_DIR%/SystemVue/2014.10/%SIMARCH%

path %HPEESOF_DIR%\bin;%HPEESOF_DIR%\lib\%SIMARCH%;%HPEESOF_DIR%\circuit\lib.%SIMARCH%;%HPEESOF_DIR%\adsptolemy\lib.%SIMARCH%;%PATH%;.
path %SVECLIENT_DIR%/bin/MATLABScript/runtime/win64;%SVECLIENT_DIR%/sveclient;%PATH%

hpeesofsim netlist.log
dds Half_wave_Rect.ds
pause

So now I can run the simulation by double clicking this file. I only need to find out how to run this file from matlab.
The remaining problem is that I couldn't open the Data Display to execute the equations so that I can export the results to external files using write_var() function. I supposed the command "dds Half_wave_Rect.ds" would do this, but nothing happened. Is there any suggestions?

- - - Updated - - -

I made a mistake. The simulation was not successful as I thought previously. I checked by outputting a parameter by using the MeasEqn block and nothing was outputted after the .bat file was run. Here is the report in the command window. Can anyone tell me what I did wrong?

Code:
hpeesofsim (*) 430.shp Dec  7 2014
    (64-bit windows built: 12/07/14 09:11:55)
Copyright Keysight Technologies, 1989-2015.

Parsing the netlist...
Flattening the netlist...

HB HB2[1] <netlist.log>   Pin=(-20->20)

Warning detected by hpeesofsim during DC analysis `HB2'.
    Capacitor `C4' C=0.001 is unusually large.
.................................................................................................................................................................................................................................................................................................................................................................................................................

HB HB3[1] <netlist.log>   F0=915e+06
Port 1 has power at 9.15e+08 Hz
Port 2 has power at 9.15e+08 Hz

Driving port 1.
.
Driving port 2.
.
Evaluating unattached measurement equations ...
Flushing unattached measurement equation results ...
Checking for unresolved variables ...
Flushing data (please wait) ...
Flushing unattached measurement equation results ...
     ... data flush done.

Resource usage:
  Total stopwatch time     =     3.44 seconds.


G:\ADS_Simulation\Rectifier_Topo_wrk>dds Half_wave_Rect.ds

G:\ADS_Simulation\Rectifier_Topo_wrk>pause
Press any key to continue . . .
 

I'm terribly sorry to bother you this much. I've just found out the parameter was outputted in the same folder of the schematic. So that's mean my bat file did work. However it seemed that the dataset was not generated, and I could not open/display the dataset file (.ds) using the command line. Any help is highly appreciated.
 

Finally I found a way to input variables and results to matlab by using the Matlab Output block in the schematic. I don't need the dataset, although I still do not know how to display or read the dataset. My problem has been temporarily solved. Thank you very much for all of your usefull hints.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top