Start Commit

start implementation of class based simulation of a IM/DD communication system. Mostly based on Move-It but cleaned up and with focus on direct detection, however I try to keep the versatility of move-it alive.
This commit is contained in:
Silas Oettinghaus
2023-05-12 15:28:23 +02:00
parent 69df41340f
commit 6d53823466
109 changed files with 1824 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
function [v,u]=Boltzmann()
v=1;
u=9.1e-7;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=ConductanceQuantum()
v=1/pi;
u=1e-10;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=Coulomb()
v=1;
u=0;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=ElectronMass()
v=1;
u=4.4e-8;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=ElementaryCharge()
v=1;
u=2.2e-8;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=FineStructure()
v=7.2973525698e-3;
u=2.4e-12;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=FluxQuantum()
v=pi;
u=6.9e-8;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=LightSpeed()
v=137.03599907;
u=4.4e-8;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=Planck()
v=2*pi;
u=7.5e-8;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=ProtonMass()
v=1836.15267;
u=1.6e-4;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=ReducedPlanck()
v=1;
u=1.2e-8;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=Boltzmann()
v=1;
u=9.1e-7;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=Coulomb()
v=1;
u=0;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=Gravitational()
v=1;
u=4.7e-5;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=LightSpeed()
v=1;
u=0;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=Planck()
v=2*pi;
u=7.5e-8;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=ReducedPlanck()
v=1;
u=1.2e-8;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=Boltzmann()
v=1;
u=9.1e-7;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=LightSpeed()
v=1;
u=0;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=Planck()
v=2*pi;
u=7.5e-8;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=ProtonMass()
v=1;
u=4.4e-8;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=ReducedPlanck()
v=1;
u=1.2e-8;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=Boltzmann()
v=1;
u=9.1e-7;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=ConductanceQuantum()
v=2/pi;
u=2e-10;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=Coulomb()
v=1;
u=0;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=ElectronMass()
v=0.5;
u=2.2e-8;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=ElementaryCharge()
v=sqrt(2);
u=3.1e-8;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=FineStructure()
v=7.2973525698e-3;
u=2.4e-12;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=FluxQuantum()
v=pi/sqrt(2);
u=4.9e-8;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=LightSpeed()
v=274.07199814;
u=8.8e-8;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=Planck()
v=2*pi;
u=7.5e-8;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=ProtonMass()
v=918.076335;
u=8.1e-5;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=ReducedPlanck()
v=1;
u=1.2e-8;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=Boltzmann()
v=1;
u=9.1e-7;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=Coulomb()
v=1;
u=0;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=ElementaryCharge()
v=1;
u=2.2e-8;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=Gravitational()
v=1;
u=4.7e-5;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=LightSpeed()
v=1;
u=0;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=AtomicMass()
v=1.660538921e-27;
u=7.3e-35;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=AvogadroNumber()
v=6.02214129e23;
u=2.7e16;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=BohrMagneton()
v=9.27400968e-24;
u=2e-31;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=BohrRadius()
v=5.2917721092e-11;
u=1.7e-20;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=Boltzmann()
v=1.3806488e-23;
u=1.3e-29;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=ConductanceQuantum()
v=7.7480917346e-5;
u=2.5e-14;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=Coulomb()
v=8.987551787;
u=0;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=ElectronMass()
v=9.10938291e-31;
u=4e-38;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=ElementaryCharge()
v=1.602176565e-19;
u=3.5e-27;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=Faraday()
v=96485.3365;
u=2.1e-3;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=FermiCoupling()
v=1.166364e-5;
u=5e-11;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=FineStructure()
v=7.2973525698e-3;
u=2.4e-12;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=FluxQuantum()
v=2.067833758e-15;
u=4.6e-23;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=Gravitational()
v=6.67408e-11;
u=3.1e-15;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=HartreeEnergy()
v=4.35974434e-18;
u=1.9e-25;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=LightSpeed()
v=299792458;
u=0;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=Loschmidt()
v=2.6867805e25;
u=2.4e19;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=NuclearMagneton()
v=5.05078353e-27;
u=1.1e-34;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=Planck()
v=6.626070040e-34;
u=8.1e-42;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=ProtonMass()
v=1.672621777e-27;
u=7.4e-35;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=ReducedPlanck()
v=1.054571800e-34;
u=1.3e-42;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=Rydberg()
v=10973731.568539;
u=5.5e-5;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=StefanBoltzmann()
v=5.670373e-8;
u=2.1e-13;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=VacuumImpedance()
v=376.730313461;
u=0;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=VacuumPermeability()
v=1.256637061e-6;
u=0;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=VacuumPermittivity()
v=8.854187817e-12;
u=0;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=VonKlitzing()
v=25812.8074434;
u=8.4e-6;
end

