Set type of finite differences for variables separately

12 views
Skip to first unread message

Lisa Neu

unread,
Dec 16, 2020, 11:26:53 AM12/16/20
to Artelys Knitro forum
Hi all,

do you know if there is a way to set the type of finite differences (forward vs. central) for each variable separately without implementing your own gradients?
I have some variables where I would rather like to have central differences, whereas for others, forward differences would perform better.

I am happy about your input!
Thanks in advance
Lisa

Richard Waltz

unread,
Dec 16, 2020, 3:06:18 PM12/16/20
to kni...@googlegroups.com
Hi Lisa,

Unfortunately, this functionality is not currently available in Knitro.  I agree it could be useful and we will consider adding it in a future release.

There are 2 related functionalities that may or may not be useful to you. 

1) There is an API function in Knitro to set a custom finite-difference steplength for each variable:


2) The callable library API in Knitro allows computing/approximating gradients for different groups of constraints in different ways.  For example you could use forward differences for some group of constraints and central differences for another group of constraints, by creating separate callback structures for these 2 groups.  In the Knitro distribution, the "C" example

  knitro-12.3.0-z-*64/examples/C/exampleMultipleCB.c

shows how to use exact gradients for some constraints and forward finite-differencing for others.  Something similar could be done to compute some constraints with forward differencing and others with central differencing.

Best regards,
-Richard

Richard WALTZ
Senior Scientist
 
Artelys USA
 


From: kni...@googlegroups.com [kni...@googlegroups.com] on behalf of Lisa Neu [lisa.k....@gmail.com]
Sent: Wednesday, December 16, 2020 2:18 AM
To: Artelys Knitro forum
Subject: [Knitro] Set type of finite differences for variables separately

--
You received this message because you are subscribed to the Artelys "Knitro Nonlinear Optimization Solver" google group.
To post to this group, send email to kni...@googlegroups.com
To unsubscribe from this group, send email to knitro-un...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/knitro?hl=en
Thank You,
Artelys
http://www.artelys.com/en/optimization-tools/knitro
---
You received this message because you are subscribed to the Google Groups "Artelys Knitro forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to knitro+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/knitro/360172c7-aeec-447c-bcab-ef0850cfc6ecn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages