Non-linear flow behaviour of rough fractures having standard JRC profiles

Non-linear flow behaviour of rough fractures having standard JRC profiles
Non-linear flow behaviour of rough fractures having standard JRC profiles

Technical Note

Non-linear?ow behaviour of rough fractures having standard

JRC pro?les

Mahdi Zoorabadi n,Serkan Saydam,Wendy Timms,Bruce Hebblewhite

School of Mining Engineering,UNSW Australia,Sydney2052,NSW,Australia

a r t i c l e i n f o

Article history:

Received28July2014

Received in revised form

10November2014

Accepted4March2015

Available online2April2015

Keywords:

Rock fracture

Nonlinear?ow conditions

JRC pro?les

1.Introduction

The Darcian?ow law,which expresses a linear relationship

between water pressure gradient and?ow rate,is commonly used

for interpretation of hydrogeological?eld tests[1,2].In jointed

rocks where the transmissivity is typically controlled by existing

fractures,non-linear?ow conditions can sometimes occur.The

non-linear relationship between water pressure gradient and?ow

rate may have considerable effects on the transmissivity calculated

from?eld tests[3–9].

The validity of the Darcy’s law and linear?ow expressions for

analysing water?ow within rock fractures have been widely

studied.Louis[10]empirically de?ned?ve steady state?ow

regimes for rock fractures.These?ow regimes start from laminar,

through to fully developed turbulent?ow depending on relative

roughness and?ow velocity.In fact,switching from linear Darcy

?ow to turbulent?ow is not immediate,and there is a transitional

regime between them[11].

Reynolds number(Re)is commonly used for distinguishing

between linear?ow(laminar)and nonlinear?ow regions(tran-

sient and turbulent?ow).It is a dimensionless number that gives a

measure of the ratio of inertial forces to viscous forces[12,13]:

Re?eρV2T=

μv

e

?VD e=?e1T

whereρis the density of water,V is the mean velocity of water,μis

the dynamic viscosity of water,D e is the hydraulic diameter of the

fracture(equal to two times the hydraulic aperture),and?is the

kinematic viscosity of water.A wide range of Reynolds number has

been reported in the literature for distinguishing between linear

and nonlinear?ow conditions.Romm[14]conducted laboratory

tests on fractures with different surface roughness and found that

the Darcy’s law is valid when the Reynolds number is smaller than

2400.A Reynolds number less than500–600was reported by

Louis[10]for smooth surfaces to have a linear?ow condition.

Durham and Bonner[15],Skjetne et al.[16],and Zimmerman and

Yeo[17]concluded that the transition from linear laminar?ow to

nonlinear?ow occurred at Reynolds numbers between1and25.

Wittke[18]and Lee and Farmer[19]suggested that transition

to nonlinearity occurs in the range100–2300for Reynolds

number.Although these studies had been done at different rough-

ness geometry and different?ow channel,the reported threshold

Reynolds numbers cover a wide range.

For single-phase?ow through a given rock joint with width of

w,the transmissivity has the following relationship with?ow rate

(Q)and pressure gradiente?pT:

T?

àμQ

w?p

e2T

Since the ratio of?ow rate and pressure gradient is constant for

the linear?ow condition(Darcy?ow),the transmissivity for linear

?ow is a constant value and can be calculated by the following

equation,known as cubic law:

T0?

a h3

e3T

Contents lists available at ScienceDirect

journal homepage:https://www.360docs.net/doc/336659730.html,/locate/ijrmms

International Journal of

Rock Mechanics&Mining Sciences

https://www.360docs.net/doc/336659730.html,/10.1016/j.ijrmms.2015.03.004

1365-1609/&2015Elsevier Ltd.All rights

reserved.

n Corresponding author.

E-mail address:m.zoorabadi@https://www.360docs.net/doc/336659730.html,.au(M.Zoorabadi).

International Journal of Rock Mechanics&Mining Sciences76(2015)192–199

where a h is the hydraulic aperture of the rough rock joint.The relationship between pressure gradient and ?ow rate for a nonlinear ?ow regime is commonly presented by the following two equations which were introduced by Forchheimer [20],and Izbash [21],respectively:à?p ?aQ tbQ 2e4Tà?p ?λQ m

e5T

where a and b ,are constants for the Forchheimer equation,which represent the linear and nonlinear components of pressure drop.Based on Darcy ’s law,the linear component can be calculated as a ?μ=T 0where μis the dynamic viscosity of water.The constant b in the Forchheimer equation and the constants,λand m ,in Izbash ’s equation are determined by back analysis of ?ow tests.Zimmerman et al.[22]further conducted laboratory experiments along with numerical modelling to investigate nonlinear ?ow through rough fractures.They plotted the normalised transmissiv-ity,the ratio between measured transmissivity (T )and that calculated from linear ?ow (T 0),against Reynolds number.They showed that for Reynolds numbers higher than 10,the nonlinear-ity increases rapidly.Nonlinear ?ow behaviour can be modelled by the Forchheimer equation [20,22]as follows:T ?

T 01tβR e

e6T

where βis a dimensionless constant and can be found by curve ?tting techniques.Al-Yaarubi [23]stated that the critical Reynolds number (threshold for linear ?ow regime)decreases with increas-ing fracture

roughness.

Fig.1.Arti ?cial joints corresponding to JRC pro ?les:(a)(8–10),(b)(10–12),(c)(12–14),(d)(14–16),(e)(16–18),(e)(18–

20).

Fig.2.Jig to adjust inlet gap for ?ow test on rough surfaces.

M.Zoorabadi et al./International Journal of Rock Mechanics &Mining Sciences 76(2015)192–199

193

Ranjith and Darlington [24]conducted laboratory experiments on single-phase ?ow through rough fractures.Their results con-?rmed that a Reynolds number of 10was a good approximation for distinguishing between the linear ?ow and nonlinear ?ow (Forchheimer regime)behaviour.Zhang and Nemcik [25]studied the ?ow regimes in laboratory experiments on tension fractures.Their study included ?ow tests through rough fractures under different applied normal stresses.They found that the analytical Forchheimer formulation and the empirical Izbash ’s equation have similar capabilities for modelling the nonlinear ?ow behaviour in rough fractures.

In the present paper,nonlinear ?ow through rough fractures is studied in laboratory experiments on some standard roughness pro ?les.The laboratory tests were completed by ?owing water through two matched Joint Roughness Coef ?cient (JRC)pro ?les.This study investigates the ?ow regimes for JRC pro ?les and explores the relationship between pressure gradient and ?ow rate for these pro ?les beyond the range of previously tested conditions by using advanced experimental techniques.

2.Test set-up and procedure

The joint roughness coef ?cient,JRC,which is a tool for quantifying roughness of real rock joints,was originally intro-duced by Barton and Choubey [26].In most cases,the roughness of the rock joints at the laboratory scale (10cm)is determined by the comparison of the joint ’s roughness pro ?les with proposed JRC pro ?les.These two-dimensional pro ?les were digitised by Tatone [27]with a sampling interval of approximately 0.5mm.Since the

standard JRC pro ?les were originally obtained using a pro ?le comb from laboratory samples with an accuracy of 0.5to 1mm,the digitised coordinates have proven to be suf ?ciently accurate [27].The digitised information showed that the maximum asperity amplitudes for JRC pro ?les 0–2,2–4,4–6,and 6–8are in the range of (0.6–1.71mm).By considering the resolution and the accuracy of measuring systems,arti ?cial joints of JRC pro ?les 8–10,10–12,12–14,14–16,16–18,and 18–20were prepared for the laboratory experiments.

In this regard,an advanced cutting technique called Electric Discharge Machining (EDM)was used to cut the real geometry of JRC pro ?les on aluminium blocks.Two-dimensional JRC pro ?les were extruded in depth to have a rough surface of 10?10cm dimension (Fig.1).In the EDM technique,the material is removed from the workpiece by a series of rapidly recurring current dis-charges between two electrodes,separated by a dielectric liquid and subject to an electric voltage [28].This method provided an accuracy of 0.1mm for the cutting of asperities on pro ?les.After cutting the pro ?les,their surfaces were mapped using an optical pro ?le projector.The comparison of the mapped surfaces with digitised points of the JRC pro ?les showed that the Root-Mean-Square Error (RMSE)between samples and their digitised pro ?les was about 0.034mm.Therefore,the calculated RMSE represents a high level of accuracy for this cutting method.

A custom designed jig was developed to adjust the inlet gap with high accuracy (0.05mm).This system provides the ability to do ?ow tests through JRC pro ?les or other rough surfaces with a 10?10cm dimension (Fig.2).

For investigation of the hydraulic properties of JRC pro ?les under linear and nonlinear ?ow conditions,water ?ow tests were conducted with different opening (mechanical aperture)and different water heads for each sample.The test set-up also inclu-ded an upper water tank,inlet and outlet reservoirs and a lower tank (as shown in Fig.3a and b).The two faces of the JRC pro ?les were sealed by silicon to provide the hydraulic

connection

https://www.360docs.net/doc/336659730.html,boratory experiment set-up for water ?ow test on JRC pro ?les;c is after Al-Johar [32]

.

Fig.4.Normalised transmissivity plotted against Re for JRC pro ?les,Forchheimer equation with βvalues found by Zimmerman et al.[22].

Table 1

Z 2values for tested JRC pro ?les [27].JRC pro ?le Z 28–100.19310–120.21212–140.23814–160.27716–180.32318–20

0.395

M.Zoorabadi et al./International Journal of Rock Mechanics &Mining Sciences 76(2015)192–199

194

Fig.5.3D scattering of normalised transmissivity against Reynolds number and relative

roughness.

Fig.6.Pressure gradient against ?ow rate,and curve ?tting of Forchheimer and Izbash equations (JRC 8–10and 10–12).

M.Zoorabadi et al./International Journal of Rock Mechanics &Mining Sciences 76(2015)192–199195

between the inlet and outlet reservoir only through the joint (schematically shown in Fig.3c).

3.Results and discussion

For each JRC pro ?le,?ow tests were conducted for three mechanical apertures (opening between upper and lower sur-faces)and different pressure gradients (112?ow tests).Although the designed set up has capability to apply a wide range of water pressure gradient,for this study it limited to pressure gradient of 0.05–2.In Fig.4,the normalised transmissivity was plotted against Reynolds number.The Forchheimer equation (Eq.5)was success-fully ?tted to the results with two βvalues which were introduced by Zimmerman et al.[22].This ?gure shows that the Forchheimer equation with β?0:00477can represent the trend satisfactorily.It can be seen from Fig.4that the normalised transmissivity decreases with increasing roughness.The variation of Reynolds number from 10to 300reduces the normalised transmissivity from 0.95to 0.4.

Lomize [29]and Louis [10]showed that the roughness geome-try controls the hydraulic properties of rough fractures.They used

the expression of Relative Roughness which is common for ?ow through pipes and channels as an index for quantifying the roughness geometry.This parameter represents the effect of roughness on ?ow behaviour,which decreases with an increase of the gap between the upper and lower surfaces of rough fractures.The roughness of rock fractures and JRC pro ?les are different with the roughness inside a pipe.The JRC pro ?les consist of several irregularities and their roughness cannot be shown only by asperity amplitude.The water ?ow within JRC pro ?les is affected by small-scale irregularities and undulations.Tse and Cruden [30]used Z 2as a tool to measure the fracture roughness.This parameter represents the root mean square of the ?rst derivative of the asperities ’amplitudes and is calculated as follows:

Z 2?1Z L x ?0dz

2????????????????????????????????????????????????

1n eΔx TX n i ?1eZ i t1àZ i T2

v u u t e7Twhere L is the total length of the pro ?le and Z i t1,Z i are the

elevations of two successive points over the length of the pro ?le,n is the total number of points,and Δx is the interval between two successive points.Tatone [27]calculated Z 2for JRC pro ?les

and

Fig.7.Pressure gradient against ?ow rate,and curve ?tting of Forchheimer and Izbash equations (JRC 12–14and 14–16).

M.Zoorabadi et al./International Journal of Rock Mechanics &Mining Sciences 76(2015)192–199

196

their values for the tested pro ?les are listed in Table 1.In fact,Z 2represents the variation of asperity height along a given direction.

In this paper,the relative roughness is de ?ned as the ratio between Z 2and the hydraulic aperture.Zoorabadi et al.[31]applied a semi-analytical procedure on JRC pro ?les and found the following relationship between aperture ratio (hydraulic aperture to mechanical aperture)and JRC value,a h =a m ?0:9912à4:653e à6?JRC 3:303

e8T

This equation is based on the cubic law and is valid for linear ?ow conditions.In Fig.5,the scattering plot of normalised against Reynolds number and relative roughness is shown.The higher relative roughness represents a fracture with a higher roughness and smaller opening.The scattering on the plot of the normalised transmissivity against Reynolds number can be explained using the results presented in Fig.5.It can be seen that for a relative roughness between 0.6and 1.4the effective Reynolds number is limited to Re

less

Fig.8.Pressure gradient against ?ow rate,and curve ?tting of Forchheimer and Izbash equations (JRC 16–18and 18–

20).

Fig.9.Variation of constant parameter m with relative roughness (Izabsh

Equation).Fig.10.Variation of constant parameter λwith relative roughness (Izabsh Equation).

M.Zoorabadi et al./International Journal of Rock Mechanics &Mining Sciences 76(2015)192–199197

than 100.The effective range of Reynolds numbers would be in the range of 10–900for a relative roughness between 0.2and 0.4.These ranges are limited to the applied pressure gradient.

The variation of measured transmissivity with Reynolds num-ber and relative roughness (Figs.4and 5)shows a non-constant ratio between ?ow rate and pressure gradient (nonlinear ?ow conditions)in Eq.(4).In Figs.6–8,the applied pressure gradient is plotted against measured and predicted ?ow rates for each ?ow test.The cubic law has been used to calculate the predicted ?ow rates.These results show a clear nonlinearity between the pres-sure gradient and ?ow rate for the JRC pro ?les.The Forchheimer and Izbash equations (Eqs.(6)and (4))were ?tted to the results to compare their ability to represent this nonlinear conditions.The regression analysis demonstrates the capability of both equations to model the nonlinear relationship between pressure gradient and ?ow rate for rough fractures.

The constant parameters of both equations have been deter-mined by regression analysis for each JRC pro ?le with different relative roughness.For the Izbash equation,the variation range of m is between 1.1and 1.39with an average of 1.234and standard deviation of 0.071.This parameter does not indicate a clear corr-elation with relative roughness (Fig.9).Unlike m the constant parameter of λincreases clearly with relative roughness increasing (Fig.10).For the Forchheimer equation,both constant parameters (a,b )show an increasing trend with relative roughness (Figs.11and 12).The relative roughness increases with increasing of fracture roughness (increasing JRC)for same range of fracture aperture.Then these results con ?rm that the nonlinearity is higher in the fractures with higher roughness.

