Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make desolve return a function expression #2

Open
peanutfun opened this issue Nov 8, 2021 · 2 comments
Open

Make desolve return a function expression #2

peanutfun opened this issue Nov 8, 2021 · 2 comments

Comments

@peanutfun
Copy link

Description

The main feature of GiNaCDE is the desolve function which solves a given differential equation. However, this function does not return the resulting GiNaC expression ex, but only an integer status. The expression is written to a file and discarded. This severely hampers the usability of the GiNaCDE library, as the result of desolve cannot be used within a program for further computations (e.g., evaluating it, integrating it over an interval, ...).

Is there maybe a technical reason why the result is not also returned by the function?

Proposal

Make desolve return the solved expression, or throw an exception if there was an error.

Related issues

openjournals/joss-reviews#3885

@mithun218
Copy link
Owner

@peanutfun Thanks for your valuable observations. It is correct that GiNaCDE does not return the results in GiNaC expression ex. But, GiNaCDE returns its results through the variables solutionClt and constraints. One can use the results collected by the variables solutionClt and constraints for further computations within a program.
Please let us know, is this enough?

@peanutfun
Copy link
Author

I'm sorry, I missed these global return variables on my first go through your program. I think they suffice, but it might be worth considering not to have them as global variables, but only local variables that are returned by the desolve function. This would work well in conjunction with my proposal in #11. With a class encapsulation, you can define all these variables locally. I'll leave the decision up to you, feel free to close this issue!

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

No branches or pull requests

2 participants