-
Notifications
You must be signed in to change notification settings - Fork 308
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
Initial RHSolver attempt #887
base: main
Are you sure you want to change the base?
Conversation
Check out this pull request on Review Jupyter notebook visual diffs & provide feedback on notebooks. Powered by ReviewNB |
Codecov Report
@@ Coverage Diff @@
## master #887 +/- ##
=======================================
Coverage 96.18% 96.18%
=======================================
Files 59 59
Lines 5367 5367
=======================================
Hits 5162 5162
Misses 205 205 Continue to review full report at Codecov.
|
they're fakes for now
Okay, I've got something that takes a few seconds but works decently. What helped was substituting (fake, for now) values for Gamma and mu_0; I'll be adjusting this to work with physical Quantity inputs, which should help things. @pheuer could you take a look? This is of course at a very brief stage and I'll be redesigning most of it, but is the general idea sensible? Also, I'm somehow blanking on what Gamma was supposed to mean here 😅 Still, I take it I can just take it as (the only required?) input, substitute its numerical value into the equations, then happily solve them. |
The interface is taking shape, and that's reviewable; I'm still fighting issues with Sympy's solution and execution speed. It doesn't seem to be handling inputs instead of my initial "set everything to 1!" attemps particularly well. Perhaps an issue is that I'm substituting numerical values in before the solution, to limit the number of variables it has to work with from 14 (6 inputs, 6 outputs + gamma + mu0) to 6 + numbers - which it seems to be representing sometimes as rationals and sometimes as its own Float type. |
@StanczakDominik This looks like a good start! Here are some initial comments:
I will keep thinking about this too. |
Well... I think we may have a runtime problem here. In trying to solve the full 14 variable set of equations (including gamma and mu_0) for the 6 output ones, I'm getting runtimes of over 1 hour - and it's not like I even get the results, I just stop the computation after it's no longer reasonable. It's bonkers. I didn't think this was such a hard problem. I still have a few ideas for how to do this. There's a 2019 report on Stack that moving the solution out of the jupyter notebook may help a little, but I have mixed feelings on whether that's actually applicable to our use case. |
Nope, I think we can scrap that idea. The runtimes are atrocious. I've been tinkering with different flags to |
@StanczakDominik Well I suppose that's not too surprising: 14 variables is a lot! It seemed like the main problem with your previous solution (inserting the known variables) was getting sympy to represent them all as double floats so that very small or large coefficients would retain their precision: maybe there is a way to force sympy to always use float representations? Another approach might be to go back to the numerical technique I tried initially (using fsolve), but I think that would only work if we could re-write the equations in terms of some dimensionless quantities that would not be particularly large or small. Then again, if we could do that, maybe the sympy constants wouldn't be a problem either? |
Tackles #440. For now I'm developing this in a notebook.
I've got something that should theoretically work properly, but seems to be running into computational issues - the notebook is still running on my machine! I'm putting this up as an example of where I'm at with the initial idea.
docstrings.