4.Conclusions

Nonlinear ?ow conditions can occur inside rock fractures during hydrogeological tests such as packer tests and well tests,particularly with high ?ow rates.However,the assumption of linear ?ow conditions for interpretation of these tests can sig-ni ?cantly affect the results and underestimate the hydraulic

conductivity.This paper presents a detailed investigation of non-linear ?ow through rough fractures,quantifying the impact of nonlinear conditions on the relationship between hydraulic gra-dient and transmissivity.For this study,?ow tests were conducted on JRC pro ?les which are commonly used to quantify fracture roughness.

This study shows that the Reynolds number and relative rough-ness control nonlinear ?ow within rough fractures.The results from this study are consistent with previous studies [22,24]which showed that the normalised transmissivity decreases with increas-ing Reynolds number.The range of this reducing trend was limited to Re less than 100.This range has been signi ?cantly extended by this study which provides a reference for most range of applica-tions.The effects of relative roughness on the transmissivity of rough fractures were investigated by 3D plots of normalised transmissivity against Reynolds number and relative roughness.The relative roughness controls the effective range of the Reynolds number.For a higher range of relative roughness which represents smaller aperture or higher roughness,the in ?uence of the Reynolds number is limited.

The nonlinear relationship between pressure gradient and ?ow rate has been studied for rough fractures.The Izbash and For-chheimer equations were ?tted to ?ow test results for each JRC pro ?le.Both equations were demonstrated to have a similar ability to model nonlinear ?ow conditions.For the ?rst time,the empirical constants of Izbash and Forchheimer equations were developed for each JRC pro ?les.It was shown that the variation range of constant parameter of m in the Izbash equation is independent of relative roughness.These equations has potential to be used in the numerical modelling of water ?ow through fractured rocks to increase the accuracy of ?ow modelling.

References

[1]Hvorslev MJ.Time lag and soil permeability in ground water observation.U.S.

Army:Waterways Exper.Sta.Corps of Engrs;1951.p.1–50.

[2]Bouwer H,Rice RC.A slug test method for determining hydraulic conductivity

of uncon ?ned aquifers with completely or partially penetrating wells.Water Resour Res 1976;12(3):423–8.

[3]Louis C,Maini Y.Determination of in situ hydraulic parameters in jointed rock.

In:Proc second int.congr.vol.I.Belgrade:Rock Mechanics;1970.p.p.235–45.[4]Elsworth D,Doe TW.Application of non-linear ?ow laws in determining rock

?ssure geometry from single borehole pumping tests.Int J Rock Mech Min Sci 1986;23:245–53.

[5]Javadi M,Sharifzadeh M,Shahriar K.A new geometrical model for non-linear

?uid ?ow through rough fractures.J Hydrol 2010;389(1–2):18–30.

[6]Cherubini C,Giasi CI,Pastore N.Bench scale laboratory tests to analyze non-linear ?ow in fractured media.Hydrol Earth Syst Sci 2012;16(8):2511–22.[7]Cherubini C,Giasi CI,Pastore N.Evidence of non-Darcy ?ow and non-Fickian

transport in fractured media at laboratory scale.Hydrol Earth Syst Sci 2013;17(7):2599–611.

[8]Quinn PM,Parker BL,Cherry JA.Validation of non-Darcian ?ow effects in slug

tests conducted in fractured rock boreholes.J Hydrol 2013;486(0):505–18.[9]Wen Z,Liu K,Chen X.Approximate analytical solution for non-Darcian ?ow

toward a partially penetrating well in a con ?ned aquifer.J Hydrol.2013;498:124–31.

[10]Louis C.A study of groundwater ?ow in jointed rock and its in ?uence on the

stability of rock masses.London:Rock Mechanics Research Report,imperial college;1969.

[11]Kohl T,Evans KF,Hopkirk RJ,Jung R,Rybach L.Observation and simulation of

non-Darcian ?ow transients in fractured rock.Water Res Res 1997;33(3):407–18.

[12]Reynolds O.An experimental investigation of the circumstances which

determine whether the motion of water shall be direct or sinous,and of the law or resistances in parallel channels.Philos Trans R Soc London 1883;174:935–81.

[13]Potter M,Wiggert DC.Fluid mechanics.New York:McGraw-Hill;2008.

[14]Romm ES.Filteratsionnye svoistva treshchinovatykh gronyx porod (Flow

characteristics of fractured rocks).Moscow:Nedra;1966.

[15]Durham WB,Bonner BP.Self-propping and ?uid ?ow in slightly offset joints at

high effective pressures.J Geophys Res Solid Earth 1994;99(B5):9391–9.

[16]Skjetne E,Hansen A,Gudmundsson JS.High-velocity ?ow in a rough fracture.

J Fluid Mech 1999;383:1–28

.

Fig.11.Variation of constant parameter a with relative roughness (Forchheimer

equation).

Fig.12.Variation of constant parameter b with relative roughness (Forchheimer equation).

M.Zoorabadi et al./International Journal of Rock Mechanics &Mining Sciences 76(2015)192–199

198

[17]Zimmerman RW,Yeo IW.Fluid?ow in rock fractures:from the navier-stokes

equations to the cubic law.In:Dynamics of?uids in fractured rock.American Geophysical Union;2000.p.213–24.

[18]Wittke W.Rock mechanics:theory and applications with case histories.

Berlin:Springer;1990.

[19]Lee CH,Farmer I.Fluid?ow in discontinuous rocks.London:Chapman&Hall;

1993.

[20]Forchheimer P.Wasserbewegung durch Boden.ZVDI1901;45(6):1782–7.

[21]Izbash SV O.Filtracii v kropnozernstom material.Leningrad:Nauchnoissled

Inst Gidrotechniki(NIIG);1931.

[22]Zimmerman RW,Al-Yaarubi A,Pain CC,Grattoni CA.Non-linear regimes

of?uid?ow in rock fractures.Int J Rock Mech Min Sci2004;41(3): 384384.

[23]Al-Yaarubi A.Numerical and experimental study of?uid?ow in a rough-

walled rock fracture.PhD thesis.London:Imperial College;2003.

[24]Ranjith PG,Darlington W.Nonlinear single-phase?ow in real rock joints.

Water Resour Res2007;43(9):W09502.[25]Zhang Z,Nemcik J.Fluid?ow regimes and nonlinear?ow characteristics in

deformable rock fractures.J Hydrol2013;477(0):139–51.

[26]Barton N,Choubey V.The shear strength of rock joints in theory and practice.

Rock Mech1977;10(1-2):1–54.

[27]Tatone BA.Quantitative characterization of natural rock discontinuity rough-

ness In-situ and in the laboratory.MSc thesis.University of Toronto;2009.

[28]Ho KH,Newman ST.State of the art electrical discharge machine.Int J Mach

Tools Manuf2003;43:1287–99.

[29]Lomize G.Fluid?ow in?ssured formations.(In Russian).Moscow:Gosener-

oizdat;1951.

[30]Tse R,Cruden DM.Estimating joint roughness coef?cients.Int J Rock Mech

Min Sci1979;16(5):303–7.

[31]Zoorabadi M,Saydam,S,Timms W,Hebblewhite B.Semi-analytical procedure

for considering roughness effect on hydraulic properties of standard JRC pro?les.In:Proc47th US rock mechanics symposium,San Francisco;2013. [32]Al-Johar MM.Constraining fracture permeability by characterizing fracture

