Closed meloun67 closed 9 months ago
I don't really know how to do that. I can print graphs like these if it helps 😄
Yeah that looks good. However, it would be better to print 3D surface plots x - DisperCoef (1-5000), y - HenryConst (1-5000), z - LossFuncValue. And plot it for porosity 0.2, 0.3, 0.4, ..., 0.8
ok added code that does this at the end of Start_For_Testing function. You should probably run it for yourself and tweak the sizes and steps of this, with DisperCoef and HenryConst 1-5000 and step 1, graph for one porosity would take me approximately 24 days to run 😄 (x - henryConst, y - disperCoef, )
Also created function Loss_Function_Analysis to print these, here are all the arguments:
Here is a example how to use it:
Also created function Loss_Function_Analysis to print these, here are all the arguments:
Here is a example how to use it:
Nice! Could you please also print out the coordinates (K, D) where the minimum is. Then ask if you want to print closer location. If yes ask for K interval and D interval and print another surface plot.
Ok should be done. Here is a example how it works:
I have done it by indexes rather than values because calculating the right indexes from values was hard 😄 Also when I was working on it, I figured maybe you wanted to do new calculation in smaller area but with smaller step to get more detail. It that is the case, I'll do that next.
Ok should be done. Here is a example how it works:
- After the calculation is done, it will print the whole graph with values and indexes where minimum is:
- When you close the graph, function will ask you if you want closeup, if you input Y(yes), it will ask you for indexes of closeup: (The graphs have large step for faster testing)
I have done it by indexes rather than values because calculating the right indexes from values was hard 😄 Also when I was working on it, I figured maybe you wanted to do new calculation in smaller area but with smaller step to get more detail. It that is the case, I'll do that next.
Nice job! Yes correct! New calculation is needed, could be same number of nodes as original one, or you can add runtime question for a user. Up to yoi, both is fine for me.
Also maybe logaritmic scale option could be included ;-)
Done the closeup as a another calculation, here is example of how to use it: You go again by value and not index, because for another calculation, going by index doesn't make sense. You also fill up size of step, so you can go as detailed as you want. Also it is done recursively, so you can do multiple closeups on single dataset.
About the logarithmic scale, how would that work? Wouldn't we need exponential step for it to make sense?
this looks really good. yes correct. unfortunately, we need also exponential step, otherwise it is nonsence. for the creation of logaritmic scale vector you can use numpy.logspace and then iterate trough it. also you can add question to log base (default 10, but could make sense to use lower base)
Ok done, it works a little bit differently from the original function so I created a new one just for log scale named Loss_Function_Analysis_Log, here is a example of output:
You now need 4 parameters for x and y axis - start, end, steps and base The axis is then from interval [base**start, base**end] with steps number of steps in between. The closeup will ask you for all those parameters as well. Here are all the parameters (the only difference is in x and y axis parameters):
Right now, the original function uses itself recursively for the closeup and the log function uses itself for closeup. If you'd like, I can add option to combine them in closeup, for example you could call the original function for the initial analysis and then call log function for closeup of vice versa.
Perfect! Yes please, that was the initial idea, that you can switch between them if necessary. Sometimes you could also need to change intervals more than once so it would make sense that program ask you if you want to insert new intervals (ain which scale) after every plot generation... and the last question would be "do you want to save plots in PNG"
Ok done, it works a little bit differently from the original function so I created a new one just for log scale named Loss_Function_Analysis_Log, here is a example of output:
You now need 4 parameters for x and y axis - start, end, steps and base The axis is then from interval [base**start, base**end] with steps number of steps in between. The closeup will ask you for all those parameters as well. Here are all the parameters (the only difference is in x and y axis parameters):
Right now, the original function uses itself recursively for the closeup and the log function uses itself for closeup. If you'd like, I can add option to combine them in closeup, for example you could call the original function for the initial analysis and then call log function for closeup of vice versa.
Only issue here is that the plot axis does not have log scale... in Matplotlib settings
Ok added choice between logarithmic and linear function. I've put both functions into one file (Loss_Function_Analysis.py) because there was problem with cyclic dependency when they were in separate files and needed to call each other. If you want to import the Loss_Function_Analysis_Log somewhere, just use "from functions.Loss_Function_Analysis import Loss_Function_Analysis_Log".
Please specify what do you mean by "change interval". Right now, you can do as many closeups and changes in intervals as you want, but the "closeup" basically just calculates the whole new graph, but with the new parameters that you input. Generally that would be smaller interval with smaller step for more detail, but you can input larger or just different interval with bigger step and it should work just fine.
Saving to png is tricky, after calling plt.show() the plot is destroyed and you can't save it after. So there are few options which all have some problems:
The log scale is also problematic. Just setting xscale or yscale to 'log' plots things like this: After some googling I found out that its common problem with 3d graphs in matplotlib, that they don't really support log scale or its just buggy. There probably are some workarounds, but they might be more complicated and take longer time to implement.
Yeah... so we can leave log scale completely... does not make sense... user will just need to scale it correctly so the actual valley with one minimum will be visible
BUG? Step can be less than 1 right? It is not number of steps.
Oh yea, for some reason I typed input as int instead of float. Should be fixed now.
We need to design and implement analysis of sensitivity of every optimized parameter. In the other words, quantify how rapidly change in parameter influences the final solution.