Example #1
0
from coef_setting import declare_coef #1
import main_code as main #2
#import main_code_con as main2
import picture_2d as pic #3
#from picture_2d_con import pic_2d
#from picture_3d import pic_3d

import numpy
from timeit import default_timer as timer 
import time
import matplotlib.pyplot as plt 
from mpmath.functions.rszeta import coef

#declare coefficients & initial settings
coef, set, sol = declare_coef() #1

#to plot interactively
plt.ion()

while set['t'] <= set['T'] and set['k'] < set['Nt']:
    if set['con'] == True:
        sol = main.continuous_iter(coef, set, sol)
        '''PRINTING RESULT AS CONTROL'''
        print 'at Time', set['t']
        if not coef['Si'] == 0:
            print 'NILAI C, b, n MAX', sol['c'].max(),',', sol['b'].max(),',', sol['n'].max()
            print 'NILAI C, b, n MIN', sol['c'].min(),',', sol['b'].min(),',', sol['n'].min()
    else:
        sol = main.boolean_1_iter(coef, set, sol) #2                 
        
        if sol['stop_iter'] >=100000:
Example #2
0
from timeit import default_timer as timer
import time

import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.ticker import LinearLocator, FormatStrFormatter
from mpl_toolkits.mplot3d import Axes3D
#from mpmath.functions.rszeta import coef
#import discrete_run as disc

from matplotlib import cm
from matplotlib.ticker import LinearLocator, FormatStrFormatter
from mpl_toolkits.mplot3d import Axes3D

#declare coefficients & initial settings
coef, set, sol = declare_coef()

#to plot interactively
plt.ion()

#hybrid part
while set['t'] <= set['T'] and set['k'] < set['Nt']:
    start1 = timer()
    sol = disc.boolean_1_iter(coef, set, sol)
    start2 = timer()

    if sol['stop_iter'] >= 100000:
        set['k'] = sol['stop_iter']
    '''PRINTING RESULT AS CONTROL'''
    print 'at Time', set['t']
    print 'Total Tips:', len(sol['matrix_tip'])
Example #3
0
'''Import all files. We run all the files through run_main_code.py'''
from coef_setting import declare_coef  #Ref.1
from initial_conditions import initial_prof  #Ref.2
import main_code as main  #Ref.4
import picture_2d as pic  #Ref.5
'''Import additional functions to support calculation and graphics'''
import numpy
from timeit import default_timer as timer
import time
import matplotlib.pyplot as plt

plt.ion()  #to plot interactively
'''declare coefficients & initial settings'''
coef, set, sol = declare_coef()  #Ref.1
'''Initialize functions for k=0 (first iteration), t=0 (initial time)'''
sol = initial_prof(coef, set, sol)  #Ref.2
pic.pic_2d(coef, set,
           sol)  #to generate the picture of initial condition #Ref.5
print '''All Coefficients:'''
print coef
print '''All Set'''
print set
'''PRINTING RESULT AS CONTROL'''
print 'at Time', set['t']
print 'Total Tips:', len(sol['matrix_tip'])
print 'Total Stop Tips:', len(sol['sp_stop'])
print 'Tip Stop:', sol['sp_stop']
print 'Tip Cell Pos:', sol['tip_cell']
print 'Max Value of c, f', sol['c'].max(), ',', sol['f'].max()
print 'Min Value of c, f', sol['c'].min(), ',', sol['f'].min()
'''Main part of the Hybrid calculation'''