surface roughness.MSc https://www.360docs.net/doc/336659730.html,A:The University of Texas at Austin;2010.

M.Zoorabadi et al./International Journal of Rock Mechanics&Mining Sciences76(2015)192–199199

BP神经网络实验——【机器学习与算法分析 精品资源池】

实验算法BP神经网络实验 【实验名称】 BP神经网络实验 【实验要求】 掌握BP神经网络模型应用过程,根据模型要求进行数据预处理,建模,评价与应用; 【背景描述】 神经网络:是一种应用类似于大脑神经突触联接的结构进行信息处理的数学模型。BP神经网络是一种按照误差逆向传播算法训练的多层前馈神经网络,是目前应用最广泛的神经网络。其基本组成单元是感知器神经元。 【知识准备】 了解BP神经网络模型的使用场景,数据标准。掌握Python/TensorFlow数据处理一般方法。了解keras神经网络模型搭建,训练以及应用方法 【实验设备】 Windows或Linux操作系统的计算机。部署TensorFlow,Python。本实验提供centos6.8环境。 【实验说明】 采用UCI机器学习库中的wine数据集作为算法数据,把数据集随机划分为训练集和测试集,分别对模型进行训练和测试。 【实验环境】 Pyrhon3.X,实验在命令行python中进行,或者把代码写在py脚本,由于本次为实验,以学习模型为主,所以在命令行中逐步执行代码,以便更加清晰地了解整个建模流程。 【实验步骤】 第一步:启动python: 1

命令行中键入python。 第二步:导入用到的包,并读取数据: (1).导入所需第三方包 import pandas as pd import numpy as np from keras.models import Sequential from https://www.360docs.net/doc/336659730.html,yers import Dense import keras (2).导入数据源,数据源地址:/opt/algorithm/BPNet/wine.txt df_wine = pd.read_csv("/opt/algorithm/BPNet/wine.txt", header=None).sample(frac=1) (3).查看数据 df_wine.head() 1

数据挖掘常用资源及工具

资源Github,kaggle Python工具库:Numpy,Pandas,Matplotlib,Scikit-Learn,tensorflow Numpy支持大量维度数组与矩阵运算,也针对数组提供大量的数学函数库 Numpy : 1.aaa = Numpy.genfromtxt(“文件路径”,delimiter = “,”,dtype = str)delimiter以指定字符分割,dtype 指定类型该函数能读取文件所以内容 aaa.dtype 返回aaa的类型 2.aaa = numpy.array([5,6,7,8]) 创建一个一维数组里面的东西都是同一个类型的 bbb = numpy.array([[1,2,3,4,5],[6,7,8,9,0],[11,22,33,44,55]]) 创建一个二维数组aaa.shape 返回数组的维度print(bbb[:,2]) 输出第二列 3.bbb = aaa.astype(int) 类型转换 4.aaa.min() 返回最小值 5.常见函数 aaa = numpy.arange(20) bbb = aaa.reshape(4,5)

numpy.arange(20) 生成0到19 aaa.reshape(4,5) 把数组转换成矩阵aaa.reshape(4,-1)自动计算列用-1 aaa.ravel()把矩阵转化成数组 bbb.ndim 返回bbb的维度 bbb.size 返回里面有多少元素 aaa = numpy.zeros((5,5)) 初始化一个全为0 的矩阵需要传进一个元组的格式默认是float aaa = numpy.ones((3,3,3),dtype = numpy.int) 需要指定dtype 为numpy.int aaa = np 随机函数aaa = numpy.random.random((3,3)) 生成三行三列 linspace 等差数列创建函数linspace(起始值,终止值,数量) 矩阵乘法: aaa = numpy.array([[1,2],[3,4]]) bbb = numpy.array([[5,6],[7,8]]) print(aaa*bbb) *是对应位置相乘 print(aaa.dot(bbb)) .dot是矩阵乘法行乘以列 print(numpy.dot(aaa,bbb)) 同上 6.矩阵常见操作

题库深度学习面试题型介绍及解析--第7期

1.简述激活函数的作用 使用激活函数的目的是为了向网络中加入非线性因素;加强网络的表示能力,解决线性模型无法解决的问题 2.那为什么要使用非线性激活函数? 为什么加入非线性因素能够加强网络的表示能力?——神经网络的万能近似定理 ?神经网络的万能近似定理认为主要神经网络具有至少一个非线性隐藏层,那么只要给予网络足够数量的隐藏单元,它就可以以任意的精度来近似任何从一个有限维空间到另一个有限维空间的函数。 ?如果不使用非线性激活函数,那么每一层输出都是上层输入的线性组合;此时无论网络有多少层,其整体也将是线性的,这会导致失去万能近似的性质 ?但仅部分层是纯线性是可以接受的,这有助于减少网络中的参数。3.如何解决训练样本少的问题? 1.利用预训练模型进行迁移微调(fine-tuning),预训练模型通常在特征上拥有很好的语义表达。此时,只需将模型在小数据集上进行微调就能取得不错的效果。CV 有 ImageNet,NLP 有 BERT 等。 2.数据集进行下采样操作,使得符合数据同分布。

3.数据集增强、正则或者半监督学习等方式来解决小样本数据集的训练问题。 4.如何提升模型的稳定性? 1.正则化(L2, L1, dropout):模型方差大,很可能来自于过拟合。正则化能有效的降低模型的复杂度,增加对更多分布的适应性。 2.前停止训练:提前停止是指模型在验证集上取得不错的性能时停止训练。这种方式本质和正则化是一个道理,能减少方差的同时增加的偏差。目的为了平衡训练集和未知数据之间在模型的表现差异。 3.扩充训练集:正则化通过控制模型复杂度,来增加更多样本的适应性。 4.特征选择:过高的特征维度会使模型过拟合,减少特征维度和正则一样可能会处理好方差问题,但是同时会增大偏差。 5.你有哪些改善模型的思路? 1.数据角度 增强数据集。无论是有监督还是无监督学习,数据永远是最重要的驱动力。更多的类型数据对良好的模型能带来更好的稳定性和对未知数据的可预见性。对模型来说,“看到过的总比没看到的更具有判别的信心”。 2.模型角度

VFP常用函数大全整理

VFP常用函数大全整理 一.字符及字符串处理函数:字符及字符串处理函数的处理对象均为字符型数据,但其返回值类型各异. 1.取子串函数: 格式:substr(c,n1,n2) 功能:取字符串C第n1个字符起的n2个字符.返回值类型是字符型. 例:取姓名字符串中的姓. store \"王小风\" to xm ?substr(xm,1,2) 结果为:王 2.删除空格函数:以下3个函数可以删除字符串中的多余空格,3个函数的返回值均为字符型. trim(字符串):删除字符串的尾部空格 alltrim(字符串):删除字符串的前后空格 ltrim(字符串):删除字符串的前面的空格 例:去掉第一个字符串的尾空格后与第二个字符串连接 store \"abcd \" to x store \"efg\" to y ?trim(x)+y abcdefg 3.空格函数: 格式:space(n) 说明:该函数的功能是产生指定个数的空格字符串(n用于指定空格个数). 例:定义一个变量dh,其初值为8个空格 store space(8) to dh 4.取左子串函数: 格式:left(c,n) 功能:取字符串C左边n个字符. 5.取右子串函数: 格式:right(c,n) 功能:取字符串c右边的n个字符 例:a=\"我是中国人\" ?right(a,4) 国人 ?left(a,2) 我 6.empty(c):用于测试字符串C是否为空格. 7.求子串位置函数: 格式:At(字符串1,字符串2) 功能:返回字符串1在字符串2的位置 例:?At(\"教授\",\"副教授\") 2

8.大小写转换函数: 格式: lower(字符串) upper(字符串) 功能:lower()将字符串中的字母一律变小写;upper()将字符串中的字母一律变大写 例: bl=\"FoxBASE\" ?lower(bl)+space(2)+upper(bl) foxbase FOXBASE 9.求字符串长度函数: 格式:len(字符串) 功能:求指定字符串的长度 例:a=\"中国人\" ?len(a) 6 二.数学运算函数: 1.取整函数: 格式:int(数值) 功能:取指定数值的整数部分. 例:取整并显示结果 ?int(25.69) 25 2.四舍五入函数: 格式:round(数值表达式,小数位数) 功能:根据给出的四舍五入小数位数,对数值表达式的计算结果做四舍五入处理 例:对下面给出的数四舍五入并显示其结果 ?round(3.14159,4),round(2048.9962,0),round(2048.9962,-3) 3.1416 2049 2000 3.求平方根函数: 格式:sqrt(数值) 功能:求指定数值的算术平方根 例:?sqrt(100) 10 4.最大值、最小值函数: 格式: Max(数值表达式1,数值表达式2) Min(数值表达式1,数值表达式2) 功能:返回两个数值表达式中的最大值和最小值 例:

人工智能实践:Tensorflow笔记 北京大学 7 第七讲卷积网络基础 (7.3.1) 助教的Tenso

Tensorflow笔记:第七讲 卷积神经网络 本节目标:学会使用CNN实现对手写数字的识别。 7.1 √全连接NN:每个神经元与前后相邻层的每一个神经元都有连接关系,输入是特征,输出为预测的结果。 参数个数:∑(前层×后层+后层) 一张分辨率仅仅是28x28的黑白图像,就有近40万个待优化的参数。现实生活中高分辨率的彩色图像,像素点更多,且为红绿蓝三通道信息。 待优化的参数过多,容易导致模型过拟合。为避免这种现象,实际应用中一般不会将原始图片直接喂入全连接网络。 √在实际应用中,会先对原始图像进行特征提取,把提取到的特征喂给全连接网络,再让全连接网络计算出分类评估值。

例:先将此图进行多次特征提取,再把提取后的计算机可读特征喂给全连接网络。 √卷积Convolutional 卷积是一种有效提取图片特征的方法。一般用一个正方形卷积核,遍历图片上的每一个像素点。图片与卷积核重合区域内相对应的每一个像素值乘卷积核内相对应点的权重,然后求和,再加上偏置后,最后得到输出图片中的一个像素值。 例:上面是5x5x1的灰度图片,1表示单通道,5x5表示分辨率,共有5行5列个灰度值。若用一个3x3x1的卷积核对此5x5x1的灰度图片进行卷积,偏置项

b=1,则求卷积的计算是:(-1)x1+0x0+1x2+(-1)x5+0x4+1x2+(-1)x3+0x4+1x5+1=1(注意不要忘记加偏置1)。 输出图片边长=(输入图片边长–卷积核长+1)/步长,此图为:(5 – 3 + 1)/ 1 = 3,输出图片是3x3的分辨率,用了1个卷积核,输出深度是1,最后输出的是3x3x1的图片。 √全零填充Padding 有时会在输入图片周围进行全零填充,这样可以保证输出图片的尺寸和输入图片一致。 例:在前面5x5x1的图片周围进行全零填充,可使输出图片仍保持5x5x1的维度。这个全零填充的过程叫做padding。 输出数据体的尺寸=(W?F+2P)/S+1 W:输入数据体尺寸,F:卷积层中神经元感知域,S:步长,P:零填充的数量。 例:输入是7×7,滤波器是3×3,步长为1,填充为0,那么就能得到一个5×5的输出。如果步长为2,输出就是3×3。 如果输入量是32x32x3,核是5x5x3,不用全零填充,输出是(32-5+1)/1=28,如果要让输出量保持在32x32x3,可以对该层加一个大小为2的零填充。可以根据需求计算出需要填充几层零。32=(32-5+2P)/1 +1,计算出P=2,即需填充2

常用函数 类参考

全局函数1、common.func.php 公用函数 获得当前的脚本网址 function GetCurUrl() 返回格林威治标准时间 function MyDate($format='Y-m-d H:i:s',$timest=0) 把全角数字转为半角 function GetAlabNum($fnum) 把含HTML的内容转为纯text function Html2Text($str,$r=0) 把文本转HTML function Text2Html($txt) 输出Ajax头 function AjaxHead() 中文截取2,单字节截取模式 function cn_substr($str,$slen,$startdd=0) 把标准时间转为Unix时间戳 function GetMkTime($dtime) 获得一个0000-00-00 00:00:00 标准格式的时间 function GetDateTimeMk($mktime) 获得一个0000-00-00 标准格式的日期 function GetDateMk($mktime) 获得用户IP function GetIP() 获取拼音以gbk编码为准 function GetPinyin($str,$ishead=0,$isclose=1)

dedecms通用消息提示框 function ShowMsg($msg,$gourl,$onlymsg=0,$limittime=0) 保存一个cookie function PutCookie($key,$value,$kptime=0,$pa="/") 删除一个cookie function DropCookie($key) 获取cookie function GetCookie($key) 获取验证码 function GetCkVdValue() 过滤前台用户输入的文本内容 // $rptype = 0 表示仅替换html标记 // $rptype = 1 表示替换html标记同时去除连续空白字符// $rptype = 2 表示替换html标记同时去除所有空白字符// $rptype = -1 表示仅替换html危险的标记 function HtmlReplace($str,$rptype=0) 获得某文档的所有tag function GetTags($aid) 过滤用于搜索的字符串 function FilterSearch($keyword) 处理禁用HTML但允许换行的内容 function TrimMsg($msg) 获取单篇文档信息 function GetOneArchive($aid)

人工智能实践:Tensorflow笔记 北京大学 4 第四讲神经网络优化 (4.6.1) 助教的Tenso

Tensorflow笔记:第四讲 神经网络优化 4.1 √神经元模型:用数学公式表示为:f(∑i x i w i+b),f为激活函数。神经网络是以神经元为基本单元构成的。 √激活函数:引入非线性激活因素,提高模型的表达力。 常用的激活函数有relu、sigmoid、tanh等。 ①激活函数relu: 在Tensorflow中,用tf.nn.relu()表示 r elu()数学表达式 relu()数学图形 ②激活函数sigmoid:在Tensorflow中,用tf.nn.sigmoid()表示 sigmoid ()数学表达式 sigmoid()数学图形 ③激活函数tanh:在Tensorflow中,用tf.nn.tanh()表示 tanh()数学表达式 tanh()数学图形 √神经网络的复杂度:可用神经网络的层数和神经网络中待优化参数个数表示 √神经网路的层数:一般不计入输入层,层数 = n个隐藏层 + 1个输出层

