add new temporal profile tsin2plateau #7
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I propose to add a temporal profile that is very useful for several simulations:
tsin2plateau
, a sin2 profile with the option to become flattop profile with sin2 ramps.I used the code that Micka and Anna developed some time ago and I refactored it.
I changed the default values: if only one parameters is given (
fwhm
) the profile is similar to a Gaussian profile having fwhm (of the field amplitude) defined by the user.If
plateau
is also given, a plateau is added splitting in two the previous profile.If the user defines
slope1
and/orslope2
, he/she controls the width of the sin2 ramps at the beginning and at the end of the profile.See attachment.
Someone might not like the redundancy of
fwhm
,slope1
,slope2
.slope1
,slope2
usefwhm
as default value. If they both are defined,fwhm
is not used, it gets overridden, and the values ofslope1
,slope2
are used.I chose to let the user use
time_envelope = tsin2plateau(fwhm=70.*t0)
to have a simple way to define a laser envelope that can be useful also in 2D and 3D.
A sin2 profile has the advantage to have a compact support,
no truncation is needed to approach zero, and its derivative is continuous.