snOptA examples in Fortran

157 views
Skip to first unread message

knitst...@gmail.com

unread,
Mar 15, 2017, 4:19:14 AM3/15/17
to SNOPT
The snOpt downloadable program examples in fortran cover only snOptB.

I wish to port an application currently written in matlab and using snOpt to fortran for integration into a larger project.

I cannot seem to find any program examples or literature on snOptA and trying to decipher the snoptmex source and use this as a model for a native snOptA fortran application has not proved successful.

The problem variables currently arrive more or less in the same format used by the matlab snopt call so the snoptmex source should be a good example of how to do solve the problem. However in the absence of a pure snOptA example it is proving difficult to track down the segmentation errors.

snJac does run without errors but does not seem to provide meaningful output. Perhaps the variables passed through the call to snJac are being garbled somewhere as debugging statements in the objective function show the objective function being called as expected.

Searches on the web turn up no examples of snOptA and snJac usage in fortran so if anyone can direct me to an example with downloadable source files this would be very helpful.

Message has been deleted

SNOPT

unread,
Mar 15, 2017, 1:40:30 PM3/15/17
to SNOPT, knitst...@gmail.com
Hi,

I'm not sure where you got this version of SNOPT from, but there are 57 problems included in SNOPT.  16 of these examples use snoptA, and of these, 11 use snJac.

The User's Manual is usually included in the "doc" directory, but the latest one is available online (http://ccom.ucsd.edu/~optimizers/usage/fortran/).  The descriptions of snoptA and snJac start on pages 15 and 21, respectively.

--Elizabeth

knitst...@gmail.com

unread,
Mar 16, 2017, 5:07:00 PM3/16/17
to SNOPT, knitst...@gmail.com, sn...@googlegroups.com
Hello Elizabeth

Thank you for the prompt reply.

I applied for a trial version and then downloaded the mac os fortran and c snopt7 dylibs from the links provided to me in the response email.

I cannot immediately trace where I obtained the example programs but these are possibly from an earlier request for a linux version of the library which I did not manage to use as the programs would not compile. These example problems are sntoy, maxi, spring and snmain and all use snoptB, the snopt version shown when running the [programs with the dylibs is S N O P T 7.5-1.5 (Feb 2016).

When I follow the link supplied in your reply it takes me to a page titled "Using SNOPT" starting with the following para: "SNOPT has 3 interfaces: snOptA, snOptB, and snOptC, with snOptA being the "simplest" interface. Advanced users should use snOptB or snOptC." with a link to the snopt 7.6 manual but I cannot find any links to example problems.

If you could point me to the correct link for the example problems including snoptA then this would be greatly appreciated as I have been struggling to get this working for quite some time.

Regards

SNOPT

unread,
Mar 16, 2017, 5:57:28 PM3/16/17
to SNOPT, knitst...@gmail.com
At the moment, the examples aren't available outside of our licensed package.  Did you take a look at the user's manual?  There's a good description of how to use snoptA and snJac in there.

You could also take a look at the C/C++ examples (https://github.com/snopt/snopt-interface).  There's "toyA" under the cexamples and "catmixa" and "sntoya" under cppexamples.  Obviously there are some minor differences due to the languages but the basic setup and idea are the same.

--Elizabeth

knitst...@gmail.com

unread,
Mar 17, 2017, 4:49:18 AM3/17/17
to SNOPT, knitst...@gmail.com, sn...@googlegroups.com
On Friday, March 17, 2017 at 1:57:28 AM UTC+4, SNOPT wrote:
Hello Elizabeth

Thank you again for the prompt response and for the useful information.
I have located the C examples and these will probably be easier to follow than using snoptmex or snctrl as working examples.

I agree with you that the user guide does well explain snJac and snOptA and I had also been trying to construct a simple working example from the guide. But have been dogged by segmentation errors which would suggest improperly allocated arrays which is why I was looking for a simple working example.

In order to get the full examples which licensed package should I go for? The project I am working on is actually part of an academic study but I am not sure whether it would qualify for academic pricing.
Reply all
Reply to author
Forward
0 new messages