Menu

Command line interface / API / Python wrapper

2013-07-04
2023-03-14
  • David Bleloch

    David Bleloch - 2013-07-04

    Hi, splendid piece of software, many thanks. I'd like to invoke a BEM ideally from within a Python environment, but can't see any details in the help about running the solver outside of the Tk GUI. Can you help me out please?

     
  • Tom Li

    Tom Li - 2023-03-14

    I know this is an old thread and that the project is unmaintained. But as another user of TNT-MMTL, I think it's useful to answer this question.

    BEM can be invoked manually in the command-line by running the executable "bem" with the following command-line arguments:

    bem <filename> <c-seg> <p-seg>
    <filename> - name of the graphic file
    <c-seg>    - number of contour segments
    <p-seg>    - number of plane/dielectric segments
    

    <filename> is the xsctn file generated by MMTL, without the .xsctn extension name.

    After running MMTL, the simulation output file is written to the same directory.

    It should be pretty easy just to take a look at the xsctn file and programmatically generate it. For example, this is the xsctn file of a microstrip. The meaning of the options and commands in the file are mostly self-explanatory.

    package require csdl
    
    set _title "Example Two Conductor Microstrip"
    set ::Stackup::couplingLength "2.54e-006"
    set ::Stackup::riseTime "250"
    set ::Stackup::frequency "1e9"
    set ::Stackup::defaultLengthUnits "mils"
    set CSEG 10
    set DSEG 10
    
    GroundPlane ground  \
         -thickness 3 \
         -yOffset 0.0 \
         -xOffset 0.0
    DielectricLayer fr4  \
         -thickness 50 \
         -lossTangent 0.0 \
         -permittivity 4.7 \
         -permeability 1.0 \
         -yOffset 0.0 \
         -xOffset 0.0
    RectangleConductors c1  \
         -width 12 \
         -pitch 20 \
         -conductivity 5.0e7S/m \
         -height 3 \
         -number 2 \
         -yOffset 0 \
         -xOffset 0
    

    Unfortunately, the output file is in plaintext and it's not machine-readable. Try parsing it with some regular expressions. I have a plan to write a fork of TNT-MMTL and add support for machine-readable json output.

     

Log in to post a comment.