SOL 145 (Flutter) - F06 Utility Units

107 views
Skip to first unread message

Joaquin Gutierrez

unread,
Sep 1, 2023, 11:40:49 AM9/1/23
to pyNastran Discuss
Hi!
I'm new to pyNastran. I was able to install and run the command to get a g-V and f-V plots.

f06 plot_145 run031-000.f06 --eas

Now, if I try the following I get an error:

f06 plot_145 run031-000.f06 --eas --out_units english_kt

Error:
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\JGUTIERREZ\anaconda3\Scripts\f06.exe\__main__.py", line 7, in <module>
  File "C:\Users\JGUTIERREZ\anaconda3\Lib\site-packages\pyNastran\f06\utils.py", line 315, in cmd_line
    cmd_line_plot_flutter(argv=argv, plot=plot, show=show, log=log)
  File "C:\Users\JGUTIERREZ\anaconda3\Lib\site-packages\pyNastran\f06\utils.py", line 119, in cmd_line_plot_flutter
    out_units = data['OUT'].lower()
                ~~~~^^^^^^^
KeyError: 'OUT'


I checked the syntaxis and it seems to match the options listed in f06 --help.

Lastly, the tool is great (copy pasting from the f06 file is boring), but the model I'm working on is in SI mm (mm,Mg,s) units. Would it be difficult to add support for this unit system? (not sure if this request belongs here or in GitHub)

Thanks in advance,

Joaquin

Steven Doyle

unread,
Sep 1, 2023, 5:22:30 PM9/1/23
to pynastra...@googlegroups.com
Ooof…yeah docopt had a lot of trouble with that one.  It’s putting the out_units in the in_units slot and the out_units are None.  The flags that specify what you used (so out in this case is set right).

I’d just specify the in_units.  It’ll probably just work, but yeah, time to retire that interface.

--
You received this message because you are subscribed to the Google Groups "pyNastran Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pynastran-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pynastran-discuss/03f36c5b-ae82-4b82-bb9c-566e568866c9n%40googlegroups.com.

Steven Doyle

unread,
Sep 2, 2023, 2:13:35 AM9/2/23
to pynastra...@googlegroups.com
It might also be docopt-ng version specific.  I just tried on 0.9.0 (vs. 0.8.x) and it works fine.

I threw in a check on the docopt version.

Joaquin Gutierrez

unread,
Sep 5, 2023, 11:54:36 AM9/5/23
to pyNastran Discuss
Hi Steve,

I checked docopt and I'm on v0.9.0.

I tried specifying only in units and I get a similar error...

f06 plot_145 run033-000.f06 --in_units SI

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\JGUTIERREZ\anaconda3\Scripts\f06.exe\__main__.py", line 7, in <module>
  File "C:\Users\JGUTIERREZ\anaconda3\Lib\site-packages\pyNastran\f06\utils.py", line 315, in cmd_line
    cmd_line_plot_flutter(argv=argv, plot=plot, show=show, log=log)
  File "C:\Users\JGUTIERREZ\anaconda3\Lib\site-packages\pyNastran\f06\utils.py", line 114, in cmd_line_plot_flutter
    in_units = data['IN'].lower()
               ~~~~^^^^^^


Regarding the other question of accepting SI-mm units as input, would this be hard to implement? I took a quick look a the F06 source code and I don't think is defined there....

Cheers,

Joaquin

Steven Doyle

unread,
Sep 5, 2023, 2:32:47 PM9/5/23
to pynastra...@googlegroups.com
Ahh, you’re probably on 1.3.4.  Try docopt 0.8.2, which was the latest version at the time that 1.3.4 was released.  The latest dev version supports both.

I was suggesting you list both in and out units.

Regarding units, you can specify a dictionary of units  if you call the make_flutter_response function directly vs using the string on the command line.

Joaquin Gutierrez

unread,
Sep 7, 2023, 2:36:32 PM9/7/23
to pyNastran Discuss
Steve,

I added the right units to convert.py and now I can run make_flutter_response using SI-mm. I still need to read the docs on how to fork, branch and create a pull request.

Example:

myF06='run037-000.f06'
f06_units={'velocity' : 'mm/s', 'density' : 'Mg/mm^3',
                      'altitude' : 'ft', 'dynamic_pressure' : 'MPa','eas':'mm/s'}
out_units= out_units = {'velocity' : 'knots', 'density' : 'kg/m^3',
                      'altitude' : 'ft', 'dynamic_pressure' : 'MPa','eas':'knots'}
c=parse_flutter.make_flutter_response(f06_filename=myF06,f06_units=f06_units,out_units=out_units)
d=parse_flutter.make_flutter_plots(modes=[range(1,15+1)],flutters=c,plot_type='tas',
                                  xlim=0.0, ylim_damping=[-0.1,0.1], ylim_kfreq=[0.0,1000.0], ylim_freq=[0.0,1000.0],
                                    plot_vg=False, plot_vg_vf=True, plot_root_locus=False,
                                      plot_kfreq_damping=False,nopoints=False,noline=False,legend=True)


The downside is that the png that is created is pretty low res compared to the one created using f06 plot_145 on the command line. I can't figure out where is the source code for "f06". Is the binary file installed here "C:\Users\...\anaconda3\Scripts\f06.exe"?
I would like to see if I can define in_units "SI-mm".

Figure 2023-09-07 113515.png

Lastly, I tried using the optional argument "vg_vf_filename" but I get an error (Ideally I would like to Include the F06 name in the plot, but at least I'd like to have it on the file, so I can identify which f06 does the plot belong to):

Code:
e=parse_flutter.make_flutter_plots(modes=[range(1,15+1)],flutters=c,plot_type='tas',
                                   xlim=0.0, ylim_damping=[-0.1,0.1], ylim_kfreq=[0.0,1000.0], ylim_freq=[0.0,1000.0],
                                     plot_vg=False, plot_vg_vf=True, plot_root_locus=False,
                                       plot_kfreq_damping=False,nopoints=False,noline=False,legend=True,vg_vf_filename=myF06.rsplit( ".f06", 1 )[ 0 ]+'.png')


Error Msg:
Traceback (most recent call last):

  File ~\anaconda3\Lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec
    exec(code, globals, locals)

  File c:\...\manual_flutter_plots.py:20
    e=parse_flutter.make_flutter_plots(modes=[range(1,15+1)],flutters=c,plot_type='tas',

  File c:\github\pynastran\pyNastran\f06\parse_flutter.py:460 in make_flutter_plots
    _make_flutter_subcase_plot(

  File c:\github\pynastran\pyNastran\f06\parse_flutter.py:513 in _make_flutter_subcase_plot
    filenamei = None if vg_vf_filename is None else vg_vf_filename % subcase

TypeError: not all arguments converted during string formatting


Thanks,

Joaquin

Joaquin Gutierrez

unread,
Sep 7, 2023, 3:03:48 PM9/7/23
to pyNastran Discuss
Steven,

It seems that the filename error is caused by an old formatting syntax.

After replacing "% subcase" by "+ str(subcase)" on parse_flutter.py it works.

Joaquin

Steven Doyle

unread,
Sep 7, 2023, 4:25:21 PM9/7/23
to pynastra...@googlegroups.com
Thanks for the bug fix!

Regarding image quality, if you use the FlutterResponse class you can pass a figure into plot_vg_vf.  Once you it comes back, you can save it with whatever dpi you want.

The exe is not an exe.  It’s just spoofed for Windows.  It’s an import that goes into site-packages and runs the cmd_line tool.  It’s just regular python code in there.

Reply all
Reply to author
Forward
0 new messages