View File

@@ -0,0 +1,6 @@
function [v,u]=WienDisplacement()
v=2.8977721e-3;
u=2.6e-9;
end

View File

@@ -0,0 +1,5 @@
function [v,u]=AtomicMass()
[v,u]=Constant.(UnitSystem()).AtomicMass;
end

View File

@@ -0,0 +1,5 @@
function [v,u]=AvogadroNumber()
[v,u]=Constant.(UnitSystem()).AvogadroNumber;
end

View File

@@ -0,0 +1,5 @@
function [v,u]=BohrMagneton()
[v,u]=Constant.(UnitSystem()).BohrMagneton;
end

View File

@@ -0,0 +1,5 @@
function [v,u]=BohrRadius()
[v,u]=Constant.(UnitSystem()).BohrRadius;
end

View File

@@ -0,0 +1,5 @@
function [v,u]=Boltzmann()
[v,u]=Constant.(UnitSystem()).Boltzmann;
end

View File

@@ -0,0 +1,5 @@
function [v,u]=ConductanceQuantum()
[v,u]=Constant.(UnitSystem()).ConductanceQuantum;
end

View File

@@ -0,0 +1,5 @@
function [v,u]=Coulomb()
[v,u]=Constant.(UnitSystem()).Coulomb;
end

View File

@@ -0,0 +1,5 @@
function [v,u]=ElectronMass()
[v,u]=Constant.(UnitSystem()).ElectronMass;
end

View File

@@ -0,0 +1,5 @@
function [v,u]=ElementaryCharge()
[v,u]=Constant.(UnitSystem()).ElementaryCharge;
end

View File

@@ -0,0 +1,5 @@
function [v,u]=Faraday()
[v,u]=Constant.(UnitSystem()).Faraday;
end

View File

@@ -0,0 +1,5 @@
function [v,u]=FermiCoupling()
[v,u]=Constant.(UnitSystem()).FermiCoupling;
end

View File

@@ -0,0 +1,5 @@
function [v,u]=FineStructure()
[v,u]=Constant.(UnitSystem()).FineStructure;
end

View File

@@ -0,0 +1,5 @@
function [v,u]=FluxQuantum()
[v,u]=Constant.(UnitSystem()).FluxQuantum;
end

View File

@@ -0,0 +1,5 @@
function [v,u]=Gravitational()
[v,u]=Constant.(UnitSystem()).Gravitational;
end

View File

@@ -0,0 +1,5 @@
function [v,u]=HartreeEnergy()
[v,u]=Constant.(UnitSystem()).HartreeEnergy;
end

View File

@@ -0,0 +1,5 @@
function [v,u]=LightSpeed()
[v,u]=Constant.(UnitSystem()).LightSpeed;
end

View File

@@ -0,0 +1,5 @@
function [v,u]=Loschmidt()
[v,u]=Constant.(UnitSystem()).LoschmidtConstant;
end

View File

@@ -0,0 +1,5 @@
function [v,u]=NuclearMagneton()
[v,u]=Constant.(UnitSystem()).NuclearMagneton;
end

View File

@@ -0,0 +1,5 @@
function [v,u]=Planck()
[v,u]=Constant.(UnitSystem()).Planck;
end

View File

@@ -0,0 +1,5 @@
function [v,u]=ProtonMass()
[v,u]=Constant.(UnitSystem()).ProtonMass;
end

View File

@@ -0,0 +1,5 @@
function [v,u]=ReducedPlanck()
[v,u]=Constant.(UnitSystem()).ReducedPlanck;
end

View File

@@ -0,0 +1,5 @@
function [v,u]=Rydberg()
[v,u]=Constant.(UnitSystem()).Rydberg;
end

View File

@@ -0,0 +1,5 @@
function [v,u]=StefanBoltzmann()
[v,u]=Constant.(UnitSystem()).StefanBoltzmann;
end

View File

@@ -0,0 +1,5 @@
function [v,u]=VacuumImpedance()
[v,u]=Constant.(UnitSystem()).VacuumImpedance;
end

View File

@@ -0,0 +1,5 @@
function [v,u]=VacuumPermeability()
[v,u]=Constant.(UnitSystem()).VacuumPermeability;
end

View File

@@ -0,0 +1,5 @@
function [v,u]=VacuumPermittivity()
[v,u]=Constant.(UnitSystem()).VacuumPermittivity;
end

