How to execute the chi3D.p file

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

How to execute the chi3D.p file

mojtaba
What is the proper way to execute the chi3D.p file?
Reply | Threaded
Open this post in threaded view
|

Re: How to execute the chi3D.p file

tinolang
Administrator
The chi3d.p is a Matlab class providing all methods and properties included in the chi3D package (see manual). Just make sure the chi3p.p file is in the current folder or in the Matlab path.

SHG Example:
SHG_obj = chi3D(); %creates an instance of chi3D - without further inputs all properties of the new object are predefined for the standard example generating the second harmonic of a 'pulse1'

[Eftfxfy_o,Eftfxfy_e]=run(obj,{'pulse1'});  %start the computation using the run method of the class




figure('Name','SHG efficiency vs. crystal length');
plot(SHG_obj.simResults.SHGexample_green.z * 1e3 , SHG_obj.simResults.SHGexample_green.PulseEnergy ./ SHG_obj.beamProp.EorI_pulse1)
xlabel('z [mm]');
ylabel('efficiency')

Tino Lang