Skip to content

Adding peibos#300

Merged
SimonRohou merged 27 commits intocodac-team:codac2_devfrom
godardma:adding_peibos
Oct 20, 2025
Merged

Adding peibos#300
SimonRohou merged 27 commits intocodac-team:codac2_devfrom
godardma:adding_peibos

Conversation

@godardma
Copy link
Copy Markdown
Collaborator

@godardma godardma commented Sep 30, 2025

First version of an implementation of peibos into codac for feedbacks.

Note that this version lacks documentation and python bindings. The objective is to propose an implementation as clean as possible before writing the documentation and bindings for a complete integration.

I think that the lines 138-150 of "codac2_peibos.cpp" could be simplified by calling directly "parallelepiped_inclusion" from line 72, but it requires to be able to construct the g function. g is the composition of the AnalyticFunction f, symmetry s and AnalyticFunction psi_0. @SimonRohou if you have any idea on how to do so please let me know (if it is possible).

The only remaining "duplicate" is for the function "parallelepiped_inclusion". One implementation gives access to the complete inclusion function (i.e. just a function f and a box [x] are needed as inputs). The other one will later be used by peibos-capd or any ODE's version of PEIBOS.

Update : Happy 300th PR Codac !

@SimonRohou
Copy link
Copy Markdown
Member

Using PR #301, you can now use OctaSym in an AnalyticExpr.
See for instance:
https://github.com/codac-team/codac/blob/codac2_dev/tests/core/actions/codac2_tests_OctaSym.cpp#L38

@godardma
Copy link
Copy Markdown
Collaborator Author

godardma commented Oct 2, 2025

Thanks Simon, this modification indeed helped me to further simplify the code. If you have any feedback I will gladly take a look at it !

@godardma
Copy link
Copy Markdown
Collaborator Author

godardma commented Oct 3, 2025

@SimonRohou do you know if and how I can get the vector of radiuses (or diameters) from an IntervalVector ? For now I am using a for loop but maybe a method is already implemented. Here is what I use for now :

Vector x_rad (X.size());
for (int i = 0; i < X.size(); i++)
      x_rad(i) = X(i).rad();

@SimonRohou
Copy link
Copy Markdown
Member

Yes!

Example:

>>> from codac import *
>>> x = IntervalVector([[-2,3],[4,10],[-oo,0]])
>>> x
[ [-2, 3] ; [4, 10] ; [-inf, 0] ]
>>> x.rad()
[ 2.5 ; 3 ; inf ]

Comment thread src/core/peibos/codac2_peibos.cpp Outdated
assert_release (f.input_size() < f.output_size() && "input size must be strictly lower than output size");
assert_release (X.size() == f.input_size() && "dimension of X must match input size of f");

VectorVar psi_0(f.input_size());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

psi_0 never used?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No indeed, and it is not supposed to be a VectorVar... I don't know how it ended up here

Comment thread src/core/peibos/codac2_peibos.cpp Outdated
for (int i = 0; i < X.size(); i++)
x_rad(i) = X(i).rad();

Matrix A = f.diff(X.mid()).mid();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the following inflation reliable?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure to understand the question.

Are you asking about the guarantee of the inflation process itself or about the guarantee of the inflation process as coded ?

Comment thread src/core/peibos/codac2_peibos.cpp Outdated
return Parallelepiped(f.eval(X.mid()).mid(), A_inf);
}

Parallelepiped parallelepiped_inclusion(const Vector& z, const IntervalMatrix& JJf, const IntervalMatrix& JJf_punc, const AnalyticFunction<VectorType>& psi_0, const OctaSym& symmetry, const IntervalVector& X)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JJf or Jf ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is an enclosure of Jf. In some other codes I noticed that the first letter is sometimes doubled to indicate that it is an "Interval" version. If you prefer I can simply write Jf for clarity.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name of the variables have been revised in the last commit for better readibility

Comment thread src/core/peibos/codac2_peibos.cpp Outdated
@SimonRohou
Copy link
Copy Markdown
Member

Following our conversation:

  • add some high-level tests (PEIBOS)
  • add some tests for evaluating parallelepipeds
  • remove the ColorMap
  • write the related page in the manual

@SimonRohou SimonRohou merged commit 0817f2b into codac-team:codac2_dev Oct 20, 2025
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants