Optimise material parameter
Hi,
I am optimising k1 for the luding material, by using o.reset in a for loop. The code is not going through the loop, the code just goes to the last iteration. For example, I am going iterate through 100 iteration and I set in a loop, "for i in range (0,n_iteration,
How can I run my simulation in the loop, for n number of iteration. And changing the parameter for each iteration.
Best,
Mithu
Here is my code
#!/usr/bin/env python
#encoding: ascii
# Testing of the Deformation Enginge with Luding Contact Law
# Modified Oedometric Test
# The reference paper [Haustein2017]
from __future__ import print_function
from yade import utils, plot, timing
from yade import pack
import pandas as pd
import numpy as np
from PIL import Image
from yade import pack, export
from scipy.interpolate import interp1d
o = Omega()
# Physical parameters
fr = 0.54
rho = 1550
Diameter = 0.0012
D=Diameter
r1 = Diameter/2
#r2 = Diameter/2
k1 = 50000
kp = 5.0*k1
kc = k1 * 0.1
ks = k1 * 0.1
DeltaPMax = Diameter/3.0
Chi1 = 0.34
o.dt = 1.0e-7
particleMass = 4.0/3.0*
Vi1 = math.sqrt(
PhiF1=0.999
#PhiF1 = DeltaPMax*
Tab_rad=0.005
Cyl_height=0.045
cross_area=
loading_exp = pd.read_csv (r'Gao_
loading_exp = pd.DataFrame(
f1_loading = interp1d(
porosity_
interpol_
unloading_exp = pd.read_csv (r'Gao_
unloading_exp = pd.DataFrame(
f1_unloading = interp1d(
porosity_
interpol_
Comp_press= max(loading_
Comp_force=
n_iter=80
RMSE_save=[]
#******
for i in range (0,n_iter,1):
o.reset()
compression
# Add material
mat1 = O.materials.
# Spheres for compression
sp=
sp.
sp.
walls=
# Add engines
o.engines = [
ForceResett
InsertionSo
Interaction
),
NewtonInteg
PyRunner(
#DeformCont
]
def checkForce():
if O.iter < 10000:
return
highSphere = 0.0
for b in O.bodies:
if highSphere < b.state.pos[2] and isinstance(b.shape, Sphere):
else:
global plate
plate = O.bodies[-1]
O.engines = O.engines + [PyRunner(
def unloadPlate():
if abs(O.forces.
def stopUnloading():
if abs(O.forces.
if i<1:
if RMSE_loading>4000:
else:
def checkdata():
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Jan Stránský
- Solved:
- Last query:
- Last reply: