feat(trap-plot): add Nozik trap function for comparison
This commit is contained in:
@@ -8,6 +8,7 @@ import space.kscience.plotly.models.TraceType
|
||||
import space.kscience.dataforge.meta.Value
|
||||
import space.kscience.kmath.structures.asBuffer
|
||||
import space.kscience.plotly.models.ScatterMode
|
||||
import kotlin.math.exp
|
||||
|
||||
fun main() {
|
||||
val maxDelta = (WALL_R - WALL_L)
|
||||
@@ -35,6 +36,18 @@ fun main() {
|
||||
}
|
||||
|
||||
plot {
|
||||
scatter {
|
||||
name = "Nozik Trap"
|
||||
mode = ScatterMode.lines
|
||||
x.buffer = (0.0..90.0 step 1.0).toDoubleArray().plus((100.0..maxDelta step 10.0).toDoubleArray()).asBuffer()
|
||||
y.numbers = x.doubles.map {
|
||||
if (it > 10) {
|
||||
1.86e-04 * exp(-it / 25.0) + 5.5e-05
|
||||
} else {
|
||||
0.0
|
||||
}
|
||||
}
|
||||
}
|
||||
for (HV in (WALL_L..WALL_R step 1000.0)) {
|
||||
scatter {
|
||||
name = "${HV / 1000.0} keV"
|
||||
|
||||
Reference in New Issue
Block a user