+ Post New Thread
Results 1 to 10 of 10
  1. #1
    Junior Member level 3
    Points: 387, Level: 4

    Join Date
    Oct 2017
    Posts
    27
    Helped
    0 / 0
    Points
    387
    Level
    4

    Run ADS simulation from Matlab?

    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: https://community.keysight.com/thread/25723 . 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.

  2. #2
    Advanced Member level 5
    Points: 16,042, Level: 30
    pancho_hideboo's Avatar
    Join Date
    Oct 2006
    Location
    Real Homeless
    Posts
    2,443
    Helped
    652 / 652
    Points
    16,042
    Level
    30

    Re: Run ADS simulation from Matlab?

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



    •   AltAdvertisement

        
       

  3. #3
    Junior Member level 3
    Points: 387, Level: 4

    Join Date
    Oct 2017
    Posts
    27
    Helped
    0 / 0
    Points
    387
    Level
    4

    Re: Run ADS simulation from Matlab?

    Quote Originally Posted by pancho_hideboo View Post
    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.



    •   AltAdvertisement

        
       

  4. #4
    Advanced Member level 5
    Points: 16,042, Level: 30
    pancho_hideboo's Avatar
    Join Date
    Oct 2006
    Location
    Real Homeless
    Posts
    2,443
    Helped
    652 / 652
    Points
    16,042
    Level
    30

    Re: Run ADS simulation from Matlab?

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



    •   AltAdvertisement

        
       

  5. #5
    Junior Member level 3
    Points: 387, Level: 4

    Join Date
    Oct 2017
    Posts
    27
    Helped
    0 / 0
    Points
    387
    Level
    4

    Re: Run ADS simulation from Matlab?

    Quote Originally Posted by pancho_hideboo View Post
    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.



  6. #6
    Advanced Member level 5
    Points: 16,042, Level: 30
    pancho_hideboo's Avatar
    Join Date
    Oct 2006
    Location
    Real Homeless
    Posts
    2,443
    Helped
    652 / 652
    Points
    16,042
    Level
    30

    Re: Run ADS simulation from Matlab?

    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.


    1 members found this post helpful.

    •   AltAdvertisement

        
       

  7. #7
    Advanced Member level 5
    Points: 13,443, Level: 27

    Join Date
    Apr 2014
    Posts
    2,086
    Helped
    846 / 846
    Points
    13,443
    Level
    27

    Re: Run ADS simulation from Matlab?

    Quote Originally Posted by SuBill View Post
    'hypeesofsim' is not recognized as an internal or external command, operable program or batch file.
    You have a typo in the command. It is hpeesofsim, not hypeesofsim


    1 members found this post helpful.

  8. #8
    Junior Member level 3
    Points: 387, Level: 4

    Join Date
    Oct 2017
    Posts
    27
    Helped
    0 / 0
    Points
    387
    Level
    4

    Re: Run ADS simulation from Matlab?

    Dear pancho and volker,

    Thank you very much for your valuable time and advices. I'm following this link 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 . . .



  9. #9
    Junior Member level 3
    Points: 387, Level: 4

    Join Date
    Oct 2017
    Posts
    27
    Helped
    0 / 0
    Points
    387
    Level
    4

    Re: Run ADS simulation from Matlab?

    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.



  10. #10
    Junior Member level 3
    Points: 387, Level: 4

    Join Date
    Oct 2017
    Posts
    27
    Helped
    0 / 0
    Points
    387
    Level
    4

    Re: Run ADS simulation from Matlab?

    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.



--[[ ]]--