√神经网路待优化的参数:神经网络中所有参数w 的个数 + 所有参数b 的个数 例如: 输入层 隐藏层 输出层 在该神经网络中,包含1个输入层、1个隐藏层和1个输出层,该神经网络的层数为2层。 在该神经网络中,参数的个数是所有参数w 的个数加上所有参数b 的总数,第一层参数用三行四列的二阶张量表示(即12个线上的权重w )再加上4个偏置b ;第二层参数是四行两列的二阶张量()即8个线上的权重w )再加上2个偏置b 。总参数 = 3*4+4 + 4*2+2 = 26。 √损失函数(loss ):用来表示预测值(y )与已知答案(y_)的差距。在训练神经网络时,通过不断改变神经网络中所有参数,使损失函数不断减小,从而训练出更高准确率的神经网络模型。 √常用的损失函数有均方误差、自定义和交叉熵等。 √均方误差mse :n 个样本的预测值y 与已知答案y_之差的平方和,再求平均值。 MSE(y_, y) = ?i=1n (y?y_) 2n 在Tensorflow 中用loss_mse = tf.reduce_mean(tf.square(y_ - y)) 例如: 预测酸奶日销量y ,x1和x2是影响日销量的两个因素。 应提前采集的数据有:一段时间内,每日的x1因素、x2因素和销量y_。采集的数据尽量多。 在本例中用销量预测产量,最优的产量应该等于销量。由于目前没有数据集,所以拟造了一套数据集。利用Tensorflow 中函数随机生成 x1、 x2,制造标准答案y_ = x1 + x2,为了更真实,求和后还加了正负0.05的随机噪声。 我们把这套自制的数据集喂入神经网络,构建一个一层的神经网络,拟合预测酸奶日销量的函数。

比较PageRank算法和HITS算法的优缺点

题目:请比较PageRank算法和HITS算法的优缺点,除此之外,请再介绍2种用于搜索引擎检索结果的排序算法,并举例说明。 答: 1998年,Sergey Brin和Lawrence Page[1]提出了PageRank算法。该算法基于“从许多优质的网页链接过来的网页,必定还是优质网页”的回归关系,来判定网页的重要性。该算法认为从网页A导向网页B的链接可以看作是页面A对页面B的支持投票,根据这个投票数来判断页面的重要性。当然,不仅仅只看投票数,还要对投票的页面进行重要性分析,越是重要的页面所投票的评价也就越高。根据这样的分析,得到了高评价的重要页面会被给予较高的PageRank值,在检索结果内的名次也会提高。PageRank是基于对“使用复杂的算法而得到的链接构造”的分析,从而得出的各网页本身的特性。 HITS 算法是由康奈尔大学( Cornell University ) 的JonKleinberg 博士于1998 年首先提出。Kleinberg认为既然搜索是开始于用户的检索提问,那么每个页面的重要性也就依赖于用户的检索提问。他将用户检索提问分为如下三种:特指主题检索提问(specific queries,也称窄主题检索提问)、泛指主题检索提问(Broad-topic queries,也称宽主题检索提问)和相似网页检索提问(Similar-page queries)。HITS 算法专注于改善泛指主题检索的结果。 Kleinberg将网页(或网站)分为两类,即hubs和authorities,而且每个页面也有两个级别,即hubs(中心级别)和authorities(权威级别)。Authorities 是具有较高价值的网页,依赖于指向它的页面;hubs为指向较多authorities的网页,依赖于它指向的页面。HITS算法的目标就是通过迭代计算得到针对某个检索提问的排名最高的authority的网页。 通常HITS算法是作用在一定范围的,例如一个以程序开发为主题的网页,指向另一个以程序开发为主题的网页,则另一个网页的重要性就可能比较高,但是指向另一个购物类的网页则不一定。在限定范围之后根据网页的出度和入度建立一个矩阵,通过矩阵的迭代运算和定义收敛的阈值不断对两个向量authority 和hub值进行更新直至收敛。 从上面的分析可见,PageRank算法和HITS算法都是基于链接分析的搜索引擎排序算法,并且在算法中两者都利用了特征向量作为理论基础和收敛性依据。

数据库常用函数

数据库常用函数

一、基础 1、说明:创建数据库 CREATE DATABASE database-name 2、说明:删除数据库 drop database dbname 3、说明:备份和还原 备份:exp dsscount/sa@dsscount owner=dsscount file=C:\dsscount_data_backup\dsscount.dmp log=C:\dsscount_data_backup\outputa.log 还原:imp dsscount/sa@dsscount file=C:\dsscount_data_backup\dsscount.dmp full=y ignore=y log=C:\dsscount_data_backup\dsscount.log statistics=none 4、说明:创建新表 create table tabname(col1 type1 [not null] [primary key],col2 type2 [not null],..) CREATE TABLE ceshi(id INT not null identity(1,1) PRIMARY KEY,NAME VARCHAR(50),age INT) id为主键,不为空,自增长 根据已有的表创建新表: A:create table tab_new like tab_old (使用旧表创建新表) B:create table tab_new as select col1,col2… from tab_old definition only 5、说明:删除新表 drop table tabname 6、说明:增加一个列 Alter table tabname add column col type 注:列增加后将不能删除。DB2中列加上后数据类型也不能改变,唯一能改变的是增加varchar类型的长度。 7、说明:添加主键: Alter table tabname add primary key(col) 说明:删除主键: Alter table tabname drop primary key(col) 8、说明:创建索引:create [unique] index idxname on tabname(col….) 删除索引:drop index idxname 注:索引是不可更改的,想更改必须删除重新建。 9、说明:创建视图:create view viewname as select statement 删除视图:drop view viewname 10、说明:几个简单的基本的sql语句 选择:select * from table1 where 范围 插入:insert into table1(field1,field2) values(value1,value2) 删除:delete from table1 where 范围 更新:update table1 set field1=value1 where 范围

人工智能tensorflow实验报告

一、软件下载 为了更好的达到预期的效果,本次tensorflow开源框架实验在Linux环境下进行,所需的软件及相关下载信息如下: 1.CentOS 软件介绍: CentOS 是一个基于Red Hat Linux 提供的可自由使用源代码的企业级Linux 发行版本。每个版本的CentOS都会获得十年的支持(通过安全更新方式)。新版本的CentOS 大约每两年发行一次,而每个版本的CentOS 会定期(大概每六个月)更新一次,以便支持新的硬件。这样,建立一个安全、低维护、稳定、高预测性、高重复性的Linux 环境。CentOS是Community Enterprise Operating System的缩写。CentOS 是RHEL(Red Hat Enterprise Linux)源代码再编译的产物,而且在RHEL的基础上修正了不少已知的Bug ,相对于其他Linux 发行版,其稳定性值得信赖。 软件下载: 本次实验所用的CentOS版本为CentOS7,可在CentOS官网上直接下载DVD ISO镜像文件。 下载链接: https://www.360docs.net/doc/336659730.html,/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1611.i so. 2.Tensorflow 软件介绍: TensorFlow是谷歌基于DistBelief进行研发的第二代人工智能学习系统,其命名来源于本身的运行原理。Tensor(张量)意味着N维数组,Flow(流)意味着基于数据流图的计算,TensorFlow为张量从流图的一端流动到另一端计算过程。TensorFlow是将复杂的数据结构传输至人工智能神经网中进行分析和处理过程的系统。TensorFlow可被用于语音识别或图像识别等多项机器深度学习领域,对2011年开发的深度学习基础架构DistBelief进行了各方面的改进,它可在小到一部智能手机、大到数千台数据中心服务器的各种设备上运行。TensorFlow将完全开源,任何人都可以用。

EXCEL常用分类函数

