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 文章结构本文将围绕滚动迭代构造方法展开,主要分为引言、正文和结论三个部分。
引言部分首先对滚动迭代构造方法进行概述,介绍其基本定义和原理。
接着,说明本文的目的,即探讨滚动迭代构造方法的优势和应用,以及展望其未来的发展。
正文部分将详细阐述滚动迭代构造方法的定义和其与传统方法的区别。
通过具体的例子和实证研究,解释滚动迭代构造方法的优势和应用场景。
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.。