Exemple #1
0
import matplotlib.pyplot as plt
import numpy as np


plt.figure(1)
x = np.linspace(0, 5, 100)
y = np.sin(x)
z = np.cos(x)
plt.plot(x, y, x, z)
plt.savefig('basic_plot.pdf')

from nice_plots import init_nice_plots
init_nice_plots()

plt.figure(2)
plt.plot(x, y, 'k-', label='$\sin(x)$')
plt.plot(x, z, 'b-.', label='$\cos(x)$')
plt.xlabel('$x$')
plt.legend()
plt.savefig('basic_plot_nice.pdf')


plt.figure(3)
plt.plot(x, y, 'k-')
plt.plot(x, z, 'b-.')
plt.xlabel('$x$')
plt.annotate('$\sin(x)$', (3, 0.25), color='k', size=16)
plt.annotate('$\cos(x)$', (1.5, 0.25), color='b', size=16)
plt.savefig('basic_plot_nice_annotate.pdf')
Exemple #2
0
        r = A / (B + C)
        return r
        
    def evaluate(self, e_mev):
        e = e_mev 
        # Evaluate flux at Energy e in eV
        return  (e<=self.e1)             * self.c1*self.m(e) + \
                (e>self.e1)*(e<=self.e2) * (self.c2 / e)     + \
                (e>self.e2)              * self.c3*self.chi(e)

if __name__ == "__main__" :

    import matplotlib.pyplot as plt
    from multigroup_utilities import *
    from nice_plots import init_nice_plots
    init_nice_plots()
    from master_data import img_directory
    # PWR-like and TRIGA-like spectra
    pwr = Flux(7.0, 600.0)
    #triga = Flux(1.0, 600.0)
        
    # Evaluate the flux
    E = np.logspace(-5, 7, 1000)
    phi_pwr = pwr.evaluate(E)
    #phi_triga = triga.evaluate(E)
   
    fast = quad(pwr.evaluate, 0.625, 1e7, limit=200)[0]
    therm = quad(pwr.evaluate, 1e-5, 0.625, limit=200)[0]
    tot = fast+therm
    print("fast to thermal = ", fast/therm)
     
Exemple #3
0
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Sat Nov 19 16:07:22 2016

@author: rabab
"""

import numpy as np
import matplotlib.pyplot as plt
from scipy import interpolate
import os
import nice_plots

nice_plots.init_nice_plots()
""" This part extracts the compositions of different isotopes from serpent output files and 
arrange them into arrays  for each istope which their width is the  number irradiation steps and their height
is the number of decay steps
"""

f = []

U_234 = np.zeros([28, 22])
U_235 = np.zeros([28, 22])
U_236 = np.zeros([28, 22])
U_238 = np.zeros([28, 22])
Np_237 = np.zeros([28, 22])
Pu_238 = np.zeros([28, 22])
Pu_239 = np.zeros([28, 22])
Pu_240 = np.zeros([28, 22])
Pu_241 = np.zeros([28, 22])