EXCEL常用分类函数 (注意有些函数只有加载“分析工具库”以后方能使用) 一、查找和引用函数 ROW 用途:返回给定引用的行号。 语法:ROW(reference)。 Reference为需要得到其行号的单元格或单元格区域。 实例:公式“=ROW(A6)”返回6,如果在C5单元格中输入公式“=ROW()”,其计算结果为5。 COLUMN 用途:返回给定引用的列标。 语法:COLUMN(reference)。 参数:Reference为需要得到其列标的单元格或单元格区域。如果省略reference,则假定函数COLUMN是对所在单元格的引用。如果reference为一个单元格区域,并且函数COLUMN作为水平数组输入,则COLUMN函数将reference中的列标以水平数组的形式返回。 实例:公式“=COLUMN(A3)”返回1,=COLUMN(B3:C5)返回2。 CELL 用途:返回某一引用区域的左上角单元格的格式、位置或内容等信息 IS类函数 用途:用来检验数值或引用类型的函数。它们可以检验数值的类型并根据参数的值返回TRUE或FALSE。ISBLANK(value)、ISNUMBER(value)、ISTEXT(value)和ISEVEN(number)、ISODD(number)。 ADDRESS 用途:以文字形式返回对工作簿中某一单元格的引用。 语法:ADDRESS(row_num,column_num,abs_num,a1,sheet_text) 参数:Row_num是单元格引用中使用的行号;Column_num是单元格引用中使用的列标;Abs_num指明返回的引用类型(1或省略为绝对引用,2绝对行号、相对列标,3相对行号、绝对列标,4是相对引用);A1是一个逻辑值,它用来指明是以A1或R1C1返回引用样式。如果A1为TRUE或省略,函数ADDRESS返回A1样式的引用;如果A1为FALSE,函数ADDRESS返回R1C1样式的引用。Sheet_text为一文本,指明作为外部引用的工作表的名称,如果省略sheet_text,则不使用任何工作表的名称。 实例:公式“=ADDRESS(1,4,4,1)”返回D1。 CHOOSE 用途:可以根据给定的索引值,从多达29个待选参数中选出相应的值或操作。 语法:CHOOSE(index_num,value1,value2,...)。

TensorFlow编程指南 嵌入

嵌入 本文档介绍了嵌入这一概念,并且举了一个简单的例子来说明如何在TensorFlow 中训练嵌入,此外还说明了如何使用TensorBoard Embedding Projector 查看嵌入(真实示例)。前两部分适合机器学习或TensorFlow 新手,而Embedding Projector 指南适合各个层次的用户。 有关这些概念的另一个教程,请参阅《机器学习速成课程》的“嵌入”部分。 嵌入是从离散对象(例如字词)到实数向量的映射。例如,英语字词的300 维嵌入可能包括: blue: (0.01359, 0.00075997, 0.24608, ..., -0.2524, 1.0048, 0.06259) blues: (0.01396, 0.11887, -0.48963, ..., 0.033483, -0.10007, 0.1158) orange: (-0.24776, -0.12359, 0.20986, ..., 0.079717, 0.23865, -0.014213) oranges: (-0.35609, 0.21854, 0.080944, ..., -0.35413, 0.38511, -0.070976) 这些向量中的各个维度通常没有固有含义,机器学习所利用的是向量的位置和相互之间的距离这些整体模式。 嵌入对于机器学习的输入非常重要。分类器(更笼统地说是神经网络)适用于实数向量。它们训练密集向量时效果最佳,其中所有值都有助于定义对象。不过,机器学习的很多重要输入(例如文本的字词)没有自然的向量表示。嵌入函数是将此类离散输入对象转换为有用连续向量的标准和有效方法。 嵌入作为机器学习的输出也很有价值。由于嵌入将对象映射到向量,因此应用可以将向量空间中的相似性(例如欧几里德距离或向量之间的角度)用作一项强大而灵活的标准来衡量对象相似性。一个常见用途是找到最近的邻点。例如,下面是采用与上述相同的字词嵌入后,每个字词的三个最近邻点和相应角度: blue: (red, 47.6°), (yellow, 51.9°), (purple, 52.4°) blues: (jazz, 53.3°), (folk, 59.1°), (bluegrass, 60.6°) orange: (yellow, 53.5°), (colored, 58.0°), (bright, 59.9°) oranges: (apples, 45.3°), (lemons, 48.3°), (mangoes, 50.4°) 这样应用就会知道,在某种程度上,苹果和橙子(相距45.3°)的相似度高于柠檬和橙子(相距48.3°)。

vf常用函数

命令结构: <命令动词> [<范围>] [FIELD 字段列表] [<表达式>] [FOR <条件>] [WHILE <条件>] 范围:ALL NEXT N RECORD N REST 数据类型: 数值(N):12123.5968 222 字符(C):‘gfhghgf’“tytfytf”[rfgff] 逻辑(L):.t. .f .y. .n. 日期(D): 传统{mm/dd/yy} 绝对{^yyyy-mm-dd} 货币(Y): $56565 日期时间(T): 传统{mm/dd/yy, hh:mm:ss A|P} 绝对{^yyyy-mm-dd, hh:mm:ss A|P } 备注(M): 通用(G): 变量: 1.内存变量——直接赋值 2.系统内存变量 3.字段变量:优先于内存变量,如要使用内存变量,可加前缀:M. 或M-> Store <表达式> TO 变量列表

Display memory List memory Clear memory Release 变量列表 Release ALL link 通配符a* ? 数组: DIMENSION 数组名(下标,下标) DECLARE 运算符: 算术:+ - * / % ** ^ 关系:> >= < <= != <> # == = 逻辑:AND OR NOT ! 常用函数: Round(76667.878787, -3) Sqrt(9) PI() Date() Time() 取子串:substr(串,开始位置,取字符数)

Left(串,取字符数) Right(串,取字符数) 字符串长度:len(串) 消除空格:TRIM(串) LTRIM(串) ALLTRIM(串) At(s1,s2) ?len(dtoc({^2013-09-25})) ?dtoc({^2013-09-25}) ?date() ?len(“hjhhjjhhj”) ?ctod(dtoc({^2013-09-25})) ?year(ctod(dtoc({^2013-09-25}))) ?month(ctod(dtoc({^2013-09-25}))) ?day(ctod(dtoc({^2013-09-25}))) Upper(串) Lower(串) 测试:vartype(表达式) FOUND() Eof() Bof() 建立表结构:

flow3d官方培训教程中的实例中文说明

Flow3D学习——3 算例1 Aerospace Tutorial Aerospace Tutorial 新建一个项目,Model Setup Tab-Meshing & Geometry Tab-Subcomponent Tab-Geometry Files-c:\Flow3D\gui\stl_lib\tank.stl,Type and Potential 使用缺省选项,因为将引入其它形状作为固体,Subcomponent 1中坐标范围(Min/Max)为: X: 5.0~15.0, Y: 5.0~15.0, Z: 0.0~15.0 tank.stl的单位对FLOW-3D来说是未知的,可能是英寸、英尺、毫米等,现在假设模型是SI(国际单位),那么流体或固体的属性都应该是SI的。(这里有些糊涂,FLOW-3D会使用STL文件中的单位么?) 模拟的情况为从圆柱形底部入口向球形水箱内充水,计算域应该和此形状范围相近,略大一点但不能紧贴着形状边界。 底边界的位置和边界条件类型有关,如果入口处流速已知那么模拟多少入口长度没有关系,因为断面形状是固定的,但是如果特定位置的压力是已知的,那么要把边界放在该位置处因为压力会受入口长度的重力和粘性效应影响而变化。 建议计算域要大于最大几何尺寸的5%,底边界除外,可以小于5%,这样计算域底部和入口交叉,不会挡住水流,因此计算域定义为 X: 4.95~15.05 Y: 4.95~15.05 Z: 0.05~15.05 在Mesh-Cartesian的Block 1中按上面参数修改计算域尺寸,然后在Block 1上右键选择Update Mesh更新显示。 Re = Reynold数 = Inertial Force/Viscous Force = UL/ν Bo = Bond数 = Gravitational Force/Surface Tension Force = gΔρL^2/σWe = Weber数 = Inertial Force/Surface Tension Force = LU^2ρ/σ U是特征流速,L是特征长度,g是重力加速度,ρ是密度,σ是表面张力系数。这个问题中大约用100s充满水,冲水体积540立米,入口直径2m,入口流速为

