patchGNU Octave - Patches: patch #9063, Add function decic


patch #9063: Add function decic

Submitted by:  Francesco Faccio <francesco_faccio>
Submitted on:  Sat 30 Jul 2016 02:21:04 AM UTC  
Category:  Core : new function Priority:  5 - Normal
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Mon 19 Sep 2016 04:57:18 PM UTC, comment #5:

I do not know for certain that the paper describes exactly
what is used in the MATLAB decic.

But, as Shampine points out in the paper, it does have one
very attractive feature: if the problem is not a DAE
(i.e. dF/dyp has full rank), the algorithm simply solves
for yp, leaving the user's initial conditions in y completely

I assume you could do the same thing with the algorithm here by fixing all the y-components and freeing all the yp components. But the user would have to figure out that is what they need to do.

In the general DAE case, the Shampine algorithm does not require the user to identify which equations are odes and which are algebraic.

Bill Greene <billgreene>
Mon 19 Sep 2016 04:02:57 PM UTC, comment #4:

Hi Bill,

Actually we were not aware of the reference you linked.
Is that the approach used in Matlab?

It probably is as the paper references Matlab explicitely,
but the Matlab docs don't have any clear explanation of the algorithm.

@Francesco if we know what is being used in Matlab we should
probably try to use something similar ...


Carlo de Falco <cdf>
Project Member
Mon 19 Sep 2016 03:52:03 PM UTC, comment #3:

The approach in this function is completely different from
that in the Shampine paper

Is there a reference to the approach used in this version of

Bill Greene <billgreene>
Mon 01 Aug 2016 12:38:02 PM UTC, comment #2:

Thank you Carlo,

the changeset attached fixes the problem and works in default branch without any additional patches.


(file #38064)

Francesco Faccio <francesco_faccio>
Mon 01 Aug 2016 08:43:22 AM UTC, comment #1:


There is no need to use nested functions, especially
as they are problematic to work with as shown by bug #39257 .

But even if they did work correctly I find the scoping rules
of nested functions confusing and I think they lead to code that
is difficult yo understand and debug.

Can you please rewrite this using parametrized subfunctions [1,2]



Carlo de Falco <cdf>
Project Member
Sat 30 Jul 2016 02:21:04 AM UTC, original submission:


Here's a patch for function decic, which will be used to compute consistent initial conditions for ode15i.

This function uses a handle to a nested function, so it doesn't work in Octave default branch (bug #39257). Fortunately, it works with patch #37889 provided by Lachlan here:

I wrote the documentation ad added some test.
I would like to change the way to check the input using InputParser validation functions also here.

Please tell me if there is something I can improve.



Francesco Faccio <francesco_faccio>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #38064:  localfun.diff added by francesco_faccio (1KiB - text/x-diff)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by billgreene (Posted a comment)
  • -email is unavailable- added by cdf (Posted a comment)
  • -email is unavailable- added by francesco_faccio (Submitted the item)
  • -email is unavailable- added by francesco_faccio
  • -email is unavailable- added by francesco_faccio

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-08-01 francesco_faccio Attached File- => Added localfun.diff, #38064
    2016-07-30 francesco_faccio Attached File- => Added change_decic.diff, #38050
        Carbon-Copy- => Added -email is unavailable-
        Carbon-Copy- => Added -email is unavailable-

    Back to the top

    Powered by Savane 3.3