A new multi-component KP hierarchy
- 格式:pdf
- 大小:120.20 KB
- 文档页数:13
Package‘multiApply’March28,2023Title Apply Functions to Multiple Multidimensional Arrays or VectorsVersion2.1.4Description The base apply function and its variants,as well as the related functions in the'plyr'package,typically apply user-defined functions to asingle argument(or a list of vectorized arguments in the case of mapply).The'multiApply'package extends this paradigm with its only function,Apply,which efficiently applies functions taking one or a list of multiple unidimensionalor multidimensional arrays(or combinations thereof)as input.The inputarrays can have different numbers of dimensions as well as different dimensionlengths,and the applied function can return one or a list of unidimensional ormultidimensional arrays as output.This saves development time by preventing the R user from writing often error-prone and memory-inefficient loops dealing with multiple complex arrays.Also,a remarkable feature of Apply is the transparentuse of multi-core through its parameter'ncores'.In contrast to the base applyfunction,this package suggests the use of'target dimensions'as oppositeto the'margins'for specifying the dimensions relevant to the function to beapplied.Depends R(>=3.2.0)Imports doParallel,foreach,plyrSuggests testthatLicense GPL-3URL https://earth.bsc.es/gitlab/ces/multiApplyBugReports https://earth.bsc.es/gitlab/ces/multiApply/-/issues Encoding UTF-8RoxygenNote7.2.0NeedsCompilation noAuthor BSC-CNS[aut,cph],Nicolau Manubens[aut],Alasdair Hunter[aut],An-Chi Ho[ctb,cre],Nuria Perez[ctb]Maintainer An-Chi Ho<************>1Repository CRANDate/Publication2023-03-2813:10:08UTCR topics documented:Apply (2)Index6 Apply Apply Functions to Multiple Multidimensional Arrays or VectorsDescriptionThis function efficiently applies a given function,which takes N vectors or multi-dimensional arrays as inputs(which may have different numbers of dimensions and dimension lengths),and applies it to a list of N vectors or multi-dimensional arrays with at least as many dimensions as expected by the given function.The user can specify which dimensions of each array the function is to be applied over with the margins or target_dims parameters.The function to be applied can receive other helper parameters and return any number of vectors or multidimensional arrays.The target dimensions or margins can be specified by their names,as long as the inputs are provided with dimension names(recommended).This function can also use multi-core in a transparent way if requested via the ncores parameter.The following steps help to understand how Apply works:-The function receives N arrays with Dn dimensions each.-The user specifies,for each of the arrays,which of its dimensions are’target’dimensions(dimen-sions which the function provided in’fun’operates with)and which are’margins’(dimensions to be looped over).-Apply will generate an array with as many dimensions as margins in all of the input arrays.If a margin is repeated across different inputs,it will appear only once in the resulting array.-For each element of this resulting array,the function provided in the parameter’fun’is applied to the corresponding sub-arrays in’data’.-If the function returns a vector or a multidimensional array,the additional dimensions will be prepended to the resulting array(in left-most positions).-If the provided function returns more than one vector or array,the process above is carried out for each of the outputs,resulting in a list with multiple arrays,each with the combination of all target dimensions(at the right-most positions)and resulting dimensions(at the left-most positions). UsageApply(data,target_dims=NULL,fun,...,output_dims=NULL,margins=NULL,use_attributes=NULL,extra_info=NULL,guess_dim_names=TRUE,ncores=NULL,split_factor=1)Argumentsdata One or a list of vectors,matrices or arrays.They must be in the same order as expected by the function provided in the parameter’fun’.The dimensions donot necessarily have to be ordered.If the’target_dims’require a different orderthan the provided,Apply will automatically reorder the dimensions as needed.target_dims One or a list of vectors(or NULLs)containing the dimensions to be input into fun for each of the objects in the data.If a single vector of target dimensionsis specified and multiple inputs are provided in’data,then the single set of tar-get dimensions is re-used for all of the inputs.These vectors can contain eitherintegers specifying the position of the dimensions,or character strings corre-sponding to the dimension names.This parameter is mandatory if’margins’arenot specified.If both’margins’and’target_dims’are specified,’margins’takespriority.fun Function to be applied to the arrays.Must receive as many inputs as provided in’data’,each with as many dimensions as specified in’target_dims’or as thetotal number of dimensions in’data’minus the ones specified in’margins’.Thefunction can receive other additionalfixed parameters(see parameter’...’ofApply).The function can return one or a list of vectors or multidimensionalarrays,optionally with dimension names which will be propagated to thefinalresult.The returned list can optionally be named,with a name for each output,which will be propagated to the resulting array.The function can optionally beprovided with the attributes’target_dims’and’output_dims’.In that case,thecorresponding parameters of Apply do not need to be provided.The function canexpect named dimensions for each of its inputs,in the same order as specifiedin’target_dims’or,if no’target_dims’have been provided,in the same order asprovided in’data’.The function can access the variable.margin_indices,anamed numeric vector that provides the indices of the current iteration over themargins,as well as any other variables specified in the parameter extra_infoor input attributes specified in the parameter use_attributes....Additionalfixed arguments expected by the function provided in the parameter ’fun’.output_dims Optional list of vectors containing the names of the dimensions to be output from the fun for each of the objects it returns(or a single vector if the functionhas only one output).margins One or a list of vectors(or NULLs)containing the’margin’dimensions to be looped over for each input in’data’.If a single vector of margins is specified andmultiple inputs are provided in’data’,then the single set of margins is re-used forall of the inputs.These vectors can contain either integers specifying the positionof the margins,or character strings corresponding to the dimension names.Ifboth’margins’and’target_dims’are specified,’margins’takes priority.use_attributes List of vectors of character strings with names of attributes of each object in ’data’to be propagated to the subsets of data sent as inputs to the function speci-fied in’fun’.If this parameter is not specified(NULL),all attributes are dropped.This parameter can be specified as a named list(then the names of this list mustmatch those of the names of parameter’data’),or as an unnamed list(then thevectors of attribute names will be assigned in order to the input arrays in’data’).extra_info Named list of extra variables to be defined for them to be accessible from within the function specified in’fun’.The variable names will automatically be prependeda heading dot(’.’).So,if the variable’name="Tony"’is sent through this pa-rameter,it will be accessible from within’fun’via’.name’.guess_dim_namesWhether to automatically guess missing dimension names for dimensions ofequal length across different inputs in’data’with a warning(TRUE;default),or to crash whenever unnamed dimensions of equa length are identified acrossdifferent inputs(FALSE).ncores The number of parallel processes to spawn for the use for parallel computation in multiple cores.split_factor Factor telling to which degree the input data should be split into smaller pieces to be processed by the available cores.By default(split_factor=1)the data issplit into4pieces for each of the cores(as specified in ncores).A split_factorof2will result in8pieces for each of the cores,and so on.The special value’greatest’will split the input data into as many pieces as possible.DetailsWhen using a single object as input,Apply is almost identical to the apply function(as fast or slightly slower in some cases;with equal or improved-smaller-memory footprint).ValueList of arrays or matrices or vectors resulting from applying’fun’to’data’.ReferencesWickham,H(2011),The Split-Apply-Combine Strategy for Data Analysis,Journal of Statistical Software.Examples#Change in the rate of exceedance for two arrays,with different#dimensions,for some matrix of exceedances.data<-list(array(rnorm(1000),c(5,10,20)),array(rnorm(500),c(5,10,10)),array(rnorm(50),c(5,10)))test_fun<-function(x,y,z){((sum(x>z)/(length(x)))/(sum(y>z)/(length(y))))*100}test<-Apply(data,target=list(3,3,NULL),test_fun)IndexApply,26。
java multiresourceitemreader示例-回复Java MultiresourceItemReader示例在Java开发中,我们经常需要读取多个资源文件,并将它们合并为一个统一的数据源。
为了实现这一功能,Spring Batch框架提供了MultiresourceItemReader。
本文将详细介绍MultiresourceItemReader 的使用方法以及相应的示例代码。
1. Spring Batch简介首先,让我们简要了解一下Spring Batch框架。
Spring Batch是一个用于大规模批处理作业的开源框架,旨在简化批处理任务的开发。
它提供了事务管理、日志记录、统计和计数等常用功能,使得批处理任务的处理更加可靠和高效。
2. MultiresourceItemReader概述MultiresourceItemReader是Spring Batch框架中用于读取多个资源文件的读取器。
它可以将多个文件合并为一个统一的数据源,并按顺序逐个读取其中的数据。
这对于需要处理多个资源文件中的数据的任务来说非常有用,例如合并和归并数据文件等。
3. MultiresourceItemReader示例让我们通过一个实际的示例来演示MultiresourceItemReader的使用方法。
假设我们有多个包含学生信息的文本文件,每个文件都有相同的格式,包括学生姓名、年龄和分数等字段。
我们需要将这些文件中的数据读取出来,并进行一些处理,例如计算所有学生的平均分数。
首先,我们需要定义一个数据模型类,表示学生信息。
我们可以创建一个名为Student的POJO类,其中包含学生姓名、年龄和分数等属性。
javapublic class Student {private String name;private int age;private double score;省略getter 和setter 方法}接下来,我们需要实现一个ItemReader,用于从单个资源文件中读取学生信息。
一类(2+1)维Kadomtsev-Petviashvili(KP)方程的有理解及怪波李倩;舒级;汪春江;王云肖;杨袁【摘要】利用painleve分析,判别非线性微分方程的可积性,根据双线性导数,借扩展同宿呼吸检验法检验方程变换后的形式,讨论了非线性波动方程的有理解.在同宿呼吸子孤波中,当孤波的周期趋于无穷时得到了怪波解.%This paper discusses a class of classical (2+1)-dimensional KP equation, which has found wide applications in hydrodynamics, plasma physics, gas dynamics.By use of the Painleve analysis, the integrability of nonlinear differential equation is determined.Double linear method of Hirota is a transformation in nature.By testing the form with expanded homoclinic breather limit method, the form of the transformed equation is tested and the rational solution of the nonlinear wave equation is put under examination.Among homoclinic breather solitary waves, the cusp wave solution is worked out when the period of the solitary wave tends to be infinite.【期刊名称】《内江师范学院学报》【年(卷),期】2017(032)002【总页数】5页(P68-71,81)【关键词】KP方程;精确解;同宿呼吸子极限法;有理解;怪波【作者】李倩;舒级;汪春江;王云肖;杨袁【作者单位】四川师范大学数学与软件科学学院, 四川成都 610066;四川师范大学数学与软件科学学院, 四川成都 610066;四川师范大学数学与软件科学学院, 四川成都 610066;四川师范大学数学与软件科学学院, 四川成都 610066;四川师范大学数学与软件科学学院, 四川成都 610066【正文语种】中文【中图分类】O17.27非线性科学问题的研究可用非线性偏微分方程来简练而准确地描述,求解非线性偏微分方程的精确解具有非常重要的理论和应用价值,尤其是孤立子解,其中KP方程是一类具有代表性的方程.1970年,Kadomtsev等[1]提出了一种二维波色散方程[1],即一类KdV方程的孤子解在弱横向扰动影响下的稳定性,这个方程被称为KP方程,并认为其原型是二维上的可积的非线性色散波方程.KP方程是一个完全可积系统且有非常丰富的数学结构.数学结构包括N-soliton解的存在性、逆散射变换的Lax形式、无限维对称性的存在.1981年,佐藤提出了佐藤通用格拉斯曼流,给出KP方程是一个Plucker Grassmannian关系.近年来已出现了许多研究方法,如反散射法[6],Backlund变换[7],Darboux变换法[8],Hirota方法[9],tanh 函数方法[10]等.耦合的KdV方程组和扩散长水波方程组也进行了探讨并获得了一些孤子解[11].KP方程的解用图像模拟出来就形成怪波现象,也就是“畸形波”(freak wave)的概念[12]. Draper首次提出[12],此后越来越多的学者开始关注这一现象,有的把它叫做怪波,杀人波,极端风浪等[13].从直观上看,怪波具有超常的波高,因此大多数学者和研究人员只能从波高角度对其进行定义[14],即认为波高大于有效波高2倍(或2.2倍)的单波可以称为怪波[15-18](H>2Hs,或H>2.2Hs).怪波产生的原因包括外在影响因素和内在作用机理两种.调制不稳定性(Benjamin-Feir不稳定性)是生成怪波的一个重要机理[19-20].目前对此类方程研究主要有达布变换、反散射方法、代数几何极限方法等.已有的研究结果有: 常系数的非线性Schrodinger方程[21]、非线性导数Schrodinger方程[22]、耦合的NLS-MB方程[23]、两分量的非线性Schrodinger方程[24-25]、变系数的非均质的非线性Schrodinger方程[26]、非自治的非线性Schrodinger方程[27]、变系数非线性导数Schrodinger方程[28]、Hirota方程[29]、高阶方程[30]、KP方程[31]等.本文结合painleve分析、双线性导数和扩展同宿呼吸检验法得到uxt+6(+uuxx)+uxxxx+λuyy=0的有理解和怪波解.其中,u是关于x,y,t的函数,λ=1.该方程在流体动力学、等离子物理、气体动力学等方面有广泛应用. 下面给出一般的非线性偏微分方程形式:P(u,ut,ux,uy,…)=0,其中,P是一个多项式,u(t,x,y): Rx×Ry×Rt→R.下面求解u(t,x,y).步骤1 借助于Painleve分析,作代换u=T(f),f是一个未知函数.步骤2 由步骤1,将原始方程转变为Hirota双线性形式 G(Dt,Dy;f)=0, D有如下定义步骤3 采用扩展同宿呼吸检验法求出以上方程的同宿呼吸子孤波解.步骤4 在同宿呼吸子孤波解中,令周期趋于无穷,可以得到同宿波的有理解,即怪波解.定理2.1 在参数p1=p条件下,(2+1)维KP方程的有理解为证明由行波变换ξ=x+ct(c为常数),得容易看到方程(6)有平衡解u0,其中u0为任意常数.假定其中,f(ξ,y)是实函数,将方程(7)代入(6),得到下面双线性形式其中,·f=2(ff4ξ-4fξ)·f=2().对于方程(8),可以通过下面的形式运用同宿检验法求解其中,p1,p,a,b,δ1,δ2是常实数.将方程(4)代入方程(3),得到关于ep1(ξ-ay)的代数方程,即令ejp(ξ-ay)(j=-1,0,1)前的系数全为0,得令p1=p,方程组(5)化简如下求解方程组(6)其中,a,b,u0,δ2是任意实常数.令u0≠且δ2>0,有或将(7)代入(4),有其中,,p=±,a,b为实数.将(8)代入(4),可得有理解其中u1(ξ,y),u2(ξ,y)体现了一种新的族波即双波.其振幅随时间的演变呈周期性振荡,向后向的周期波发生弹性碰撞,一列波以速度b传播,另一列波以向相反方向传播.定理2.2 在参数δ2=1,周期趋于,m1趋于1时,(2+1)维KP方程的怪波解为证明令δ2=1,即(δ2)=0,将其代入u2(ξ,y),可化简为其中考虑(ξ,y)的呼吸子极限,当周期趋于,即p趋于0.经计算,得其中,,并假定m1趋于,p趋于0时有a=b.包含两种不同方向和速度的波.易验证Urouguewave为(6)的有理解,同时Urouguewave也是呼吸子类型解.实际上,对于固定的,当y→±时,有U→0.所以,U不仅是呼吸子的有理解,也是怪波解,它比周围一般的波振幅高2~3倍,而且通常在短时间内形成.这就说明怪波可以来自实方程中的呼吸子孤波解.因此,可以认为在一定时间内的能量聚集或叠加是产生怪波的原因之一.令ξ=x+ct,代入(9),得到(2+1)维KP方程的怪波解其中,,并假定m1趋于,p趋于0时有a=b.文中运用同宿呼吸子极限法求解(2+1)维KP方程,得到同宿呼吸解和同宿有理解,其中同宿有理解包含怪波解.下一步将应用其它方法得出更多可积和不可积系统的怪波解.对于满足Lax可积的方程或方程组可改写为其他等价形式,借助达布变换得到其平凡解和非平凡解.【相关文献】[1] Kadomtsev B B, Petviashvili V I. On the stability of solitary waves in weakly dispersing media [J]. Soviet Physics Doklady, 1970, 192(6):539-541.[2] Biondini G, Kodama Y. On a family of solutions of the Kadomtsev-Petviashvili equation which also satisfy the Toda lattice hierarchy [J]. Journal of Physics A: Mathematical and General, 2003, 36(42): 10519-10536.[3] Kodama Y. Young diagrams and N-soliton solutions of the KP equation [J]. Journal of Physics A: Mathematical and General, 2004, 37(46): 11169-11190.[4] Ablowitz M J, Clarkson P A. Solitons, nonlinear evolution equations and inverse scattering [M]. Cambridge university press, 1991.[5] Sato M. Soliton equations as dynamical systems on an infinite dimensional Grassmannian manifold [J]. RIMS Kokyuroku (Kyoto University) 1981, 439:30-46.[6] 広田良吾, 红艳. 孤子理论中的直接方法 [M]. 北京:清华大学出版社, 2008.[7] 翊神. 孤子与可积系统 [M]. 上海:上海科技教育出版社, 1999.[8] 郭玉翠. 非线性偏微分方程引论 [M]. 北京:清华大学出版社, 2008.[9] 式适, 式达. 物理学中的非线性方程 [M]. 北京:北京大学出版社, 2000.[10] 李帮庆,马玉兰. 非线性演化系统的符号计算方法 [M]. 北京:科学出版社,2013.[11] Wang M, Zhou Y, Li Z. Application of a homogeneous balance method to exact solutions of nonlinear equations in mathematical physics [J]. Physics Letters A, 1996,216(1): 67-75.[12] Draper L. Freak wave [J]. Marine Observer, 1965, 35(2): 193-195.[13] Waseda T. Rogue Waves in the Ocean [J]. Eos Transactions American Geophysical Union, 2010, 91(11):104-104.[14] 杨冠声, 董艳秋, 陈学闯. 畸形波 (freak wave) [J]. 海洋工程, 2002, 20(4): 105-108.[15] Osborne A R, Onorato M, Serio M. The nonlinear dynamics of rogue waves and holesin deep-water gravity wave trains [J]. Physics Letters A, 2000, 275(5): 386-393.[16] Mori N, Yasuda T, Nakayama S. Statistical properties of freak waves observed in the Sea of Japan [C] //The Tenth International Offshore and Polar Engineering Conference. International Society of Offshore and Polar Engineers, 2000.[17] Kriebel, DavidL. Simulation of extreme waves in a background random sea [C]. Proc. of the International off Shore and Polar Engineering Conference 3, 2000: 31-37.[18] Yasuda T, Mori N, Nakayama S. Characteristics of giant freak waves observed in the Sea of Japan [C] //Ocean Wave Measurement and Analysis. ASCE, 1997: 316-328.[19] Osborne A R. The random and deterministic dynamics of ‘rogue waves’ in unidirectional, deep-water wave trains [J]. Marine structures, 2001, 14(3): 275-293. [20] Slunyaev A, Kharif C, Pelinovsky E, et al. Nonlinear wave focusing on water of finite depth [J]. Physica D: Nonlinear Phenomena, 2002, 173(1): 77-96.[21] Akhmediev N, Ankiewicz A, Soto-Crespo J M. Rogue waves and rational solutions of the nonlinear dinger equation [J]. Physical Review E Statistical Nonlinear & Soft Matter Physics, 2009, 80(2 Pt 2):26601-26609.[22] Xu S, He J, Wang L. The Darboux transformation of the derivative nonlinear dinger equation [J]. Journal of Physics A Mathematical & Theoretical, 2011, 44(30):6629-6636. [23] He J, Xu S, Porsezian K. New types of rogue wave in an erbium-doped fibre system [J]. Journal of the Physical Society of Japan, 2012, 81(3):10.1143/JPSH.81.033002.[24] Guo B, Ling L, Liu Q P. Nonlinear dinger equation: generalized Darboux transformation and rogue wave solutions [J]. Physical Review E, 2012, 85(2pt2):10.1103/PhysRevE.85.026607.[25] Guo B L, Ling L M. Rogue wave, breathers and bright-dark-rogue solutions for the coupled dinger equations [J]. Chinese Physics Letters, 2011, 28(11):110202-110205. [26] Yan Z. Nonautonomous “rogons” in the inhomogeneous nonlinear dinger equation with variable coefficients [J]. Physics Letters A, 2010, 374(4): 672-679.[27] Wang Y Y, He J S, Li Y S. Soliton and Rogue Wave Solution of the New Nonautonomous Nonlinear dinger Equation [J]. Communications in Theoretical Physics, 2011, 56(6):995-1004.[28] 文双春, 徐文成. 变系数非线性Schrodinger方程孤子的演化 [J]. 中国科学:数学,1997(10):949-953.[29] Ankiewicz A, Soto-Crespo J M, Akhmediev N. Rogue waves and rational solutions of the Hirota equation [J]. Physical Review E Statistical Nonlinear & Soft Matter Physics, 2010, 81(4 Pt 2):387-395.[30] Dai C Q, Zhou G Q, Zhang J F. Controllable optical rogue waves in the femtosecond regime [J]. Physical Review E Statistical Nonlinear & Soft Matter Physics, 2012,85(2):016603-016603.[31] Xu Z, Chen H, Dai Z. Rogue wave for the ( 2+1) dimensional Kadomtsev-Petviashvili equation [J]. Applied Mathematics Letters, 2014, 37:34-38.。
VISUAL COMPONENTS[ PYTHON API ] Component ScriptingVisual Components 4.0 | Version: February 28, 2017A component script allows you to use Python API to create custom behaviorsand add logic to a component. For example, you can write a script that manageschanges to component properties and what tasks a component performsduring a simulation. A component can contain multiple scripts with each scriptbeing its own Python Script behavior in the component.In this tutorial you learn how to create a component script that manages themotions of a servo controller and another script that changes the material of geometry during a simulation. This will involve using methods in the vcScriptmodule to reference the main application and component data.Support****************************Community© 2015 Visual Components Oy| PAGE 1 OF 7 || PAGE 2 OF 7 |GETTING STArTEdGetting Started 1. Open the ComponentScriptingStart.vcmx file for this tutorial.2. Click the Modeling tab, and then in the Component Graph panel, select the Behaviors and Properties check boxes, and then expand the component node tree.The component has one link containing the geometry of a blue platform. The platform needs to move along the X-axis of its link and be driven by a servo controller. Right now, thecomponent does not have any behaviors and the degree of freedom (DOF) of Link1 is fixed.GETTING STArTEd | PAGE 3 OF 7 |3. In the Component Graph panel, select Link1, and then in the Link Properties panel,set JointType to Translational , and then do all of the following: ▪Set Axis to +X .▪Set Controller to New Servo Controller , which will automatically add a new Servo Controller behavior to the root node and assign the joint of Link1 to that controller. ▪Set Min Limit to 0 and Max Limit to 600.The servo controller needs additional logic to operate during a simulation. For example, the controller needs to know when to move joints, what joints to move, and how far to move them. The logic for the servo controller can be defined in a Python Script behavior.4. In the Component Graph panel, select the root node , and then add a Python Scriptbehavior. The script editor will open automatically when you add the behavior.Basic ScriptThe initial first line of code for any component script is an import statement that retrieves allmethods from the vcScript module.The getComponent() method in vcScript allows you to get an object reference to thecomponent containing the Python Script behavior. This is helpful if you need to get andmanipulate other component data, for example behaviors, features and properties.NOTE! To learn more about the script editor, see "Python Script" in the Behaviors referenceguide of your Visual Components 4.0 product Help file.1. In the script editor, create variables for the component and its servo controller. Youcan use the component object to call the findBehaviour() method of vcNode to get abehavior by name.from vcScript import *comp = getComponent()servo = comp.findBehaviour("Servo Controller")The OnRun event is the main function of a script and is executed during a simulation.2. In the OnRun event, create a while loop that moves the joint of Link1 from its minto max value and back again. You can use the servo controller object to call themove() or moveJoint() method. To avoid creating an endless loop, you can use thegetApplication() method of vcScript to get an object reference for the main application.You could then get a "handle" for the simulation object and make the condition of thewhile loop to be true as long as the simulation is running.def OnRun():app = getApplication()while app.Simulation.IsRunning:servo.moveJoint(0,0.0)servo.moveJoint(0,600.0)| PAGE 4 OF 7 |BASIC SCrIPT3. Compile the code, and then enable Trace execution, which will allow you to knowwhich line of code is being executed in the script.4. Run the simulation, verify the platform moves from one side to the other, and thenreset the simulation.BASIC SCrIPT| PAGE 5 OF 7 |Additional ScriptIn some cases, you may want to create other scripts in a component that can run independentof one another.1. Close the script editor, and then add another Python Script behavior.2. In the PythonScript_2 editor, OnRun event, create a while loop that changes thematerial of the platform from blue to green. You can use the application object to callthe findMaterial() method to get a material by name. The component object can beused to call the findNode() method to get a node by name. In some cases, a featuremay already be assigned a material, so you may need to force the geometry of thenode to inherit its material. You can use the delay() method of vcScript to delay theexecution of a script. This is helpful if you need to toggle something on and off duringa simulation.from vcScript import *def OnSignal( signal ):passdef OnRun():app = getApplication()blue = app.findMaterial("blue")green = app.findMaterial("green")comp = getComponent()link = comp.findNode("Link1")link.MaterialInheritance = VC_MATERIAL_FORCE_INHERIT_NODEwhile app.Simulation.IsRunning:delay(1)link.NodeMaterial = bluedelay(1)link.NodeMaterial = green3. Compile the code.| PAGE 6 OF 7 |AddITIONAL SCrIPTrEVIEw | PAGE 7 OF 7 | 4. Run the simulation, verify the platform changes from blue to green, and then reset the simulation.reviewIn this tutorial you learned how to write component scripts that perform tasks during a simulation. You know how to use methods in vcScript to get handles for the main application, component containing the script and its data. You also know how to use the OnRun event todefine the main function of a script, which is executed during a simulation.。
标题:探索requestMultiplePermissionsLauncher用法:轻松管理多个权限申请在当今的移动应用开发中,权限管理成为了至关重要的一环。
为了确保应用的正常运行,开发者需要获取一系列必要的权限,如访问联系人、读取文件、网络访问等。
requestMultiplePermissionsLauncher是Android平台上的一个工具类,它能够帮助开发者更高效地管理权限申请过程。
一、requestMultiplePermissionsLauncher简介requestMultiplePermissionsLauncher是Android开发中的一个便捷类,它允许开发者一次性请求多个权限,并提供了方便的回调机制。
通过使用该类,开发者可以简化权限申请的代码,提高应用性能,并确保用户在首次使用应用时得到清晰的提示。
二、用法详解1. 引入依赖:首先,确保在项目中引入requestMultiplePermissionsLauncher相关的依赖库。
2. 创建请求对象:使用requestMultiplePermissionsLauncher类创建一个请求对象,传入需要申请的权限名称数组。
3. 添加回调:为每个权限请求添加相应的回调函数,用于处理权限申请的结果。
4. 执行请求:调用requestMultiplePermissionsLauncher对象的start方法,开始执行权限申请流程。
5. 处理结果:在回调函数中处理权限申请的结果,根据需要采取相应的操作,如显示提示信息、跳转设置界面等。
三、示例代码以下是一个简单的示例代码,展示了如何使用requestMultiplePermissionsLauncher类申请多个权限:```java// 引入依赖implementation 'com.example:permission-util:1.0.0' // 请根据实际情况替换版本号// 创建请求对象RequestMultiplePermissionsRequest request = new RequestMultiplePermissionsRequest.Builder().addPermission(Manifest.permission.READ_CONTACTS).addPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE).build();// 添加回调函数request.addPermissionRequestListener(new PermissionRequestListener() {@Overridepublic void onPermissionRequestStart() {// 权限申请开始时的处理逻辑}@Overridepublic void onPermissionGranted(String permission) {// 权限被授予后的处理逻辑}@Overridepublic void onPermissionDenied(String permission, int reason) {// 权限被拒绝的原因和处理逻辑}});// 执行请求requestMultiplePermissionsLauncher = getSystemService(Context.REQUEST_MULTIPLE_PERMISSIONS_LAUNCHER); requestMultiplePermissionsLauncher.start(request);```四、总结与展望通过使用requestMultiplePermissionsLauncher类,开发者可以更高效地管理多个权限申请过程,提高应用性能和用户体验。
鸿蒙操作系统是华为公司推出的一种全新操作系统。
作为一种全新的操作系统,鸿蒙操作系统拥有着许多独特的特点和功能,其中一个重要的特点就是其采用了artks多个构造函数。
本文将针对鸿蒙操作系统中artks多个构造函数这一主题展开详细讨论,首先介绍artks多个构造函数的定义和作用,然后深入探讨artks多个构造函数的实现原理和优势,最后分析artks多个构造函数对鸿蒙操作系统的影响和意义。
一、artks多个构造函数的定义和作用1. artks多个构造函数是指在鸿蒙操作系统中采用了多个不同的构造函数来实现不同的功能和特性。
这些构造函数可以分别用于创建不同类型的对象实例,实现灵活的对象构造和初始化过程。
2. 在传统的操作系统中,通常只会使用一个构造函数来创建对象实例,这种方式可能会导致构造函数变得过于复杂,且不够灵活。
而artks多个构造函数的出现,能够有效解决这一问题,使得对象的构造和初始化过程更加简洁明了。
二、artks多个构造函数的实现原理和优势1. artks多个构造函数的实现主要依赖于鸿蒙操作系统中对面向对象编程的支持。
通过面向对象编程的特性,可以轻松实现多个不同类型的构造函数,并在需要的时候进行灵活调用。
2. artks多个构造函数的优势在于能够提高代码的复用性和可维护性。
通过将对象的构造和初始化过程分解为多个不同的构造函数,可以使得代码结构更加清晰,易于维护和扩展。
3. artks多个构造函数还能够提高代码的可读性和可测试性。
使用不同的构造函数可以更加直观地表达对象的属性和行为,使得代码更加易于阅读和理解,也更容易进行单元测试和调试。
三、artks多个构造函数对鸿蒙操作系统的影响和意义1. artks多个构造函数的出现对鸿蒙操作系统具有重要意义。
它不仅提高了鸿蒙操作系统的灵活性和可扩展性,还为开发者提供了更丰富的编程工具和技术支持,使得开发工作更加高效和便利。
2. 通过采用artks多个构造函数,鸿蒙操作系统能够更好地满足不同开发场景的需求,为开发者提供更加丰富和全面的编程接口和功能支持,从而推动鸿蒙生态系统的发展和壮大。
滚动迭代构造方法-概述说明以及解释1.引言1.1 概述滚动迭代构造方法是一种在解决问题时逐步迭代、不断更新的构造方法。
它通常在处理大规模数据时应用广泛,并且在复杂的计算任务中具有很高的效率和灵活性。
在传统的构造方法中,需要在开始时一次性构建出所有需要的数据结构或计算结果。
然而,当面对大规模数据集或需要多次迭代的计算任务时,这种方法会导致效率低下和资源浪费的问题。
滚动迭代构造方法通过将数据集拆分为更小的部分,并逐步处理每个部分来解决这个问题。
它允许我们一次只处理一个小部分数据,然后将结果保存下来并进行下一步迭代。
这种方法的好处是,它可以在处理数据的同时降低内存使用和计算复杂度。
此外,滚动迭代构造方法还具有很高的灵活性,可以根据需求动态调整迭代的步长和处理的数据量。
这使得它可以适应各种不同的问题和数据集,并且能够在处理过程中进行动态优化,提高算法的性能和效果。
尽管滚动迭代构造方法在处理大规模数据和复杂计算时具有明显的优势,但它也存在一些挑战和限制。
例如,在处理有序数据时,滚动迭代构造方法可能无法保证最终结果的完整性。
此外,在设计和实现滚动迭代构造方法时,我们还需要考虑数据精度、并发处理、数据安全性等方面的问题。
总而言之,滚动迭代构造方法是一种高效、灵活的构造方法,特别适用于解决大规模数据集和复杂计算任务的问题。
它可以通过逐步迭代、动态调整和优化来提高算法的效率和性能。
随着技术的不断发展,滚动迭代构造方法将在未来发展中扮演重要角色,并为我们解决更多复杂的问题提供有力支持。
1.2 文章结构本文将围绕滚动迭代构造方法展开,主要分为引言、正文和结论三个部分。
引言部分首先对滚动迭代构造方法进行概述,介绍其基本定义和原理。
接着,说明本文的目的,即探讨滚动迭代构造方法的优势和应用,以及展望其未来的发展。
正文部分将详细阐述滚动迭代构造方法的定义和其与传统方法的区别。
通过具体的例子和实证研究,解释滚动迭代构造方法的优势和应用场景。
change-prefix-loader 原理[changeprefixloader原理]文章长度:约1500-2000字一、简介Changeprefixloader,即更改前缀加载器,是一种用于改变应用程序的加载器行为的工具。
在某些情况下,我们可能需要改变应用程序的前缀以便于加载特定的资源或运行特定的插件。
本文将详细介绍Changeprefixloader的工作原理和实现步骤。
二、Changeprefixloader的工作原理Changeprefixloader背后的基本原理是动态修改Java的类加载器机制。
Java的类加载器是Java虚拟机(JVM)在应用程序运行时加载类和资源的主要机制。
通过改变类加载器的行为,Changeprefixloader使得应用程序可以加载特定前缀的类或资源。
具体而言,Changeprefixloader通过以下步骤实现前缀修改:1. 找到应用程序的类加载器:Changeprefixloader需要找到应用程序使用的类加载器,一般情况下是系统类加载器。
2. 创建新的类加载器:Changeprefixloader创建一个新的类加载器,该加载器继承自应用程序的类加载器。
3. 指定新的类加载器的前缀:Changeprefixloader为新的类加载器指定需要更改的前缀。
这可以通过配置文件或编程方式完成。
4. 修改类加载器的行为:Changeprefixloader通过重写新的类加载器的findClass方法和getResource方法来改变类加载器的行为。
在这两个方法中,Changeprefixloader会根据指定的前缀来加载类或资源。
5. 替换应用程序的类加载器:最后,Changeprefixloader将应用程序的类加载器替换为新创建的类加载器。
通过以上步骤,Changeprefixloader实现了动态修改应用程序的类加载器,从而更改了类加载的前缀。
这样,应用程序就可以加载特定前缀的类或资源。
kotlin 扩展函数 failed resolution;
Kotlin 扩展函数是一种让你向已存在的类添加新的函数的方式,这些函数可以被这个类的实例所调用。
但是,如果你在编写 Kotlin 扩展函数时遇到了 "failed resolution" 的错误,可能是因为以下几个原因:
1. 导入错误:确保正确导入了相关的包和库,以便 Kotlin 可以找到使用的类和函数。
2. 函数命名冲突:确保你的函数名称不会与其他类或库中的函数名称冲突,可以尝试改变函数名称以避免命名冲突。
3. 类型不匹配:确保你的扩展函数与它扩展的类的类型匹配。
当一个扩展函数尝试扩展一个不兼容的类时,编译器会抛出 "failed resolution" 错误。
4. 编译器问题:如果其他问题都没有问题,可能是编译器出现了问题。
尝试清理项目并重新构建以解决任何潜在的编译器问题。
如果你仍然无法解决 "failed resolution" 错误,请仔细检查代码并使用 Kotlin 社区论坛或其他开发者社区寻求帮助。
主题:解决Java多模块项目中同名类匹配原则的问题随着软件开发的复杂化,使用多模块的Java项目已经成为常态。
然而,在多模块项目中,经常会遇到同名类的问题,这样会导致类加载的混乱和不确定性。
本文将从同名类的定义、Java类加载机制、多模块项目中同名类的问题及解决方案等方面进行详细阐述。
一、同名类的定义在Java中,同名类指的是在不同的包或者模块中存在相同类名的情况。
当一个Java程序中包含多个模块,且这些模块中存在同名类时,就会出现同名类的问题。
二、Java类加载机制在理解多模块项目中同名类问题时,我们首先需要了解Java的类加载机制。
在Java中,类的加载是由类加载器(ClassLoader)来完成的,类加载器会通过双亲委派机制(双亲委派模型)来加载类。
双亲委派模型的基本原则是:当一个类加载器收到加载请求时,它会先将请求委派给父类加载器来完成加载,只有当父类加载器无法完成加载时,才由子类加载器来加载类。
三、多模块项目中同名类的问题在多模块的Java项目中,同名类的存在会带来一系列的问题。
同名类可能导致类加载的混乱,当一个类被加载时,由于存在同名类,可能会导致错误的类被加载。
同名类也会造成代码的可读性和维护性问题,开发者很难清楚地知道具体是哪个类被加载了。
四、解决方案针对多模块项目中同名类的问题,可以采取以下几种解决方案:1. 包命名规范在设计多模块的Java项目时,可以通过合理的包命名规范来避免同名类的问题。
每个模块的包命名应该具有唯一性,避免出现同名类。
2. 类加载器隔离可以采用类加载器隔离的方式来解决同名类的问题。
通过自定义类加载器来加载不同模块的类,避免同名类的冲突。
但需要注意的是,类加载器隔离可能会带来一些性能上的损失。
3. 模块化的设计合理地将项目进行模块化设计,将重复的类进行合并或者重新设计,避免出现同名类的冲突。
五、总结在多模块的Java项目中,同名类的问题是一个常见的难题。
通过本文的阐述,我们可以更加清楚地了解同名类的定义、Java类加载机制、多模块项目中同名类的问题及解决方案。
《Java组件设计》课程考试试卷A答案一、填空题(每题1.5分,共15分)一、对象二、编译期3、.config 4、DTD 五、NIO 六、日记级别7、利用ORM框架八、在线结果集九、10、JDBC网络纯Java驱动程序二、程序阅读题(每题5分,共25分)一、挪用Employee类中的computePay()方式挪用Manager类中的computePay()方式二、fa:int3、欢迎张三光临!烈火欢迎张三光临!4、twoone五、k=100s=Hello三、简答题(每题5分,共30分)一、平台层和应用层,是个逻辑划分的概念。
平台层通常不提供与具体业务相关的逻辑处置,而是提供与业务无关的功能组件和多种业务之间可共用的机制。
应用层提供具体应用相关的逻辑处置部份。
二、组件定位:精准地解决共性问题组件设计:无配置文件组件设计:与作用者概念一致组件设计:业务无关的中立性组件设计实现:对利用环境无假设组件设计实现:单类设计和实现3、1)若是方式的实现,仅依托方式的输入参数和静态变量、静态类,那么能够将此方式设计为static。
2)若是方式要实现的功能,是一个独立的单次操作功能,不依托任何前置条件,方式执行后,也不为其他任何方式提供前置条件,那么能够将此方式设计为static。
4、1)二进制数据转换为十六进制数据,记录在日记中。
2)把程序中捕捉的异样信息、挪用堆栈,记录到日记中。
3)把一个对象的各个属性值都打印出来,以对象作为输出或输出参数的场景中常常需要此功能。
4)可变参数的格式化功能,类似于C中的sprintf功能。
五、1)用户占击页面后,操作请求被异步处置,屏幕内容可不能变白,用户没必要等待,就能够够进行下一个操作;2)用户的操作请求被Web Server处置完毕后,阅读器仅更新页面的局部部份,不需要更新整个页面;3)页面通过Ajax引擎仅向Web Server提交业务必需的数据,供Web Server处置,而不是提交整个页面。
pathmatchingresourcepatternresolver 静态构造函数-回复PathMatchingResourcePatternResolver 是一个用于解析资源路径模式的类,主要用于在Spring框架中进行资源的查找和加载。
本文将深入探讨PathMatchingResourcePatternResolver 的静态构造函数。
首先,我们将介绍静态构造函数的概念,然后解释为什么PathMatchingResourcePatternResolver 需要一个静态构造函数,接下来,我们将逐步回答关于这个静态构造函数的一些问题。
静态构造函数是在类加载时被执行的特殊函数。
它与普通构造函数的区别在于静态构造函数没有参数,也没有访问修饰符,并且不能被直接调用。
静态构造函数主要用于初始化类的静态成员变量,并执行一些与类相关的特殊操作。
为什么PathMatchingResourcePatternResolver 需要一个静态构造函数呢?首先,我们需要了解PathMatchingResourcePatternResolver 的作用。
它主要用于根据指定的资源路径模式来查找和加载符合条件的资源。
在Spring框架中,资源是指类路径中的文件或者目录。
PathMatchingResourcePatternResolver 的静态构造函数用于初始化一个特定的资源加载器,以便在之后的运行中能够高效地进行资源的查找和加载。
下面,我们来回答一些与PathMatchingResourcePatternResolver 静态构造函数相关的问题。
问题1:静态构造函数的作用是什么?静态构造函数的主要作用是在类加载时对静态成员变量进行初始化,并执行一些与类相关的特殊操作。
在PathMatchingResourcePatternResolver 中,静态构造函数的作用是初始化一个资源加载器,以便之后能够高效地进行资源的查找和加载。
Lombok 是一个Java 库,它可以自动生成代码,简化Java 开发。
在使用Lombok 时,有时会遇到无法构建构造函数的问题。
这可能是由于以下原因:
1. Lombok 注解没有正确应用到类上。
请确保在类上添加了正确的Lombok 注解,例如`@Data`、`@AllArgsConstructor`、`@NoArgsConstructor` 等。
2. 类中存在多个构造函数,导致Lombok 无法确定使用哪个构造函数。
请检查类中的构造函数,确保只有一个无参构造函数或者所有构造函数都有相同的参数列表。
3. 类继承了其他类,而父类的构造函数需要参数。
在这种情况下,Lombok 无法自动生成无参构造函数。
请尝试手动添加一个无参构造函数,或者修改Lombok 注解以适应这种情况。
4. 类中存在静态字段或方法,这可能导致Lombok 无法生成构造函数。
请检查类中的静态字段和方法,确保它们不会影响构造函数的生成。
5. 类中存在final 字段,这可能导致Lombok 无法生成构造函数。
请检查类中的final 字段,确保它们不会影响构造函数的生成。
webpack的UMD(Universal Module Definition)参数允许你创建一个JavaScript模块,它可以在多种webpack的UMD(Universal Module Definition)参数允许你创建一个JavaScript 模块,它可以在多种环境中运行,包括浏览器和Node.js。
这要归功于UMD规范,它兼容了AMD和CommonJS两种主流的JavaScript模块规范。
在webpack中定义UMD模块时,你需要提供一个入口函数。
这个函数接收两个参数:`root`和`factory`。
`root`参数代表当前的全局环境,而`factory`则是一个返回你要导出的内容的函数。
通常,我们会在这个工厂函数中返回我们需要导出的对象、函数或变量。
一个基本的UMD模块实现可能如下所示:```javascript(function (root, factory) {if (typeof define === 'function' && define.amd) {// AMDdefine(['jquery', 'my-module'], factory);} else if (typeof exports === 'object') {// Node, CommonJS-likemodule.exports = factory(require('jquery'), require('my-module'));} else {// Browser globals (root is window)root.returnExports = factory(root.jQuery, root.myModule);}}(this, function ($, myModule) {// 使用$ 和myModule 做一些操作...// 导出一个函数return function doSomething() {};}));```。
loader attempted duplicate class -回复[loader attempted duplicate class]是编程中常见的一个错误提示,它表明在编译或者运行程序时尝试定义了重复的类。
本文将从以下几个方面详细解答这个错误提示:错误原因、如何避免、如何调试和解决这个错误。
首先,我们来讨论该错误的原因。
在Java编程中,每个类的定义应该是唯一的,不允许存在重复的类。
当我们在程序中定义了两个或多个相同名称的类时,就会触发这个错误。
这可能是由于代码冗余、不小心的拷贝粘贴或者对第三方库进行错误的操作所导致的。
那么,我们如何避免这个错误呢?首先,要保持代码的整洁和规范。
尽量避免重复定义类的情况发生。
其次,要注意代码复用和拷贝粘贴操作。
在复用代码时,应该通过继承或引用的方式来使用已有的类,而不是重新定义一个相同名称的类。
此外,使用IDE工具可以帮助我们避免这种错误,IDE会在大部分情况下对重复的类进行警告提醒。
接下来,我们来讨论如何调试和解决这个错误。
当我们碰到[loader attempted duplicate class]错误时,首先应该仔细检查代码和项目结构,以确认是否存在重复定义的类。
如果是在编译阶段出现这个错误,可以检查编译输出的错误日志或者IDE的控制台信息来定位具体的问题所在。
如果是在运行时出现这个错误,可以先确认是否存在多个重复的类文件。
例如,查看项目的类路径,确保不同的类文件不会被重复加载。
另外,检查是否存在多个不同版本的相同类库被引用,也可能导致这个错误的发生。
一旦定位到问题所在,我们就需要解决它。
解决这个错误的方法取决于具体的情况。
如果是因为代码冗余导致的重复定义类,可以删除其中一个定义,在代码中只保留一个。
如果是因为第三方库的错误操作导致的,可以尝试更新或者替换这个库的版本。
如果是因为类路径或者类库引用的问题,可以重新配置项目的类路径,确保只有正确的类文件和库文件被加载。
a r X i v :0710.4015v 1 [n l i n .S I ] 22 O c t 2007A new multi-component KP hierarchyXiaojun Liu †,Yunbo Zeng ‡∗,Runliang Lin ‡†Department of Applied Mathematics,China Agricultural University,Beijing 100083,P.R.China‡Department of Mathematical Sciences,Tsinghua University,Beijing 100084,P.R.ChinaAbstractA method is proposed to construct a new multi-component KP hierarchy,which includes two types of KP equation with self-consistent sources and admits reductions to k -constrained KP hierarchy and to Gelfand-Dickey hierarchy with sources.It provides a general way to construct soliton equations with sources and their Lax representations.PACS:02.30.IkKeywords:multi-component KP hierarchy;KP equation with self-consistent sources;Gelfand-Dickey hierarchy with self-consistent sources;k -constrained KP hierarchy;Lax representation1IntroductionMulti-component generalizations of KP hierarchy attract a lot of interests from both physical and mathematical points of view [1–7].The multi-component KP (mcKP)hierarchy given in [1]contains many physically relevant nonlinear integrable systems,such as Davey-Stewartsonequation,two-dimensional Toda lattice and three-wave resonant interaction ones.There ex-ist several equivalent formulations of this mcKP hierarchy:matrix pseudo-differential op-erator(Sato)formulation,τ-function approach via matrix Hirota bilinear identities,multi-component free fermion formulation.A coupled KP hierarchy was generated through the procedure of so-called Pfaffianization[8].It was shown in[9]that this coupled KP hierar-chy can be reformulated as a reduced case of the2-component KP hierarchy.Another kind of multi-component KP equation is the so-called KP equation with self-consistent sources, which was initiated by V.K.Mel’nikov[10–12].For example,thefirst type of KP equation with self-consistent sources(KPSCS)reads[10,11,13](4u t−12uu x−u xxx)x−3u yy+4Ni=1(q i r i)xx=0,(1a)q i,y=q i,xx+2uq i,i=1,...,N,(1b)r i,y=−r i,xx−2ur i.(1c) The second type of KPSCS is[10,14]4u t−12uu x−u xxx−3D−1u yy=3Ni=1[q i,xx r i−q i r i,xx+(q i r i)y],(2a)q i,t=q i,xxx+3uq i,x+32q iNj=1q j r j+32r i D−1u y−32u x r i,(2c)where D−1stands for the inverse of ddx.The notation u′i=u i,x is used in this paper.The commutativity of∂t nflows give rise to the zero-curvature equations of KP hierarchyB n,tk −B k,tn+[B n,B k]=0.In this paper,wefirst introduce a new vectorfield∂τkwhich is a linear combination of all vectorfields∂t n.Then we introduce a new Lax type equation which consist of theτk-flow and the evolutions of wave functions.Under the evolutions of wave functions,the commutativityof∂τk -flow and∂tk-flows gives rise to a new multi-component KP hierarchy.This hierarchyenables us to obtain thefirst and second types of KPSCS(i.e.,(1)and(2))in a different way from those in[10–14,16]and to get their Lax representations directly.This implies that the new mcKP hierarchy obtained in this paper is different from the mcKP hierarchy given in[1]. Moreover,this new mcKP hierarchy can be reduced to two integrable hierarchies,i.e.,the Gelfand-Dickey hierarchy with self-consistent source(GDHWS)[17]and the k-constrained KP hierarchy(k-KPH)[18,19].The GDHWS includes thefirst type of KdV equation with self-consistent sources and thefirst type of Boussinesq equation with self-consistent sources. While,the k-KPH includes the second type of KdV equation with self-consistent sources(the Yajima-Oikawa equation)and the second type of Boussinesq equation with self-consistent sources.Thus,the method proposed in this paper to construct the new mcKP hierarchy provides a general way tofind soliton equation with self-consistent sources as well as their Lax representations.Our paper will be organized as follows.In section2,we construct the new mcKP hierarchy and show that it contains thefirst and second types of KPSCS.In section3,the new mcKP hierarchy is reduced to the Gelfand-Dickey hierarchy with self-consistent source and the k-constrained KP hierarchy.In section4,some conclusions are given.2New multi-component KP hierarchyWith the help of formal dressing method,the L operator for KP hierarchy can be written in the following form[15]L=φ∂φ−1,φ=1+w1∂−1+w2∂−2+ (4)And the evolution of the dressing operatorφis given byφtn=−L n−φ.(5)The wave function and the adjoint one are then given byω(t,z)=φexp(ξ(t,z)),ω∗(t,z)=(φ∗)−1exp(−ξ(t,z)), whereξ(t,z)= i>0t i z i.They satisfy the following equationsLw(t,z)=zw(t,z),∂∂t nw∗(t,z)=−B∗n(w∗(t,z)).(6b) It was proved in[15]that the principle part of the resolvent defined byT(z)−= i∈Z L i−z−i−1,(7a) can be written asT(z)−=w(t,z)∂−1w∗(t,z).(7b) For anyfixed k∈N,we define a new variableτk whose vectorfield is∂τk =∂tk−Ni=1 s≥0ζ−s−1i∂t s,whereζi’s are arbitrary distinct non-zero parameters.Theτk-flow is given byLτk =∂tkL−Ni=1 s≥1ζ−s−1i∂t s L=[B k,L]−N i=1 s≥0ζ−s−1i[B s,L] =[B k,L]+Ni=1 s∈Nζ−s−1i[L s−,L].Define˜B k by˜B k =B k+Ni=1 s∈Zζ−s−1i L s−,which,according to(7),can be written as˜B k =B k+Ni=1w(t,ζi)∂−1w∗(t,ζi).By setting q i=w(t,ζi),r i=w∗(t,ζi),we have˜B k =B k+Ni=1q i∂−1r i,(8a)where q i and r i satisfy the following equationsq i,tn=B n(q i),r i,t n=−B∗n(r i)i=1,···,N.(8b) Now we introduce a new Lax type equation given byLτk =[B k+Ni=1q i∂−1r i,L].(9a)withq i,tn=B n(q i),r i,t n=−B∗n(r i)i=1,···,N.(9b) We have the following lemma[20].Lemma1.[B n,q∂−1r]−=B n(q)∂−1r−q∂−1B∗n(r).Proof.Without loss of generality,we consider a monomial:P=a∂n(n≥0).Then[P,q∂−1r]−=aq(n)∂−1r−(q∂−1ra∂n)−.Notice that the second term can be rewritten in the following way(q∂−1ra∂n)−=(q∂−1∂(ra)∂n−1−q∂−1(ra)′∂n−1)−=(−q∂−1(ra)′∂n−1)−=···=(−1)n q∂−1(ar)(n)=q∂−1P∗(r),then the lemma is proved.Proposition1.(3)and(9)give rise to the following new multi-component KP hierarchyB n,τk −(B k+Ni=1q i∂−1r i)t n+[B n,B k+N i=1q i∂−1r i]=0(10a)q i,tn=B n(q i),(10b)r i,tn=−B∗n(r i),i=1,···,N.(10c)Proof.We will show that under(9b),(3)and(9a)give rise to(10a).For convenience,we assume N=1,and denote q1and r1by q and r,respectively.By(3),(9)and Lemma1,we haveB n,τk =(L nτk)+=[B k+q∂−1r,L n]+=[B k+q∂−1r,L n+]++[B k+q∂−1r,L n−]+=[B k+q∂−1r,L n+]−[B k+q∂−1r,L n+]−+[B k,L n−]+=[B k+q∂−1r,B n]−[q∂−1r,B n]−+[B n,L k]+=[B k+q∂−1r,B n]+B n(q)∂−1r−q∂−1B∗n(r)+B k,t n=[B k+q∂−1r,B n]+(B k+q∂−1r)t n.Under(10b)and(10c),the Lax representation for(10a)is given byψτk =(B k+Ni=1q i∂−1r i)(ψ),(11a)ψtn=B n(ψ).(11b) Now,we list some examples in the new mcKP hierarchy(10).Example1(Thefirst type of KPSCS).For n=2and k=3,(10)yieldsu1,y−u′′1−2u′2=0,(12a)2u1,t−3(u2+u′1)t2+3u′′2+u′′′1−6u1u′1+2Ni=1(q i r i)′=0,(12b)q i,t2=q′′i+2u1q i,r i,t2=−r′′i−2u1r i.(12c)Set y:=t2,t:=τ3,u:=u1,and eliminate u2by differentiating the second equation with respect to x,we get thefirst type of KP equation with self-consistent sources(1).The Lax representation of(1a)isψy=(∂2+2u)(ψ),ψt=(∂3+3u∂+(32u x)+Ni=1q i∂−1r i)(ψ).Example2(The second type of KPSCS).For n=3and k=2,(10)yieldsu1,y+Ni=1(q i r i)′−u′′1−2u′2=0,(13a)3(u2+u′1)y−2u1,t−u′′′1+3Ni=1(q′i r i)′+6u1u′1−3u′′2=0,(13b)q i,t3=q i,xxx+3u1q i,x+(3u2+3u′1)q i,(13c)r i,t3=r i,xxx+3u1r i,x−3u2r i.(13d) Let y:=τ2,t=t3,u:=u1,and eliminate u2by integrating thefirst equation with respect to x, we get the second type of KPSCS(2).This equation was introduced in[10],and rediscovered by source generating method[14].Under(13c)and(13d),the Lax representation for(2a)isψy=(∂2+2u+Ni=1q i∂−1r i)(ψ),ψt=(∂3+3u∂+(32u x+3the equations yield12u1,xxxy+32u1,xyy−2(u21)xxx+12(qr)xxx=0,q t=(∂4+4u1∂2+(4u2+6u′1)∂+(4u3+6u′2+4u′′1))qr t=−(∂4+4u1∂2+(4u2+6u′1)∂+(4u3+6u′2+4u′′1))∗r.3ReductionsThe new mcKP hierarchy(10)admits reductions to several well-known(1+1)-dimensional systems.3.1The n-reduction of(10)The n-reduction is given byL n=B n or L n−=0,(14) then(6)implies thatB n(q i)=L n q i=ζn i q i,(15a)−B∗n(r i)=−L n∗r i=−ζn i r i.(15b)By using Lemma1and(15),we can see that the constraint(14)is invariant under theτk flow(L n−)τk =[B k,L n]−+Ni=1[q i∂−1r i,L n]−=[B k,L n−]−+Ni=1[q i∂−1r i,L n+]−+N i=1[q i∂−1r i,L n−]−=Ni=1[q i∂−1r i,B n]−=−N i=1(q i,t n∂−1r i+q i∂−1r i,t n)(16)=−Ni=1(ζn i q i∂−1r i−ζn i q i∂−1r i)=0.(17)The equations(14)and(5)imply thatφt n=0,so(L k)t n=0,which together with(17) means that one can drop t n dependency from(10)and obtainB n,τk=[(B n)k4u xxx+Ni=1(q i r i)x=0,q i,xx+2uq i=ζ2i q i,r i,xx+2ur i=ζ2i r i,i=1,···,N, with Lax representation(∂2+2u)(ψ)=λψ,ψt=(∂3+3u∂+3The first type of KdV equation with self-consistent sources can be solved by the inverse scattering method [12,21]and by the Darboux transformation (see [22]and the references therein).For n =3and k =2,(18)presents the first type of Boussinesq equation with self-consistent sources (t :=τ2,u :=u 1)u tt +12D −1u y +32N j =1q j r j )=ζ3i q i ,r i,xxx +3ur i,x −r i (32u x +3k+,B k+N i =1q i ∂−1r i,(19a)q i,t n =(B k +N j =1q j ∂−1r j )nk∗+(r i ),i =1,···,N,(19c)which is the so-called k -constrained KP hierarchy [18–20].For k=2and n=3,(19)gives rise to the second type of KdV equation with self-consistent sources.u t=14Ni=1(q i,xx r i−q i r i,xx),q i,t=q i,xxx+3uq i,x+32u x q i,r i,t=r i,xxx+3ur i,x−32u x r i,i=1,···,N.For k=3and n=2,(19)gives rise to the second type of Boussinesq equation with self-consistent sources.u tt+13Ni=1(q i r i)xx=0,q i,t=q i,xx+2uq i,r i,t=−r i,xx−2ur i,i=1,···,N.4ConclusionsA method is proposed in this paper to construct a new mcKP hierarchy,which enables us tofind thefirst and second types of KPSCS(i.e.,(1)and(2))in a different way from those in[10–14]and to get their Lax representations directly.The new mcKP hierarchy offers natural reductions to the well-known Gelfand-Dickey hierarchy with self-consistent sources and to the k-constrained KP hierarchy.The k-constrained KP hierarchy includes the second type of KdV equation with self-consistent sources(the Yajima-Oikawa equation)and the second type of Boussinesq equation with self-consistent sources.The method proposed here provides a general way to construct the soliton equations with self-consistent sources and their Lax representations.This approach for constructing multi-component hierarchies can be applied to other(2+1)-dimensional systems(such as mKP,BKP,CKP,etc)and semi-discrete systems(e.g.,2-Toda hierarchy).We will present some other new multi-component hierarchies in the forthcoming paper.AcknowledgmentsThis work was supported by National Basic Research Program of China(973Program) (2007CB814800)and National Natural Science Foundation of China(grand No.10601028).References[1]E.Date,M.Jimbo,M.Kashiwara,T.Miwa,J.Phys.Soc.Japan,50(11)(1981)3806.[2]M.Jimbo,T.Miwa,Publ.Res.Inst.Math.Sci.,19(3)(1983)943.[3]M.Sato,Y.Sato,In:Nonlinear partial differential equations in applied science(Tokyo,1982),pp259–271.North-Holland,Amsterdam,1983.[4]E.Date,M.Jimbo,M.Kashiwara,T.Miwa,Publ.Res.Inst.Math.Sci.,18(3)(1982)1077.[5]V.G.Kac,J.W.van de Leur,J.Math.Phys.,44(8)(2003)3245.[6]J.van de Leur,J.Math.Phys.,39(5)(1998)2833.[7]H.Aratyn,E.Nissimov,S.Pacheva,Phys.Lett.A,244(4)(1998)245.[8]R.Hirota,Y.Ohta,J.Phys.Soc.Japan,60(3)(1991)798.[9]S.Kakei,Phys.Lett.A,264(6)(2000)449.[10]V.K.Mel’nikov,Lett.Math.Phys.,7(2)(1983)129.[11]V.K.Mel’nikov,Comm.Math.Phys.,112(4)(1987)639.[12]V.K.Mel’nikov,Phys.Lett.A,128(9)(1988)488.[13]T.Xiao,Y.Zeng,J.Phys.A,37(28)(2004)7143.[14]H.-Y.Wang,Some Studies on Soliton Equations with Self-consistent Sources,PhDthesis,Academy of Mathematics and System Science,Chinese Academy of Sciences, 2007.[15]L.A.Dickey,Soliton equations and Hamiltonian systems,World Scientific PublishingCo.Inc.,River Edge,NJ,second edition,2003.[16]T.Xiao,Y.B.Zeng,Physica A,353(2005)38.[17]M.Antonowicz,Phys.Lett.A,165(1)(1992)47.[18]B.Konopelchenko,J.Sidorenko,W.Strampp,Phys.Lett.A,157(1)(1991)17.[19]Y.Cheng,J.Math.Phys.,33(11)(1992)3774.[20]L.A.Dickey,Lett.Math.Phys.,34(4)(1995)379.[21]R.L.Lin,Y.B.Zeng,W.-X.Ma,Physica A,291(2001)287.[22]R.L.Lin,H.S.Yao,Y.B.Zeng,Symmetry,Integrability and Geometry:Methods andApplications,2(2006)096.。