Scripting eme analysis commands after simulation run

#1

Hi,

I am trying to write a script file which uses the EME solver but upon writing:
run; emesweep; S = getemesweep(‘S’);
The simulation complains that it is in layout mode when it tries to run “emesweep” when the above line is written inside a loop, am I wrong in thinking that using the “run” command immediately before it should switch to analysis mode allowing use of this function?
The message that comes up states “Save failed! Could not write to file:… You may not have permission to write to this directory”, then console states “emesweep cannot be used while in layout mode”

Regards,
Martin

#2

Dear @mw20g10

This is the code that we used for spot-size-converter example:

# scriptfile: spot_size_converter.lsf
# This script runs the emesweep and plot the s parameter

run;

# set propagation sweep settings
setemeanalysis("propagation sweep",1);
setemeanalysis("parameter","group span 2");
setemeanalysis("start",20e-6);
setemeanalysis("stop",200e-6);
setemeanalysis("number of points",201);

# run propagation sweep tool
emesweep;

# get propagation sweep result
S = getemesweep('S');


The only difference is that you haven’t activated the propagation sweep in your code, but the error message that you are getting is different (if emesweep is inactive, you should get an error message like emesweep is inactive). Can you please upload your simulation file for a review?

Thanks

#3

Ive seen the example, having run the simulation prior to this script propagation sweep is activated but ive added it to the code anyway now. The script file is attached, and below is the loop the problem occurs in.
Sweep gap length transmission.lsf (1.5 KB)

for(g=1:length(gaps)) {
switchtolayout;
setnamed(“waveguide2”,“z max”, -gaps(g));
setnamed(“mesh”, “z min”, 0-(0.1e-6)-gaps(g));
run;
setemeanalysis(“propagation sweep”,1);
setemeanalysis(“start”,0); setemeanalysis(“stop”,maxlength);
setemeanalysis(“number of points”,no_points);
emesweep; S = getemesweep(‘S’);
Trans(g,1:no_points) = abs(S.s21)^2; Refl(g,1:no_points) = abs(S.s11)^2; Lengths = S.group_span_1;
}

#4

Dear @mw20g10

I run a simulation file with your code and it worked just fine, and I don’t have a clear reason why you had a problem running it! Can you please upgrade your software to the latest version and upload your simulation file for a review.

Thanks

#5

Having run the script in an empty project, adding elements the software complained about not being present, the script did oddly run fine. But then it still fails in my own project.
This is my project file : https://1drv.ms/u/s!ApzNJVlyflbRhOgA0sEu9eVWoX6Xeg
Im running version 7.8.884 2016b (I know this is not the latest but it what I have got)

#6

Dear @mw20g10

I ran simulation with your files and everything went through! Here is the screenshot:

This is an odd error (and I have not seen on the previous versions), but I think that upgrading to the most recent version should solve the problem.

Thanks

#7

I am not able to update my software and the problem was happening last year when it was the most recent version, the error is a little inconsistent as to when it may occur. Sometimes it will get through a few passes in the loop, sometimes not, a screenshot is shown below.

#8

Dear @mw20g10

I could not find a report related to the problem that you are mentioning. Since you are using an older version, I recommend you to upgrade it to a newer version. Please let me know if you have any problem installing new software.

Thanks