Physics-UEMColumn

 view release on metacpan or  search on metacpan

lib/Physics/UEMColumn/Auxiliary.pm  view on Meta::CPAN

  constants   => [ qw/ pi me qe epsilon_0 vc / ],
  model_funcs => [ qw/ L L_t L_z dLdxi dL_tdxi dL_zdxi / ],
  util_funcs  => [ qw/ join_data / ],
  materials   => [ qw/ Ta / ],
);

our @EXPORT_OK;
push @EXPORT_OK, @$_ for values %EXPORT_TAGS;

$EXPORT_TAGS{'all'} = \@EXPORT_OK;

=head2 :constants

=over

=item pi

The mathematical constant

=item me

The rest mass of an electron (kg)

=item qe

The charge of an electron (C)

=item epsilon_0

The permittivity of free space (electric constant) (F/m)

=item vc

The speed of light in a vacuum (m/s)

=back

=cut

use constant {
  me => 9.1e-31,
  qe => 1.6e-19,
  epsilon_0 => 8.85e-12,
  vc => 2.9979e8,
};

=head2 :materials

Null prototyped functions returning a hash of C<energy_fermi> and C<work_function> suitable for passing to the constructor of a C<Physics::UEMColumn::Photocathode> object.

=over

=item Ta

Tantalum metal

=back

=cut

sub Ta() {
  return (
    energy_fermi => '5.3 eV',
    work_function => '4.25 eV',
  );
}

=head2 :model_funcs

Internal functions related to implementing the AG model (see M&S original paper). These need not be used by the end-user and thus are not described here.

=cut

sub L {
  my ($xi) = @_;

  return 1 if $xi == 1;

  if ($xi > 1) {
    my $sqrt = sqrt(($xi**2) - 1);
    return log($xi + $sqrt) / $sqrt;
  } 

  if ($xi >= 0) {
    my $sqrt = sqrt(1 - ($xi**2));
    return asin($sqrt) / $sqrt;
  } 

  die "xi is out of range";
}

sub L_t {
  my ($xi) = @_;
  my $L = L($xi);

  return 1.5 * ( $L + (($xi**2)*$L - $xi) / (1 - $xi**2) );
}

sub L_z {
  my ($xi) = @_;
  my $L = L($xi);

  return 3 * ($xi**2) * ( $xi * $L - 1) / (($xi**2) - 1)
}

sub dL_tdxi {
  my ($xi) = @_;

  return -3/2 * ((($xi**4)-1)*dLdxi($xi) - 4*$xi*L($xi) + ($xi**2) + 2) / ((($xi**2)-1)**2);
}

sub dL_zdxi {
  my ($xi) = @_;

  return 3*$xi * (($xi**2)*(($xi**2)-1)*dLdxi($xi) + $xi*(($xi**2)+3)*L($xi) + 2) / ((($xi**2)-1)**2);
}

sub dLdxi {
  my ($xi) = @_;

  if ($xi >= 1) {



( run in 1.741 second using v1.01-cache-2.11-cpan-524268b4103 )