gafusion / omas

Ordered Multidimensional Array Structure
http://gafusion.github.io/omas
MIT License
30 stars 14 forks source link

Jmcclena comp #193

Closed jmcclena closed 2 years ago

jmcclena commented 2 years ago

This pull request adds a few pointnames to d3d machine_mapping and gives first implementation of incorporating compensation corrections to signals.

@orso, I'd be grateful any recommendations for improving the compensation strategy.

jmcclena commented 2 years ago

Its not terribly slow. Approximately 8s to generate the constraints plus 0.25s per kfile generated (which I assume a lot of that is in duplicating the file). If there is any obvious way it could be speed up, let me know.

I haven't found a good place for the loop voltage any ideas? Maybe its considered a passive loop or flux loop?

orso82 commented 2 years ago

If you parse the kEQDKS once, then you should be able to deepcopy it (not duplicating) and that should be faster (since you'll skip the parsing step).

orso82 commented 2 years ago

Something like

template_kEQDSK.load() # force a load
for k in range(10):
    kEQDSK=copy.deepcopy(template_kEQDSK)
smithsp commented 2 years ago

@orso82 There was also a question about loop voltage. Do you recall where you put that for NSTX?

orso82 commented 2 years ago

I see a bunch of leftover print statements. @jmcclena please let me know when this is ready for final review and merge.

jmcclena commented 2 years ago

@orso82 This branch is ready for a final review when you have time. Originally, I was hoping to get vloop into omas equilibrium constraints before merging. However, I suspect the correct location for the loop voltage is pf_active since I found written in pf_passive: "any connected loops are expressed as active coil circuits with no power supply attached". I think this will require some special treatment, as vloop information isn't saved in the mhdin.dat file, and would be better as a seperate pull request.

jmcclena commented 2 years ago

Actually, now that I'm thinking about this again. I need to correct the DIII-D error calculation for diagnostics with integrator errors before merging.

orso82 commented 2 years ago

@jmcclena do you think you can get to this by the end of the week? As discussed at the OMFIT-users group meeting I'd like to release a new OMAS version by the end of the week, and may be good to have these updates in it.

jmcclena commented 2 years ago

will do

jmcclena commented 2 years ago

@orso82, apparently my concerns with integration errors were unwarranted in this case. I did fix the compensation calculation and it is ready for a final review.