can the .csv and .m files be created from the command prompt?

85 views
Skip to first unread message

Eduardo Olmos

unread,
Aug 13, 2021, 10:26:05 PM8/13/21
to OpenVSP
Hi Rob
I am working on a Multidisciplinary Design Optimization for my degree work. I am doing the program from MATLAB, and it must call OpenVSP to deliver data about the CL and CD of a wing. 
To do this, I have to enter in the command prompt the .csv and .m files that represent the 3D wing geometry. However, my optimization makes me change the geometrical parameters of the wing, such as wingspan, sweep angle, chord, etc. 
My question is, can the .csv and .m files be created from the command prompt? 
I just need that to be able to perform my optimization. 
Thanks
Nice to meet you, Eduardo 

Rob McDonald

unread,
Aug 14, 2021, 12:53:47 AM8/14/21
to ope...@googlegroups.com
It sounds like you're using the DegenGeom output.

There are a few ways to go.

The most simple would be to write a short (say six line) script in OpenVSP's built-in scripting language.  You can run that from the command line to generate your files.

You would probably also want to use the DesignVar capability that makes changing parameters in an optimization setting simple.

If you want to get more sophisticated, you could compile OpenVSP with a binding to Matlab that would allow you to access OpenVSP's capabilities directly from an API via Matlab.  You could use that to trigger any action - including writing out the DegenGeom files.  Or, you can even access the DegenGeom information directly in memory.

Name this file degen.vspscript

void main()
{
    //==== Set File Name ====//
    SetComputationFileName( DEGEN_GEOM_M_TYPE, "DegenOutput.m" );

    //==== Run Degen Geom ====//
    ComputeDegenGeom( SET_ALL, DEGEN_GEOM_M_TYPE );
}

Then, execute it from the command line via

vsp  baseline.vsp3 -des changes.des -script degen.vspscript

or

vspscript baseline.vsp3 -des changes.des -script degen.vspscript

You may want to change SET_ALL to something else.

Hope this helps,

Rob



--
You received this message because you are subscribed to the Google Groups "OpenVSP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openvsp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openvsp/00b5ab40-df9e-4854-b0e6-109b3cd90aa0n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages