What is the meaning of the iteration parameter in simResults

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

What is the meaning of the iteration parameter in simResults

HaraldRedlin
This post was updated on .
What is the meaning of the vector obj.simResults.iteration?
For instance I got the following value: [1 1 1 1 1 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3].
Reply | Threaded
Open this post in threaded view
|

Re: simResults - Meaning of the values in there

tinolang
Administrator
This post was updated on .
If you repeatedly run the simulation, e.g. using a loop for parameter scans, obj.simResults.iteration is incremented each time the methode run(obj,...) is executed.

Use clearResults(obj) to reset obj.simResults.iteration and obj.simResults

Example
clear all
close all

SHG =  chi3D(); %loads standard SHG example 

iterations=5;
theta=linspace(SHG.simProp.theta-1e-3,SHG.simProp.theta+1e-3,iterations);
for i=1:iterations
    
    showProgress(SHG,i,iterations); %creates a progress bar showing the remaining time
    [Eftfxfy_o Eftfxfy_e] = run(SHG,{'pulse1','theta',theta(i)}); %calculates the standard SHG example for different phasematching angles
    
end

SHGefficiency=SHG.simResults.SHGexample_green.PulseEnergy./SHG.beamProp.EorI_pulse1;
figure,
subplot(1,2,1);
plot(SHGefficiency), %plots all results saved during the loop
xlabel('result vector');ylabel('SHGefficiency');
subplot(1,2,2);
plot(SHG.simResults.SHGexample_green.z(SHG.simResults.iteration==3)*1e3,SHGefficiency(SHG.simResults.iteration==3)), %polts only the results of iteration 3
xlabel('crystal position (mm)');ylabel('SHGefficiency');


Tino Lang
Reply | Threaded
Open this post in threaded view
|

Re: simResults - Meaning of the values in there

testUser
test


raw text

chi3D.pdf