NSC- strategies to manage heavy simulations or designs

  • 20 October 2020
  • 4 replies
  • 207 views

Userlevel 4
Badge +2

  • If the optical system to be modeled is quite complex, for example there are multiple CAD parts being included, you might experience long time to load the parts and to do NSC ray tracing, the new CAD libraries being added since 20.3 includes improved performance when using CAD parts, a significant speed improvements can be observed with the new library, check the link for more about using new ACIS library.

  • Generally, when a ray strikes a surface, part of the energy will be reflected, part will be transmitted, and depending upon the surface properties, part may be absorbed. Ray splitting refers to the ability of OpticStudio to compute both the reflected and refracted paths, and then continue to trace both rays. OpticStudio also supports an option to randomly choose either the reflected or the refracted path rather than both, the option Simple Ray Splitting that use probabilistic method to trace one path can speed up the whole analysis and is useful for lighting applications.

  • If the system to be analyzed include scattering, and lots of rays needed when considering scattering efficiency, the following two options might be useful.  Scatter To List: Only traces rays that scatter towards object(s) of interest, Importance Sampling: Force rays to scatter towards object(s) of interest. Both options can speed up the analyzing of the system.

  • When experiencing laggy editors updates after the mouse operations for a complex system, toggle Express View to speed up the modifications on editor’s cells





  • Switch Update option, for example from update all windows to update editors only the speed up the responding from OpticStudio when multiple analysis windows being opened.




 


4 replies

Userlevel 3
Badge

There is still irritation from a model taking a long time to open for the first time (sequential or NSC).


I often save an NSC model with multiple analysis/graphics windows (e.g. Detector Viewers) for different 'views,' and although I have both


(1) unchecked 'Auto Apply' in Settings: Project Preferences: General dialog, AND


(2) checked 'Show Options First' under the Settings: Project Preferences: Graphics dialog for this model,


upon opening, OpticStudio STILL apparently does a Ray Trace and long recomputation of all graphics windows before I can do anything. And there is no visual feedback of progress, just a 'warning chime' if I try to open a menu, etc.


See Angel Morales's posts on Auto Apply, and Sandrine Auriol's posts on Show Options First in this other thread:


https://my.zemax.com/en-US/forum/threads/3f09e379-46ed-ea11-a817-000d3a329613#


So is there some way to default to opening a large model WITHOUT running all analyses upon opening?  Or at least give some display showing how long it might take before one can edit the model?


-- Greg

Userlevel 7
Badge +3

Hey Greg,


It shouldn't be doing a ray trace on open. I just opened Zemax\Samples\Non-sequential\Miscellaneous\Digital_projector_flys_eye_homogenizer.zmx and got the expected behavior. It loads all the saved data from file and then renders the windows, as expected.


Do you have a merit function that traces NSC rays? If so, make sure it is closed and that no open window is referencing it, otherwise that WILL cause a recalculation. Also, check this setting in Project Preferences:



That will trigger a merit function recalculation (of course) and a ray trace if you have an NSTR operand in the MF.

Userlevel 3
Badge

Aha!  Another mysterious check-box!


Thanks, Mark, you hit the nail on the head!  And so quickly!  Without seeing my file!


I tried it and un-checking 'Update Merit Function On Load' took loading from about 79 s (updating merit function upon load) down to about 17 s (to open and restore about 6 Detector Viewer windows, but indeed no ray trace is being done to update the detectors...I had two detector viewers that displayed 'Ray Trace Has Not Been Run').


The culprit was the Merit Function Editor, all right.  I thought it wasn't being used.  It is not referred to by any other windows.  But I had created it with NSTR and NSDD in order to make Universal Plot 1D, and it was lurking there to be Updated On Load.  Doesn't matter if the Merit Function Editor window is closed or open.


[Speaking of which, an updated KnowledgeBase Article on how to use Universal Plots like that in NSC mode would be helpful; Sanjay Gangadhara's KA-01448 'How to use the NSDD operand with the Universal Plot' is a great start, but really could use an additional screen shot of the Merit Function Editor used for his example plots, along with an NSC Editor shot showing which detectors are in place for NSDD.]


Under Project Preferences: General, I also played with unchecking 'Use Session Files' and 'Include Calculated Data in Session.'  When opening the NSC Editor only (no other graphics windows, shaded model, detector viewers, or Merit Function Editor), the model loads ~instantaneously.


I also newly learned that Project Preferences really applies to all new files, but that to alter e.g. 'Include Calculated Data in Session File,' the box under System Explorer: Advanced needs to be un-checked to apply to the open file at hand.


BTW, I noticed that there is no 'Close File' menu item under File.  So I went back and forth between New and Open, which I figured out I could do instead of shutting down and restarting OpticStudio just to get a fresh file opening situationl.


Given settings complexity, I almost think it could be useful to have a 'Profiles' or 'Templates' function that saves these complicated bunches of settings (configurations? ZDA and CFG files?) as 'templates' for new files of a certain type, perhaps more importantly for multi-user environments to share settings for things they do frequently.  Or maybe people just do this already with no specially-named OpticStudio feature.


-- Greg


P.S.  What editor did you use to annotate your screen shot with the pretty numbers in red circles with shadows?

Userlevel 7
Badge +3

Hey Greg,


I'm glad that worked. The fewer things you do on load of course, the faster load will be. The OS default behavior is to reopen the file exactly as it was when saved. You can save the Project Preferences (see the save and Load buttons on the dialog) and they expectation is that the user will use this for different clients (especially the Folders sections there) or for different users. Project Preferences are loaded separately to the file.


I use Snagit from Techsmith for screen capture. It's a really good, solid, reliable screen capture and recording tool.


- M

Reply