In [1]:
%matplotlib inline

import numpy as np
import matplotlib.pyplot as plt
from simmit import smartplus as sim
from simmit import identify as iden
import pandas as pd
import os
from shutil import copyfile

from scipy.optimize import minimize

dir = os.path.dirname(os.path.realpath('__file__'))
number = mnumber;
value = mvalue;
input_values = arma2numpy::array2vec(minput_values);
key = mkey;
ninput_files = mninput_files;
input_files = arma2numpy::py_list_to_std_vector_string(minput_files);

In [2]:
umat_name = 'MIPLN' #This is the 5 character code for the periodic homogenization for multlayered composite
nstatev = 0 #The number of scalar variables required, everything is stored in sub-phases statevs

rho = 1.12 #The density of the material (overall)
c_p = 1.64 #The specific heat capacity (overall)

nphases = 2 #The number of phases
num_file = 0 #The num of the file that contains the subphases

psi_rve = 0.
theta_rve = 0.
phi_rve = 0.

props = np.array([nphases, num_file])

#NPhases_file = dir + '/data/Nlayers0.dat'
#NPhases = pd.read_csv(NPhases_file, delimiter=r'\s+', index_col=False, engine='python')
#NPhases[::]

In [ ]:
#The array of parameters
p = np.zeros(5)

#Replace the constants
res = minimize(iden.cost_solver, p,  method='nelder-mead', options={'xtol': 1e-8, 'disp': True})
#res = minimize(sim_solver, p,  method='Powell', options={'xtol': 1e-8, 'disp': True})
#res = minimize(iden.cost_solver, p, method='CG')
#res = minimize(sim_solver, p,  jac=None, hess=None, method='BFGS', options={'disp': True})

print(res)

In [ ]:
print(const_list[0].number)
print(const_list[1].number)

print(param_list[0].value)
print(param_list[1].value)
print(param_list[2].value)
print(param_list[3].value)
print(param_list[4].value)

In [ ]: