From 205bee1f4a229319755f8ac02cfb7d146f26576f Mon Sep 17 00:00:00 2001 From: Hemaditya Malla Date: Thu, 12 Oct 2023 22:08:30 +0200 Subject: [PATCH] Added a small ODE test for fast slow heating --- .../gasheating_ODE/gas_heating_0D.py | 42 +++++++ ...powerDensity_power_density_pointVsTime.txt | 118 ++++++++++++++++++ 2 files changed, 160 insertions(+) create mode 100644 programs/multipulse_2d/gasheating_ODE/gas_heating_0D.py create mode 100644 programs/multipulse_2d/gasheating_ODE/powerDensity_power_density_pointVsTime.txt diff --git a/programs/multipulse_2d/gasheating_ODE/gas_heating_0D.py b/programs/multipulse_2d/gasheating_ODE/gas_heating_0D.py new file mode 100644 index 00000000..6e071b09 --- /dev/null +++ b/programs/multipulse_2d/gasheating_ODE/gas_heating_0D.py @@ -0,0 +1,42 @@ +import numpy as np +import matplotlib.pyplot as plt +from scipy.integrate import odeint + + +data = np.loadtxt("powerDensity_power_density_pointVsTime.txt") + + +def f(y, t, eta_f, eta_s, tau_vt): + E, Evt = y + jE = np.interp(t, data[:,0], data[:,1]) + return [eta_f*jE + Evt, eta_s*jE - Evt/tau_vt] + + + + +dt = 1e-10 +tstart, tend = 0, 5e-6 +Nt = int((tend-tstart)/dt) +t = np.linspace(tstart, tend, Nt) +eta_f, eta_s, tau_vt = 0.3, 0.7, 20e-6 +E0 = 1e5/(1.4-1.0) + + +solution = odeint(f, [E0, 0], t, args=(eta_f, eta_s, tau_vt)) + + +plt.plot(t, solution[:,0], 'b-', label="Translation") +plt.plot(t, solution[:,1], 'g-', label="Vibration") +plt.legend() +plt.figure(2) +kb = 1.38e-23 +N = 2.4e25 +Tg = (solution[:,0]*(1.4-1))/(kb*N) +P = solution[:,0]*0.4 +plt.plot(t, Tg) +plt.show() + + + + + diff --git a/programs/multipulse_2d/gasheating_ODE/powerDensity_power_density_pointVsTime.txt b/programs/multipulse_2d/gasheating_ODE/powerDensity_power_density_pointVsTime.txt new file mode 100644 index 00000000..32f13e92 --- /dev/null +++ b/programs/multipulse_2d/gasheating_ODE/powerDensity_power_density_pointVsTime.txt @@ -0,0 +1,118 @@ +0.000000000000000000e+00 0.000000000000000000e+00 +1.000000000000000062e-09 2.177821962567687500e+06 +2.000000000000000125e-09 2.119006451723088976e+06 +2.999999999999999980e-09 2.074396289199114311e+06 +4.000000000000000249e-09 2.039737549820335116e+06 +5.000000000000000932e-09 2.019655652829000494e+06 +6.000000000000001614e-09 2.025350099115154939e+06 +7.000000000000002297e-09 2.079061332101868000e+06 +8.000000000000002153e-09 2.245334038181012962e+06 +9.000000000000001181e-09 2.752978070982861798e+06 +1.000000000000000021e-08 4.872781150199885480e+06 +1.099999999999999924e-08 2.615544126009321213e+07 +1.199999999999999827e-08 7.447174137894983398e+12 +1.299999999999999729e-08 3.592283084521932373e+11 +1.399999999999999632e-08 2.578972954652363586e+11 +1.499999999999999535e-08 1.796995387620896606e+11 +6.499999999999999971e-08 9.472548648420952304e+03 +1.149999999999999974e-07 1.206738700879921709e+02 +1.650000000000000084e-07 2.725898595065802343e+00 +2.150000000000000062e-07 6.239935911911521915e-02 +2.650000000000000568e-07 1.488882407332626796e-03 +3.150000000000001075e-07 3.879556132733666683e-05 +3.650000000000001582e-07 1.108216513068518305e-06 +4.150000000000002089e-07 3.409192619742962371e-08 +4.650000000000002595e-07 1.106411707513318553e-09 +5.150000000000002573e-07 3.748247878061710863e-11 +5.650000000000002021e-07 1.317241959409053517e-12 +6.150000000000001469e-07 4.782224243975031466e-14 +6.650000000000000917e-07 1.791104390236015600e-15 +7.150000000000000365e-07 6.900309126184291991e-17 +7.649999999999999813e-07 2.726473278087523547e-18 +8.149999999999999261e-07 1.103141790110468640e-19 +8.649999999999998709e-07 4.556445674423072519e-21 +9.149999999999998157e-07 1.914918253574221492e-22 +9.649999999999998663e-07 8.159760088813149317e-24 +9.990226498457409927e-07 9.592510663007572568e-25 +1.024522649845741003e-06 2.814534814560392567e-25 +1.074522649845740947e-06 1.247638080734880381e-26 +1.124522649845740892e-06 5.557369987056900271e-28 +1.174522649845740837e-06 2.475528696487838536e-29 +1.224522649845740782e-06 1.101191048527540585e-30 +1.274522649845740727e-06 4.889414754611855963e-32 +1.324522649845740671e-06 2.167069621933424723e-33 +1.374522649845740616e-06 9.590603240904092612e-35 +1.424522649845740561e-06 4.240107903738662548e-36 +1.474522649845740506e-06 1.873483999892392325e-37 +1.524522649845740451e-06 0.000000000000000000e+00 +1.574522649845740395e-06 0.000000000000000000e+00 +1.624522649845740340e-06 0.000000000000000000e+00 +1.674522649845740285e-06 0.000000000000000000e+00 +1.724522649845740230e-06 0.000000000000000000e+00 +1.774522649845740175e-06 0.000000000000000000e+00 +1.824522649845740119e-06 0.000000000000000000e+00 +1.874522649845740064e-06 0.000000000000000000e+00 +1.924522649845740221e-06 0.000000000000000000e+00 +1.974522649845740589e-06 0.000000000000000000e+00 +1.999525301147237474e-06 0.000000000000000000e+00 +2.049525301147237842e-06 0.000000000000000000e+00 +2.099525301147238210e-06 0.000000000000000000e+00 +2.149525301147238579e-06 0.000000000000000000e+00 +2.199525301147238947e-06 0.000000000000000000e+00 +2.249525301147239315e-06 0.000000000000000000e+00 +2.299525301147239683e-06 0.000000000000000000e+00 +2.349525301147240052e-06 0.000000000000000000e+00 +2.399525301147240420e-06 0.000000000000000000e+00 +2.449525301147240788e-06 0.000000000000000000e+00 +2.499525301147241157e-06 0.000000000000000000e+00 +2.549525301147241525e-06 0.000000000000000000e+00 +2.599525301147241893e-06 0.000000000000000000e+00 +2.649525301147242262e-06 0.000000000000000000e+00 +2.699525301147242630e-06 0.000000000000000000e+00 +2.749525301147242998e-06 0.000000000000000000e+00 +2.799525301147243367e-06 0.000000000000000000e+00 +2.849525301147243735e-06 0.000000000000000000e+00 +2.899525301147244103e-06 0.000000000000000000e+00 +2.949525301147244472e-06 0.000000000000000000e+00 +2.999017093401864684e-06 0.000000000000000000e+00 +3.024517093401864694e-06 0.000000000000000000e+00 +3.074517093401865062e-06 0.000000000000000000e+00 +3.124517093401865430e-06 0.000000000000000000e+00 +3.174517093401865799e-06 0.000000000000000000e+00 +3.224517093401866167e-06 0.000000000000000000e+00 +3.274517093401866535e-06 0.000000000000000000e+00 +3.324517093401866904e-06 0.000000000000000000e+00 +3.374517093401867272e-06 0.000000000000000000e+00 +3.424517093401867640e-06 0.000000000000000000e+00 +3.474517093401868009e-06 0.000000000000000000e+00 +3.524517093401868377e-06 0.000000000000000000e+00 +3.574517093401868745e-06 0.000000000000000000e+00 +3.624517093401869114e-06 0.000000000000000000e+00 +3.674517093401869482e-06 0.000000000000000000e+00 +3.724517093401869850e-06 0.000000000000000000e+00 +3.774517093401870218e-06 0.000000000000000000e+00 +3.824517093401870163e-06 0.000000000000000000e+00 +3.874517093401869685e-06 0.000000000000000000e+00 +3.924517093401869206e-06 0.000000000000000000e+00 +3.974517093401868727e-06 0.000000000000000000e+00 +3.999535302378937914e-06 0.000000000000000000e+00 +4.049535302378937435e-06 0.000000000000000000e+00 +4.099535302378936956e-06 0.000000000000000000e+00 +4.149535302378936478e-06 0.000000000000000000e+00 +4.199535302378935999e-06 0.000000000000000000e+00 +4.249535302378935520e-06 0.000000000000000000e+00 +4.299535302378935042e-06 0.000000000000000000e+00 +4.349535302378934563e-06 0.000000000000000000e+00 +4.399535302378934084e-06 0.000000000000000000e+00 +4.449535302378933605e-06 0.000000000000000000e+00 +4.499535302378933127e-06 0.000000000000000000e+00 +4.549535302378932648e-06 0.000000000000000000e+00 +4.599535302378932169e-06 0.000000000000000000e+00 +4.649535302378931691e-06 0.000000000000000000e+00 +4.699535302378931212e-06 0.000000000000000000e+00 +4.749535302378930733e-06 0.000000000000000000e+00 +4.799535302378930254e-06 0.000000000000000000e+00 +4.849535302378929776e-06 0.000000000000000000e+00 +4.899535302378929297e-06 0.000000000000000000e+00 +4.949535302378928818e-06 0.000000000000000000e+00 +4.999017741823638530e-06 0.000000000000000000e+00