Opened 5 years ago

Closed 6 weeks ago

#13 closed enhancement (migrated)

Use tape within a tape definition

Reported by: zampanteymedio Owned by: awalther
Priority: minor Component: libadolc
Version: 2.0 Keywords:
Cc:

Description

I didn't know how to contact you, so I'm opening a ticket.

I have a function f(x). I have another function g(x) which is a function of f(x) and its partial derivatives. I want the derivatives of g(x).

My first guess was to add f(x) into a tape, then add g(x) into another tape that uses the first tape. I couldn´t find any method to retrieve the partials of f(x) as adouble... How can I do that? Is there another way to obtain the derivatives of g(x)?

Thanks!

Change History (2)

comment:1 Changed 5 years ago by kulshres

You may contact us and a lot of other ADOL-C user at the mailing list adol-c@… and the replies there are usually timely.

Your use case is what is known as nested derivatives. The derivatives of a function f(x) are not available as adoubles. This type is only present to create a trace, derivative computation is not done using this type.

However you can program your g(x) as infact a function g(x,y) where y represents the Jacobian or Gradient of f(x). Then you can first compute the derivatives of f(x) from your first trace and then pass them as independent variables to evaluate the derivatives of g(x,y). However if you need a total derivative you'd still need to invert the Jacobian of f(x) by hand.

If you have more questions please send us some example code on the mailing list, and we can help you to get it to compute the correct derivatives.

comment:2 Changed 6 weeks ago by stefan

  • Resolution set to migrated
  • Status changed from new to closed

This ticket has been migrated to GitHub? and will be resolved there: https://github.com/coin-or/ADOL-C/issues/13

Note: See TracTickets for help on using tickets.