Tensorflow入门学习1

第一章基础知识 Tensorflow交流qq千人群:328216239 1.1Tensors 目前在TensorFlow中的数据结构是tensor。一个tensor可以是任意维度的张量。一个tensor的等级就是它维度的数量。下面是一些tensor的例子: 3#a rank0tensor;a scalar with shape[] [1.,2.,3.]#a rank1tensor;a vector with shape[3] [[1.,2.,3.],[4.,5.,6.]]#a rank2tensor;a matrix with shape[2,3] [[[1.,2.,3.]],[[7.,8.,9.]]]#a rank3tensor with shape[2,1,3] 1.2The Computational Graph 你可以把Tensorflow的核心程序看成由2部分组成: 1.2.1建立计算图 1.2.2运行计算图 计算图是将一系列tensorflow的操作放到图的节点上。让我们建立一个简单的计算图。每个节点将0个或者更多的tensor作为输入,然后输出一个tensor。有一种节点的类型是常量。就像所有tensorflow中的常量一样,它不需要输入,输出一个内部储存的值。我们可以按照如下方法创造2个浮点类型的tensors节点node1和node2: node1=tf.constant(3.0,dtype=tf.float32) node2=tf.constant(4.0)#also tf.float32implicitly print(node1,node2) 最后的打印效果如下: Tensor("Const:0",shape=(),dtype=float32)Tensor("Const_1:0",shape=(), dtype=float32) 我们注意到这并没有像我们预期的意义输出值3.0和4.0。相反,他们输出了只有在evaluate的时候才会生成3.0和4.0的节点。为了evaluate这些节点,我

flow3d Hydraulics教程

Flow3d 9.3.2 Hydraulics Tutorial水力教程 本练习的目的是模拟水从水库通过薄壁堰流进下游水池。 图1 水流模拟 在设计中,模拟的第一步是需要完全了解要分析的问题。用流体力学知识,分析工程中哪些参数重要,怎样简化问题,可能出现什么问题,以及希望得到什么样的结果。 确定液体流动特性,如黏性、表面张力及能量作用大小的常用方法,是计算无量纲参数,如雷诺数、邦德数、韦伯数。 这里U是特征速度,L是特征长度,g是重力加速度,ρ是密度,σ 是表面张力系数。 对本问题,水从18cm高堰流过,水流在堰底的速度可近似按自由落体运动分析得出: Velocity = sqrt(2*980*18) = 187.8 cm/s 流体的雷诺数为: Re = 30cm x 187.8cm/s / 10-2cm^2/s = 5.6 x 105 雷诺数大,意味着与贯性力相比,黏性力不可忽略。因此,我们不需要精细的网格求解壁黏性剪切层。当然,由于流态的紊乱,液体内部有很多黏性剪切力,因此,需要在模型中指定黏性参数。 邦德数按下式求得: Bo = 980cm/s^2 * 1 gm/cc * (30cm)^2/(73gm/s^2) = 1.2 x 104

韦伯数按下式求得: We = 30cm * (187.8 cm/s)^2 * 1gm/cc / (73gm/s^2) = 1.45 x 104 再者,大的邦德数和大的韦伯数表明,与重力和惯性力相比,表面张力可忽略。模型是这种情况时,不考虑表面张力。 问题的大小(模型运行的时间)可以利用堰中心顺水流平面的对称特性进行简化。因此,我们仅仅需要模拟整个范围的一部分(即堰的后半部分),就可也得到堰的全部信息。我们已经对问题进行了简化,下面是如何建立这些条件,如何确定几何条件,利用flow3d求解问题。 建模 总体参数 点击“Model Setup”表的“General”表,“General”是确定整个问题的参数,如结束时间、结束条件、界面追踪,流体模式,液体的数量,提示选项,单位及精度。 对本教程,我们是想看流场,当液体达到几乎稳定状态时,它的时间是 1.0s。因此,通常设定结束时间为1.0s。对一个实际问题,可能运行这种模拟的时间会更长一些。但是,我们感兴趣的是速度,对于本运行,我们限定时间。在“Simulation units”标题菜单中,选CGS单位(厘米。克。秒),其它设置采用缺省设置。 在“总信息表Global tab”的底部注释中,你可以在第一行为问题指定一个名字。名字会出现在所有输出文件和图形上。本例名称为“Flow over a Weir”(过堰流体)。 建立几何体Geometry Setup 我们将添加元件定义堰体。首先,我们输入一个已有的STL文件,weri1.stl,该文件放在目录“c:\flow3d\gui\stl_lib”。切换到“几何与分网Meshing & Geometry ”表,单击工具条STL图标,会打开标题为“几何Geometry”的对话框,点击添加,打开对话框,找到并选择weri1.stl。在“Geometry File”点击ok,接受缺省设置。在之后出现的添加部件对话框中接受缺省设置。现在STL文件已经输入,并且出现在工作空间中。输入文件也被列在树形结构表中。 下面,我们将通过“FLOW-3D”简单建模创建另一个组件,来添加上游水库河床。在工具栏点击box(盒子)图标,盒子对话框显示如图2。

损失函数 Losses - Keras 中文文档

Docs ? 损失函数 Losses 损失函数的使用 损失函数(或称目标函数、优化评分函数)是编译模型时所需的两个参数之一: https://www.360docs.net/doc/336659730.html,pile(loss='mean_squared_error', optimizer='sgd') from keras import losses https://www.360docs.net/doc/336659730.html,pile(loss=losses.mean_squared_error, optimizer='sgd') 你可以传递一个现有的损失函数名,或者一个 T ensorFlow/Theano 符号函数。该符号函数为每个数据点返回一个标量,有以下两个参数: y_true: 真实标签。T ensorFlow/Theano 张量。 y_pred: 预测值。T ensorFlow/Theano 张量,其 shape 与 y_true 相同。 实际的优化目标是所有数据点的输出数组的平均值。 有关这些函数的几个例子,请查看losses source。 可用损失函数 mean_squared_error mean_squared_error(y_true, y_pred) mean_absolute_error mean_absolute_error(y_true, y_pred) mean_absolute_percentage_error mean_absolute_percentage_error(y_true, y_pred) mean_squared_logarithmic_error

mean_squared_logarithmic_error(y_true, y_pred) squared_hinge squared_hinge(y_true, y_pred) hinge hinge(y_true, y_pred) categorical_hinge categorical_hinge(y_true, y_pred) logcosh logcosh(y_true, y_pred) 预测误差的双曲余弦的对数。 对于小的x,log(cosh(x))近似等于(x ** 2) / 2。对于大的x,近似于abs(x) - log(2)。这表示 'logcosh' 与均方误差大致相同,但是不会受到偶尔疯狂的错误预测的强烈影响。 参数 y_true: 目标真实值的张量。 y_pred: 目标预测值的张量。 返回 每个样本都有一个标量损失的张量。 categorical_crossentropy categorical_crossentropy(y_true, y_pred)

相关文档
最新文档