good progress, diff in nonlinear_op

This commit is contained in:
Benoît Sierro
2021-11-02 17:02:45 +01:00
parent fe9fac6a8c
commit 772c480397
13 changed files with 439 additions and 183 deletions

View File

@@ -0,0 +1,19 @@
name = "/Users/benoitsierro/tests/test_sc/Chang2011Fig2"
wavelength = 800e-9
shape = "gaussian"
energy = 2.5e-6
width = 30e-15
core_radius = 10e-6
model = "marcatili"
gas_name = "argon"
pressure = 1e5
length = 0.1
interpolation_range = [100e-9, 3000e-9]
full_field = true
dt = 0.1e-15
t_num = 32768
z_num = 128
step_size = 2e-6

View File

@@ -0,0 +1,37 @@
import warnings
import matplotlib.pyplot as plt
import numpy as np
import scgenerator as sc
from customfunc.app import PlotApp
from scgenerator.physics.simulate import RK4IP
from customfunc import pprint
warnings.filterwarnings("error")
def main():
params = sc.Parameters.load("testing/configs/Chang2011Fig2.toml")
x = params.l * 1e9
o = np.argsort(x)
x = x[o]
plt.plot(x, sc.abs2(params.spec_0[o]))
state = sc.operators.CurrentState(
params.length, 0, params.step_size, 1.0, params.ifft, params.spec_0
)
# expD = np.exp(state.h / 2 * params.linear_operator(state))
# plt.plot(x, expD.imag[o], x, expD.real[o])
plt.plot(x, sc.abs2(params.nonlinear_operator(state))[o])
plt.yscale("log")
plt.xlim(100, 2000)
plt.show()
# for *_, spec in RK4IP(params).irun():
# plt.plot(w[2:-2], sc.abs2(spec[ind]))
# plt.show()
# plt.close()
if __name__ == "__main__":
main()