Giter Club home page Giter Club logo

Comments (4)

Steven-Roberts avatar Steven-Roberts commented on July 18, 2024

The correct option is Mu here. Y_TLM is only used for the TLM, while Mu and Lambda are the adjoint variables.

from matlode.

sh-cau avatar sh-cau commented on July 18, 2024

Ok, maybe its just not clear to me what is meant with what. I'm sorry. Let's see if we are on the same side notation-wise. If I have the functional

subject to the ODE
,
the corresponding adjoint equations become

And thus the sensitivity w.r.t. p is evaluated with
.
Now the following input arguments are clear to me:

  • Lambda argument:
  • Mu argument (passed as Jacobian):
  • DRDY and DRDP are self-explanatory
  • Jacp => function handle to dfdp
  • Jacobian => function handle to dfdy
  • QFun => function handle to r(y,p)
  • Quadrature => function handle that returns initial value of the integral (typically zeros)

I understand that after the solver call, the output contains

  • Lambda (value at t=0, i.e. sensitivity of Psi w.r.t. initital states)
  • Mu (sensitivity of cost functional w.r.t. parameters)

    but in essence without the term that I expected would be Y_TLM, namely

    so if I get this right, I would have to add this term manually if

    to obtain the "true" sensitivity? Unfortunatley, I'm not able to validate this, because I can't obtain a sensible output for a minimal working example, see Issue #4

from matlode.

Steven-Roberts avatar Steven-Roberts commented on July 18, 2024

I think λ^T(0) dy_0/dp = dΨ/dy_0 * dy_0/dp = dΨ/dp = μ^T. I'm not sure I completely understand your question.

from matlode.

sh-cau avatar sh-cau commented on July 18, 2024

@Steven-Roberts I am confused. I think I am mixing up the continuous and the discrete adjoint formulations... Therefore this is not really an issue in the code but rather an issue of my comprehension. Though I think the result should be equivalent when the adjoining the continuous equations and discretizing afterwards compared to discretizing the problem and ajoining afterwards?

The mu that I have in mind and the output 'Mu' are therefore not the same? "My" mu is the (constant) lagrange multiplier obtained by adjoining the system ODE and initial state to the cost functional (with integral/running costs included in Psi as above)

Now after taking the derivative of L with respect to p and after integration by part one has to set the adjoint ODE with final value as shown above to get rid calculating dy/dp at any time. In the process, one also has to set

to avoid calculating dy/dp@t=0 which leads to the above-mentioned Jacobian/sensitivity but in continuous time. This still leaves me confused with your comment, though. Because the lambda(0) ( and therefore mu, too) is still the sensitivity w.r.t. the initial state and inserting lambda(0)=dPsi/dy0 above would not make sense, or at least it would mean that

I understand if you don't have time to look into this too deeply.

from matlode.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.