View File

@@ -0,0 +1,5 @@
function [v,u]=WienDisplacement()
[v,u]=Constant.(UnitSystem()).WienDisplacement;
end

63
physconst/README.md Normal file
View File

@@ -0,0 +1,63 @@
# PhysConst
A collection of fundamental physical constants in various unit systems for MATLAB.
## Licensing
This software is licensed under the GNU General Public License (version 3).
## Tested On
- MATLAB R2013b - R2018a
## Syntax
`v=Constant.NameOfConstant` returns the value of the named constant in the default unit system. See the [list of physical constant names](https://github.com/heriantolim/PhysConst#list-of-physical-constant-names). For examples:
- `v=Constant.ElementaryCharge` returns the value of the elementary charge, *e*;
- `v=Constant.LightSpeed` returns the value of the speed of light, *c*.
### Default Unit System
By default, the values are returned in the [SI](https://en.wikipedia.org/wiki/International_System_of_Units) units. To set a different unit system as default, do one of the following:
- Make a variable assignment: `UnitSystem='UnitSystemCode';`, where `UnitSystemCode` refers to the unit system to be used. See the [list of unit system codes](https://github.com/heriantolim/PhysConst#list-of-unit-system-codes).
- Define an anonymous function: `UnitSystem=@()'UnitSystemCode';`.
- Create a function named `UnitSystem` in the current working directory or elsewhere. The function takes no input arguments and returns a string specifying the unit system code.
`v=Constant.UnitSystemCode.NameOfConstant` returns the value of the named constant in the specified unit system, regardless of the default unit system. For examples:
- `v=Constant.SI.ElementaryCharge` returns the value of the elementary charge, *e*, in the SI units (=1.602176565);
- `v=Constant.P.LightSpeed` returns the value of the speed of light, *c*, in the Planck units (=1).
### Uncertainties
`[v,u]=Constant.NameOfConstant` and `[v,u]=Constant.UnitSystemCode.NameOfConstant` additionally return the uncertainty of the named constant.
## List of Unit System Codes
- `HA`: Hartree Atomic Units
- `P`: Planck Units
- `QCD`: Quantum Chromodynamics Units
- `RA`: Rydberg Atomic Units
- `S`: Stoney Units
- `SI`: International System of Units
## List of Physical Constant Names
- `AtomicMass`: atomic mass unit, *m*<sub>u</sub>
- `AvogadroNumber`: Avogadro's number, *N*<sub>A</sub>
- `BohrMagneton`: Bohr magneton, *μ*<sub>B</sub>
- `BohrRadius`: Bohr radius, *a*<sub>0</sub>
- `Boltzmann`: Boltzmann constant, *k*<sub>B</sub>
- `ConductanceQuantum`: conductance quantum, *G*<sub>0</sub>
- `Coulomb`: Coulomb constant, *k*<sub>e</sub>
- `ElectronMass`: electron mass, *m*<sub>e</sub>
- `ElementaryCharge`: elementary charge, *e*
- `Faraday`: Faraday constant, *F*
- `FermiCoupling`: Fermi coupling constant, *G*<sub>F</sub>/(*ħc*)<sup>3</sup>
- `FineStructure`: fine-structure constant, *α*
- `FluxQuantum`: magnetic flux quantum, Φ<sub>0</sub>
- `Gravitational`: Newtonian constant of gravitation, *G*
- `HartreeEnergy`: Hartree energy, *E*<sub>h</sub>
- `LightSpeed`: speed of light, *c*
- `Loschmidt`: Loschmidt's number, *n*<sub>0</sub>
- `NuclearMagneton`: nuclear magneton, *μ*<sub>N</sub>
- `Planck`: Planck constant, *h*
- `ProtonMass`: proton mass, *m*<sub>p</sub>
- `ReducedPlanck`: reduced Planck constant, *ħ*
- `Rydberg`: Rydberg constant, *R*<sub>∞</sub>
- `StefanBoltzmann`: Steffan-Boltzmann constant, *σ*
- `VacuumImpedeance`: vacuum impedance, *Z*<sub>0</sub>
- `VacuumPermeability`: vacuum permeability, *μ*<sub>0</sub>
- `VacuumPermittivity`: vacuum permittivity, *ε*<sub>0</sub>
- `WienDisplacement`: Wien displacement law constant, *b*

5
physconst/UnitSystem.m Normal file
View File

@@ -0,0 +1,5 @@
function s=UnitSystem()
s='SI';
end