-
Notifications
You must be signed in to change notification settings - Fork 33
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
Add support for prescribed source profiles #221
Add support for prescribed source profiles #221
Conversation
|
5b3ff7d
to
3c518be
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! Sorry for the delay on reviews. Main thing you want to do is rebase to head because some of the sources API changed recently I think.
Once you update these bits, I'll take another quick look before approving.
Thanks for working on this. This is a valuable feature in TORAX.
This is required as geo must be specified for interpolated params (see get_init_kwargs)
d333de9
to
fbb0837
Compare
0c8d5e6
to
707ce68
Compare
I cleaned up a couple small things in this PR in our internal system, and need one more internal approval before I can merge this thing. |
Just so you're aware - this PR is not passing all our internal tests yet when merged with HEAD. I'm not sure why and have been debugging, but this is what's blocking things now. Will try and keep you posted. |
Is there anything I can do to help? I had thought it had passed the relevant tests (using |
I was confused here as well. I had made very minor cosmetic changes on top, so I thought it was something I did. But actually, I just checked out your fork and your branch and tested, and I'm getting the same errors. My guess is the rebase broke something in your code. I'm looking into it as well, but if you could check out your branch again and run |
Problem 1: are we updating jext/jtot/johm properly?Given that this particular chain of problems is to do with This is the simulation from t=0s + a bit to avoid initial condition transients I'm concerned that I've missed a |
Awesome! Nice catch. That definitely fixed the test you added. You may have already seen this, but 3 other test cases from
I didn't get a chance to find the underlying issue yesterday but am looking again today. I'll let @jcitrin comment on the other questions you had. |
Problem 2: code in this PR for
|
If you add external CD, instantaneously nothing changes in j_tot. Because of faradays law, the J_ohm change should exactly oppose what you added. Then you wait for J_ohm perturbation to decay away for the current drive to be realised. So it's not obviously wrong to me, changes in j_tot take time to show up. j_ohm should change rapidly when you change j_ext, but not j_tot |
Also note that all of these difficulties are actually to do with jext, rather than with the prescribed source profiles. It could be worthwhile splitting this PR up so that the prescribed profiles bit goes in one PR and the jext bit goes in another. |
@araju and I just looked into this in detail. What's happening is that you fixed a bug that we didn't realize we had, thanks! :) The default runtime_params for Previously, |
So we will first fix this bug and do some cleanup, and then rebase your PR on top of that and fix any merge conflicts. Regarding Problem 1 , yes as Francis says, it takes a long time for the current to diffuse for these parameters, so that |
What we're going to do is fix this bug at head, and then we can merge you PR as well right after. You don't need to do anything on this anymore. I know you might be on vacation for a bit soon. Just in case, do you mind making sure I have push access to this branch in your forked repo? Just so I can push any changes that may need to happen to resolve conflicts. I should be able to handle conflicts and merge the PR without you, but that is just a precaution. Thanks again for uncovering this! |
Amazing! Sounds like it's a good result all round. I've sent @araju an invite to be a collaborator on my fork. |
PiperOrigin-RevId: 661147867
Hey Theo, sorry for the delay with all of this. Lost a week or so with a cold, so thanks for bearing with me! Not sure why the commit we merged separately didnt sit on top of this PR. We're still getting the hand of our internal tools with dealing with the Github PRs haha. But we can close this now that 6aeb322 is submitted. |
Pull request for #212.
Plan is to use
TimeInterpolatedArray
for prescribing potentially time-evolving source profiles.Key files are
torax/sources/source.py
andtorax/sources/runtime_params.py
.