<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://osupdocs.forestry.oregonstate.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Chadh</id>
	<title>OSUPDOCS - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://osupdocs.forestry.oregonstate.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Chadh"/>
	<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=Special:Contributions/Chadh"/>
	<updated>2026-06-01T22:37:39Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.36.2</generator>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=XMLData_Command&amp;diff=6397</id>
		<title>XMLData Command</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=XMLData_Command&amp;diff=6397"/>
		<updated>2019-01-25T23:13:14Z</updated>

		<summary type="html">&lt;p&gt;Chadh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &amp;lt;tt&amp;gt;XMLData&amp;lt;/tt&amp;gt; command inserts raw &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; data into command-interpretation results.&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
As the [[NairnMPM]] and [[NairnFEA]] code engines develop, they sometimes add new features that cannot be used with the current script commands. Rather than wait for new scripting commands or reverting to using &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; input files, the &amp;lt;tt&amp;gt;XMLData&amp;lt;/tt&amp;gt; command lets you insert raw &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; data needed to try the new features.&lt;br /&gt;
&lt;br /&gt;
== XMLData Command ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;XMLData&amp;lt;/tt&amp;gt; command allows you to insert &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; commands into the interpretation results. The format is:&lt;br /&gt;
&lt;br /&gt;
 XMLData &amp;lt;(section)&amp;gt;,&amp;lt;(matid)&amp;gt;&lt;br /&gt;
   &amp;lt;tag&amp;gt;&lt;br /&gt;
     Inserted xml characters&lt;br /&gt;
   &amp;lt;/tag&amp;gt;&lt;br /&gt;
 EndXMLData&lt;br /&gt;
&lt;br /&gt;
where&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;(section)&amp;lt;/tt&amp;gt; indicates the section where the XML data will be inserted (if it is omitted, it is set to &amp;quot;End&amp;quot;). The possible sections are:&lt;br /&gt;
** &amp;quot;Header&amp;quot; to insert at the end of the &amp;lt;tt&amp;gt;&amp;lt;Header&amp;gt;&amp;lt;/tt&amp;gt; section.&lt;br /&gt;
** &amp;quot;MPMHeader&amp;quot; to insert at the end of the &amp;lt;tt&amp;gt;&amp;lt;MPMHeader&amp;gt;&amp;lt;/tt&amp;gt; section (MPM Only).&lt;br /&gt;
** &amp;quot;Mesh&amp;quot; to insert at the end of the &amp;lt;tt&amp;gt;&amp;lt;Mesh&amp;gt;&amp;lt;/tt&amp;gt; section.&lt;br /&gt;
** &amp;quot;MaterialPoints&amp;quot; to insert in the &amp;lt;tt&amp;gt;&amp;lt;MaterialPoints&amp;gt;&amp;lt;/tt&amp;gt; definition section of MPM files or with shape commands in FEA files to define the mesh. It may be interspersed with Region, Hole, and BMPRegion commands.&lt;br /&gt;
** &amp;quot;Material&amp;quot; to insert a custom material along with other materials. Each insertion for this section must define a single [[Material Models|material]] (see [[#Notes|below]])&lt;br /&gt;
** &amp;quot;GridBCs&amp;quot; to insert in the &amp;lt;tt&amp;gt;&amp;lt;GridBCs&amp;gt;&amp;lt;/tt&amp;gt; section. it may be interspersed with other grid boundary conditions.&lt;br /&gt;
** &amp;quot;ParticleBCs&amp;quot; to insert in the &amp;lt;tt&amp;gt;&amp;lt;ParticleBCs&amp;gt;&amp;lt;/tt&amp;gt; section. it may be interspersed with other particle boundary conditions (MPM Only).&lt;br /&gt;
** &amp;quot;Thermal&amp;quot; to insert at the end of the &amp;lt;tt&amp;gt;&amp;lt;Thermal&amp;gt;&amp;lt;/tt&amp;gt; section.&lt;br /&gt;
** &amp;quot;CustomTasks&amp;quot; to insert at the end of the &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; section.&lt;br /&gt;
** &amp;quot;End&amp;quot; to insert at the end of all other &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; data.&lt;br /&gt;
* &amp;lt;tt&amp;gt;(matid)&amp;lt;/tt&amp;gt; specifies a material ID, but is only used when &amp;lt;tt&amp;gt;(section)&amp;lt;/tt&amp;gt; is &amp;quot;Materials&amp;quot; (see [[#Notes|below]])&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; data that is inserted will be all lines between the &amp;lt;tt&amp;gt;XMLData&amp;lt;/tt&amp;gt; command and the &amp;lt;tt&amp;gt;EndXMLData&amp;lt;/tt&amp;gt; Command. You can have multiple &amp;lt;tt&amp;gt;XMLData&amp;lt;/tt&amp;gt; blocks for each section and subsequent blocks will be appended to previous blocks for each section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;Caution:&amp;lt;/font&amp;gt; - all lines are inserted verbatim. If the block contains [[Expression Syntax|expressions]], they will not be evaluated, but just inserted as the expression text. You can avoid this limitation, however, by using an [[Expression Syntax|expression]] to define an [[Entity Command|entity]] and then using that entity in the verbatim &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; code. Similarly, if you comment out a line using the [[Command Line Syntax#Comment Line|scripting language comment method]], that line will still be inserted with the verbatim &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt;. If you want to comment the &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; code (or comment out lines in that code), you can use the &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; comment method of &amp;lt;tt&amp;gt;&amp;amp;lt;!-- an XML comment --&amp;amp;gt;&amp;lt;/tt&amp;gt; instead.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Each insertion into &amp;quot;Material&amp;quot; must define a single [[Material Command Block|&amp;lt;tt&amp;gt;Material&amp;lt;/tt&amp;gt; command block]]:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;Material Type=&amp;quot;20&amp;quot; Name=&amp;quot;New Material&amp;quot;&amp;gt;&lt;br /&gt;
  (property commands)&lt;br /&gt;
&amp;lt;/Material&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
where the property commands set the material properties. The second &amp;lt;tt&amp;gt;(matid)&amp;lt;/tt&amp;gt; parameter to the &amp;lt;tt&amp;gt;XMLData&amp;lt;/tt&amp;gt; command must be provided and it must have a unique [[Material Command Block|material ID]] (which can be used like regular material IDs). This insertion option is provided to work with [[Material Models|materials]] in the code engines that are not yet supported by [[NairnFEAMPM]] or [[NairnFEAMPMViz]], such a new [[Material Models|materials]] currently in development.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;For &amp;quot;MaterialPoints&amp;quot;, &amp;quot;Materials, &amp;quot;GridBCs&amp;quot;, and &amp;quot;ParticleBCs&amp;quot;, the data will be inserted when the &amp;lt;tt&amp;gt;XMLData&amp;lt;/tt&amp;gt; command is used. This approach allows you to intersperse &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; features with scripted features in these sections. For other sections the &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; is inserted at the end each section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Another command to insert raw &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; data is the [[Entity Command]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=PeriodicXPIC_Custom_Task&amp;diff=5882</id>
		<title>PeriodicXPIC Custom Task</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=PeriodicXPIC_Custom_Task&amp;diff=5882"/>
		<updated>2018-02-20T20:49:01Z</updated>

		<summary type="html">&lt;p&gt;Chadh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[MPM Input Files#Custom Tasks|custom task]] to use [[Damping Options#XPIC Damping|XPIC(m) method]] on selected time steps&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The [[XPIC Features|XPIC(m) method]] is an advanced damping method that filters out unwanted noise (in the null space) without damping out useful information. Its drawback is that it adds calculation time as m in XPIC(m) increases. In some simulations, it may not be necessary to use XPIC(m) update methods on every time step. This custom tasks lets you convert such simulations to use XPIC(m) periodically instead of on every time step. Note that both the [[XPIC Features|XPIC(m) method]] and this custom tasks are only available in [[OSParticulas]].&lt;br /&gt;
&lt;br /&gt;
== Using XPIC(m) For Particle Velocities ==&lt;br /&gt;
&lt;br /&gt;
The first step is to select default update method. Normally, the default method would be a standard FLIP method selected by using [[Damping Options#Damping Commands|Damping commands]] and setting &amp;lt;tt&amp;gt;(fractionPIC)&amp;lt;/tt&amp;gt; to 1. Next, you schedule this task and use it to select an XPIC order (the &amp;lt;tt&amp;gt;m&amp;lt;/tt&amp;gt; in XPIC(m)) and frequency to run the XPIC(m) calculations. In scripted files, a &amp;lt;tt&amp;gt;PeriodicXPIC&amp;lt;/tt&amp;gt; custom task is scheduled with&lt;br /&gt;
&lt;br /&gt;
 CustomTask PeriodicXPIC&lt;br /&gt;
 Parameter XPICOrder,(order)&lt;br /&gt;
 Parameter fractionPIC,(fractionPIC)&lt;br /&gt;
 Parameter periodicSteps,(stepInterval)&lt;br /&gt;
 Parameter periodicTime,(timeInterval)&lt;br /&gt;
 Parameter periodicCFL,(CFLfactor)&lt;br /&gt;
 Parameter verbose,{verbose}&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, this task is scheduled using a &amp;lt;tt&amp;gt;&amp;lt;Schedule&amp;gt;&amp;lt;/tt&amp;gt; element, which must be within the single &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Schedule name='PeriodicXPIC'&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='XPICOrder'&amp;gt;(order)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='fractionPIC'&amp;gt;(fractionPIC)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='periodicSteps'&amp;gt;(stepInterval)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='periodicTime'&amp;gt;(timeInterval)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='periodicCFL'&amp;gt;(CFLfactor)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='verbose'&amp;gt;(verbose)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the parameters are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;(XPICOrder)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;(fractionPIC)&amp;lt;/tt&amp;gt; - Enter XPIC order (the &amp;lt;tt&amp;gt;m&amp;lt;/tt&amp;gt; in XPIC(m)) and fraction XPIC(m) (0 to 1) to use when doing periodic XPIC(m) calculations. See  [[Damping Options]] for details on these settings. The defaults are&amp;lt;tt&amp;gt;(XPICOrder)&amp;lt;/tt&amp;gt;=5 with &amp;lt;tt&amp;gt;(fractionPIC)&amp;lt;/tt&amp;gt;=1.&lt;br /&gt;
* &amp;lt;tt&amp;gt;(stepInterval)&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;(timeInterval)&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;(CFLfactor)&amp;lt;/tt&amp;gt; - sets the frequency for running periodic XPIC(m) calculations for mechanics. The &amp;lt;tt&amp;gt;(stepInterval)&amp;lt;/tt&amp;gt; option sets number of time steps between each XPIC(m) calculation, &amp;lt;tt&amp;gt;(timeInterval)&amp;lt;/tt&amp;gt; sets frequency in  [[ConsistentUnits Command#Legacy and Consistent Units|alt time units]], and &amp;lt;tt&amp;gt;(CFLfactor)&amp;lt;/tt&amp;gt; sets frequency relative to the basic time step for the momentum equation. If &amp;lt;tt&amp;gt;(stepInterval)&amp;lt;/tt&amp;gt; is used, it is used and the other two are ignored. If &amp;lt;tt&amp;gt;(stepInterval)&amp;lt;/tt&amp;gt; is not used, the time step is found from the &amp;lt;tt&amp;gt;(CFLfactor)&amp;lt;/tt&amp;gt; (if provided) or from &amp;lt;tt&amp;gt;(timeInterval)&amp;lt;/tt&amp;gt;. One of these three parameters is required to enable periodic XPIC calculations.&lt;br /&gt;
* &amp;lt;tt&amp;gt;(verbose)&amp;lt;/tt&amp;gt; - If a non-zero integer, a comment line is printed in the output file every time XPIC(m) calculations are done. The default is 0.&lt;br /&gt;
&lt;br /&gt;
== Using XPIC(m) For Transport Properties ==&lt;br /&gt;
&lt;br /&gt;
You can also use XPIC(m) for temperature (when doing [[Thermal Calculations|conduction calculations]]) or for concentration (when doing [[Diffusion Calculations|diffusion calculations]]). XPIC(m) seems to provide significant improvement of transport modeling and can eliminate oscillations sometimes seen for temperature or concentration for particles within one cell.&lt;br /&gt;
&lt;br /&gt;
To use XPIC(m) for transport equations, select order and fraction PIC (using parameters in [[#Using XPIC(m) For Particle Velocities|previous section]]) and then select periodicity of XPIC(m) for conduction and/or diffusion with following task parameters:&lt;br /&gt;
&lt;br /&gt;
 Parameter periodicStepsConduction,(stepInterval)&lt;br /&gt;
 Parameter periodicTimeConduction,(timeInterval)&lt;br /&gt;
 Parameter periodicCFLConduction,(CFLfactor)&lt;br /&gt;
 Parameter periodicStepsDiffusion,(stepInterval)&lt;br /&gt;
 Parameter periodicTimeDiffusion,(timeInterval)&lt;br /&gt;
 Parameter periodicCFLDiffusion,(CFLfactor)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, this new parameter options within the &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block are&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Parameter name='periodicStepsConduction'&amp;gt;(stepInterval)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;Parameter name='periodicTimeConduction'&amp;gt;(timeInterval)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;Parameter name='periodicCFLConduction'&amp;gt;(CFLfactor)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;Parameter name='periodicStepsDiffusion'&amp;gt;(stepInterval)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;Parameter name='periodicTimeDiffusion'&amp;gt;(timeInterval)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;Parameter name='periodicCFLDiffusion'&amp;gt;(CFLfactor)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The meanings of values &amp;lt;tt&amp;gt;(stepInterval)&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;(timeInterval)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;(CFLfactor)&amp;lt;/tt&amp;gt; are given in the [[#Using XPIC(m) For Particle Velocities|previous section]].&lt;br /&gt;
&lt;br /&gt;
When using XPIC(m) for transport equations, you should never pick &amp;lt;tt&amp;gt;m=1&amp;lt;/tt&amp;gt; because it causes too much numerical diffusion. Any higher order works, unless it XPIC(m) filtering is done too frequently. Because transport time step is usually much longer then mechanics time step, it is usually best to pick transport XPIC(m) frequency using the CFL parameter options.&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=Ideal_Gas_Material&amp;diff=5772</id>
		<title>Ideal Gas Material</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=Ideal_Gas_Material&amp;diff=5772"/>
		<updated>2018-01-05T19:00:58Z</updated>

		<summary type="html">&lt;p&gt;Chadh: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Constitutive Law ==&lt;br /&gt;
&lt;br /&gt;
This [[Material Models|MPM material]] models an ideal gas implemented as a large-deformation, isotropic, hyperelastic material at finite deformations. Its contitutive law for pressure is:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt;P = P_0 {T\over T_0} {1\over J}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where ''J'' is determinant of the deformation tensor (''J'' = ''V''/''V''&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;), ''T'' is temperature, and ''P''&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; and ''T''&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; are reference conditions. The pressure P is stored in the normal stresses or &amp;amp;sigma;&amp;lt;sub&amp;gt;xx&amp;lt;/sub&amp;gt; =&amp;amp;sigma;&amp;lt;sub&amp;gt;yy&amp;lt;/sub&amp;gt; = &amp;amp;sigma;&amp;lt;sub&amp;gt;zz&amp;lt;/sub&amp;gt; = -''P''. All shear stresses are zero. This material is equivalent to a hyperelastic material with strain energy function of&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt;W = -P_0{T\over T_0} \ln J&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This energy function is equivalent to the energy per unit initial volume for isothermal compression or expansion of an ideal gas.&lt;br /&gt;
&lt;br /&gt;
When using [[Thermal Calculations#Thermodynamics Modes in MPM|isothermal mode]], this material models isothermal compression and expansion, which implies all work results in heating or cooling. The amount of heat generated is tracked in the particle's heat energy. The problem may include heat input (in thermal boundary conditions), which may cause temperture rises. In other words, this mode only means the gas itself will not cause temperature changes. The internal energy will not change unless there is external heating.&lt;br /&gt;
&lt;br /&gt;
To model adiabatic compression and expansion, activate [[Thermal Calculations#Thermodynamics Modes in MPM|adiabatic mode]]. This mode will convert work to heat resulting in heating during compression or cooling during expansion. You need to enter heat capacity (which can only pick monotonic or diatomic gas) and thermal conductivity. The current implementation uses a temperature independent conductivity (which may change in the future).&lt;br /&gt;
&lt;br /&gt;
=== Stability ===&lt;br /&gt;
&lt;br /&gt;
Ideal gas particles are fairly stable, but can be made unstable by certain boundary conditions on constraining walls. If stability problems arise, try different boundary conditions. They also do not work for irreversibale processes such as free expansion into empty space. They are intended to always br bounded by stable pressure.&lt;br /&gt;
&lt;br /&gt;
== Material Properties ==&lt;br /&gt;
&lt;br /&gt;
The ideal gas properties are set with&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Property !! Description !! Units !! Default&lt;br /&gt;
|-&lt;br /&gt;
| P0 || Reference pressure at reference temperature and reference density. This must be a positive value greather than zero. || [[ConsistentUnits Command#Legacy and Consistent Units|pressure units]] || none&lt;br /&gt;
|-&lt;br /&gt;
| T0 || Reference temperature || K || none&lt;br /&gt;
|-&lt;br /&gt;
| rho || Density at reference conditions. ||  [[ConsistentUnits Command#Legacy and Consistent Units|density units]] || none&lt;br /&gt;
|-&lt;br /&gt;
| Cv || Instead of heat capacity, this parameter determines if the gas is monatomic or diatomic. Enter 1 (or any number smaller than 1) for monatomic or 2 (or any number larger than 2)  for diatomic. The resulting heat capacity is C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; = (3/2)R for a monotonic gas and C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; = (5/2)R for a diatomic gas. || none || 1&lt;br /&gt;
|-&lt;br /&gt;
| ([[Common Material Properties|other]]) || Properties common to all materials || varies || varies&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When using gas particles, the [[Thermal Calculations#Stress Free Temperature|stress free temperature]] must always be set to a desired temperature in Kelvin. The material properties refer to gas state at any reference conditions. For example, air might have reference pressure of 1 atm = 0.101325 [[ConsistentUnits Command#Legacy and Consistent Units|pressure units]] at some reference temperature T&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;. The density of air (or any gas) is then given by&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = {P_0 M_g\over R T_0}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where ''M&amp;lt;sub&amp;gt;g&amp;lt;/sub&amp;gt;'' is the molecular weight of the gas (such as 28.97 g/mol for air) and ''R'' is the gas constant, ''R'' = 8.3144621 J/k/mol.&lt;br /&gt;
&lt;br /&gt;
== History Variables ==&lt;br /&gt;
&lt;br /&gt;
None&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
Note that you must always set the [[Thermal Calculations#Stress Free Temperature|stress free temperature]] when use ideal gas law for sample particles.&lt;br /&gt;
&lt;br /&gt;
 Material &amp;quot;air&amp;quot;,&amp;quot;Air&amp;quot;,&amp;quot;IdealGas&amp;quot;&lt;br /&gt;
   P0 0.101325&lt;br /&gt;
   T0 288.15&lt;br /&gt;
   rho 0.001163&lt;br /&gt;
   Cv 2&lt;br /&gt;
 Done&lt;br /&gt;
 StressFreeTemp 300&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=Ideal_Gas_Material&amp;diff=5771</id>
		<title>Ideal Gas Material</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=Ideal_Gas_Material&amp;diff=5771"/>
		<updated>2018-01-05T18:03:44Z</updated>

		<summary type="html">&lt;p&gt;Chadh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Constitutive Law ==&lt;br /&gt;
&lt;br /&gt;
This [[Material Models|MPM material]] models an ideal gas implemented as a large-deformation, isotropic, hyperelastic material at finite deformations. Its contitutive law for pressure is:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt;P = P_0 {T\over T_0} {1\over J}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where ''J'' is determinant of the deformation tensor (''J'' = ''V''/''V''&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;), ''T'' is temperature, and ''P''&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; and ''T''&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; are reference conditions. The pressure P is stored in the normal stresses or &amp;amp;sigma;&amp;lt;sub&amp;gt;xx&amp;lt;/sub&amp;gt; =&amp;amp;sigma;&amp;lt;sub&amp;gt;yy&amp;lt;/sub&amp;gt; = &amp;amp;sigma;&amp;lt;sub&amp;gt;zz&amp;lt;/sub&amp;gt; = -''P''. All shear stresses are zero. This material is equivalent to a hyperelastic material with strain energy function of&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt;W = -P_0{T\over T_0} \ln J&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This energy function is equivalent to the energy per unit initial volume for isothermal compression or expansion of an ideal gas.&lt;br /&gt;
&lt;br /&gt;
When using [[Thermal Calculations#Thermodynamics Modes in MPM|isothermal mode]], this material models isothermal compression and expansion, which implies all work results in heating or cooling. The amount of heat generated is tracked in the particle's heat energy. The problem may include heat input (in thermal boundary conditions), which may cause temperture rises. In other words, this mode only means the gas itself will not cause temperature changes. The internal energy will not change unless there is external heating.&lt;br /&gt;
&lt;br /&gt;
To model adiabatic compression and expansion, activate [[Thermal Calculations#Thermodynamics Modes in MPM|adiabatic mode]]. This mode will convert work to heat resulting in heating during compression or cooling during expansion. You need to enter heat capacity (which can only pick monotonic or diatomic gas) and thermal conductivity. The current implementation uses a temperature independent conductivity (which may change in the future).&lt;br /&gt;
&lt;br /&gt;
=== Stability ===&lt;br /&gt;
&lt;br /&gt;
Ideal gas particles are fairly stable, but can be made unstable by certain boundary conditions on constraining walls. If stability problems arise, try different boundary conditions. They also do not work for irreversibale processes such as free expansion into empty space. They are intended to always br bounded by stable pressure.&lt;br /&gt;
&lt;br /&gt;
== Material Properties ==&lt;br /&gt;
&lt;br /&gt;
The ideal gas properties are set with&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Property !! Description !! Units !! Default&lt;br /&gt;
|-&lt;br /&gt;
| P0 || Reference pressure at reference temperature and reference density. This must be a positive value greather than zero. || [[ConsistentUnits Command#Legacy and Consistent Units|pressure units]] || none&lt;br /&gt;
|-&lt;br /&gt;
| T0 || Reference temperature || K || none&lt;br /&gt;
|-&lt;br /&gt;
| rho || Density at reference conditions. ||  [[ConsistentUnits Command#Legacy and Consistent Units|density units]] || none&lt;br /&gt;
|-&lt;br /&gt;
| Cv || Instead of heat capacity, this parameter determines if the gas is monatomic or diatomic. Enter 1 (or any number smaller than 1) for monatomic or 2 (or any number larger than 2)  for diatomic. The resulting heat capacity is C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; = (3/2)R for a monotonic gas and C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; = (5/2)R for a diatomic gas. || none || 1&lt;br /&gt;
|-&lt;br /&gt;
| ([[Common Material Properties|other]]) || Properties common to all materials || varies || varies&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When using gas particles, the [[Thermal Calculations#Stress Free Temperature|stress free temperature]] must always be set to a desired temperature in Kelvin. The material properties refer to gas state at any reference conditions. For example, air might have reference pressure of 1 atm = 0.101325 [[ConsistentUnits Command#Legacy and Consistent Units|pressure units]] at some reference temperature T&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;. The density of air (or any gas) is then given by&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = {P_0 M_g\over R T_0}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where ''M&amp;lt;sub&amp;gt;g&amp;lt;/sub&amp;gt;'' is the molecular weight of the gas (such as 28.97 g/mol for air) and ''R'' is the gas constant, ''R'' = 8.3144621 J/k/mol.&lt;br /&gt;
&lt;br /&gt;
== History Variables ==&lt;br /&gt;
&lt;br /&gt;
None&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
Note that you must always set the [[Thermal Calculations#Stress Free Temperature|stress free temperature]] when use ideal gas law for sample particles.&lt;br /&gt;
&lt;br /&gt;
 Material &amp;quot;air&amp;quot;,&amp;quot;Air&amp;quot;,&amp;quot;Ideal Gas&amp;quot;&lt;br /&gt;
   P0 0.101325&lt;br /&gt;
   T0 288.15&lt;br /&gt;
   rho 0.001163&lt;br /&gt;
   Cv 2&lt;br /&gt;
 Done&lt;br /&gt;
 StressFreeTemp 300&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=5522</id>
		<title>LoadControl Custom Task</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=5522"/>
		<updated>2017-07-14T21:27:55Z</updated>

		<summary type="html">&lt;p&gt;Chadh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[MPM Input Files#Custom Tasks|custom task]] run a load control simulation based on calculations contact or reaction forces. .&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task needs either [[MPM Global Archiving Options|global contact]] or [[MPM Global Archiving Options|global reaction]] for the specified [[Rigid Material|Rigid material]] depending on if contact for that material is enabled. This task will not work if rigid materials have a velocity function assigned, because these functions over-ride the load control velocity.&lt;br /&gt;
&lt;br /&gt;
This CustomTask tries to achieve the load requested from a provided [[User Defined Functions|user defined function]] by adjusting the velocity of that material. It does that by dynamically estimating the relationship between the displacement and load and then uses a PID control algorithm to adjust the velocity.&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
&lt;br /&gt;
This custom task tries to dynamically estimate the relationship between load and displacement of the rigid material using the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt;A_t = \text{arg}\min_{A}  \left[ (1-\alpha) \frac{(L-Ax)^2}{0.5(L^2+(A_{t-1}x)^2)}+\alpha\frac{(A-A_{t-1})^2}{A_{t-1}^2}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;A_t&amp;lt;/math&amp;gt; is the  estimate the relationship between load and displacement at time ''t'', ''x'' is the displacement, ''L'' is the recorded load and &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; is the &amp;lt;tt&amp;gt;smooth&amp;lt;/tt&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
This gives:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt;A_t =\frac{\lambda L x + \gamma A_{t-1}}{\lambda x^2 +\gamma}&amp;lt;/math&amp;gt;  &amp;amp;nbsp;&amp;amp;nbsp;where&amp;amp;nbsp;&amp;amp;nbsp;   &amp;lt;math&amp;gt;\lambda =\frac{2(1-\alpha)}{L^2+(A_{t-1}x)^2}&amp;lt;/math&amp;gt;  &amp;amp;nbsp;&amp;amp;nbsp;and&amp;amp;nbsp;&amp;amp;nbsp;  &amp;lt;math&amp;gt;\gamma =\frac{\alpha}{A_{t-1}^2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then the error between requested load ''L(t)'' and recorded load ''L'' is smoothed and converted to velocity as:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt;e_t =(1-\alpha)\frac{L(t)-L}{A_t}+\alpha e_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrated error is calculated as:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt;Ie_t =\frac{L(t)-L}{A_t}+ Ie_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The derivative error is calculated with Brown's double exponential smoothing as:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt; e{\scriptstyle 2}_t =(1-\alpha)e_t+ \alpha e{\scriptstyle 2}_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt; De_t = \frac{1-\alpha}{\alpha}(e_t-e{\scriptstyle 2}_t) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then finally the velocity is set using the PID algorithm:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt;V_t  = K_p e_t + K_i Ie_t + 0.25K_i De_t&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: If the velocity has a magnitude larger than &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; than it is given that magnitude and the integrated error for that time step is not accrued.&lt;br /&gt;
&lt;br /&gt;
== Task Scheduling ==&lt;br /&gt;
&lt;br /&gt;
In scripted files, a &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task is scheduled with the following block:&lt;br /&gt;
&lt;br /&gt;
 CustomTask LoadControl&lt;br /&gt;
 Parameter velocity,(velocity)&lt;br /&gt;
 Parameter material,(int)&lt;br /&gt;
 Parameter direction,(int)&lt;br /&gt;
 Parameter MaxVelocity,(number)&lt;br /&gt;
 Parameter &amp;quot;Load_Function (user-inputted function)&amp;quot;&lt;br /&gt;
 Parameter Kp,(number)&lt;br /&gt;
 Parameter Ki,(number)&lt;br /&gt;
 Parameter smooth,(number)&lt;br /&gt;
 Parameter UpdateTime,(number)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, these task options are scheduled using &amp;lt;tt&amp;gt;&amp;lt;Schedule&amp;gt;&amp;lt;/tt&amp;gt; elements, which must be within the single &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Schedule name='LoadControl'&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='velocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='material'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='direction'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='MaxVelocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Load_Function (function)'/&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Kp'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Ki'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='smooth'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='UpdateTime'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are the parameters that this custom task needs to operate:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;velocity&amp;lt;/tt&amp;gt; - This is the starting velocity of the simulation for the specified  [[Rigid Material|Rigid material]]. The sign of this parameter is probably more important than its value, as long as it is something reasonable. It is needed for initializing the load control.&lt;br /&gt;
* &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt; - The material number of the [[Rigid Material|Rigid material]] to be controlled.&lt;br /&gt;
* &amp;lt;tt&amp;gt;direction&amp;lt;/tt&amp;gt; - An integer (1, 2, or 3) to choose the direction (x, y, or z) to contrtol for velocity and load.&lt;br /&gt;
* &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; - A positive number that limits the magnitude of the velocity of the controlled material - defaults to 5 m/s.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Load_Function&amp;lt;/tt&amp;gt; - A [[User Defined Functions|user defined function]] that gives the desired load. This task doesn't work well with discontinuous functions. Note that the function is provided in the &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; of the parameter as a single string. The first word of the string must be &amp;quot;Load_Function&amp;quot; and the remainder of the name is the [[User Defined Functions|user defined function]].&lt;br /&gt;
* &amp;lt;tt&amp;gt;smooth&amp;lt;/tt&amp;gt; - Exponential smoothing parameter in the range (0,1). Controls how fast the dynamic relationship between distance and load is updated and also how much smoothing is done on the load values (default 0.95).&lt;br /&gt;
* &amp;lt;tt&amp;gt;UpdateTime&amp;lt;/tt&amp;gt; - How often to run the load control algorithm. Should be exactly the same as the global archive time (in the script, off by 1000 in xml).&lt;br /&gt;
&lt;br /&gt;
These following parameters are for the control algorithm. The provided default parameters don't seem to really work. Try increasing &amp;lt;tt&amp;gt;Kp&amp;lt;/tt&amp;gt; until it overshoots the target, then increase &amp;lt;tt&amp;gt;Ki&amp;lt;/tt&amp;gt; to lessen the overshoot. &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;Kp &amp;lt;/tt&amp;gt; - Proportional gain factor for PID algorithm (default 0.1).&lt;br /&gt;
* &amp;lt;tt&amp;gt;Ki &amp;lt;/tt&amp;gt; - Integral and Derivative gain factors for PID algorithm. (Note: &amp;lt;tt&amp;gt;Kd = 0.25Ki&amp;lt;/tt&amp;gt;) (default 0.001).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== To be developed ==&lt;br /&gt;
Contact forces are corrupted with fat tail noise. A median filter would help reduce the effect of this noise.&lt;br /&gt;
&lt;br /&gt;
Self-tuning parameters.&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=5521</id>
		<title>LoadControl Custom Task</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=5521"/>
		<updated>2017-07-04T02:03:07Z</updated>

		<summary type="html">&lt;p&gt;Chadh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[MPM Input Files#Custom Tasks|custom task]] run a load control simulation based on calculations contact or reaction forces. .&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task needs either [[MPM Global Archiving Options|global contact]] or [[MPM Global Archiving Options|global reaction]] for the specified [[Rigid Material|Rigid material]] depending on if contact for that material is enabled. This task will not work if rigid materials have a velocity function assigned, because these functions over-ride the load control velocity.&lt;br /&gt;
&lt;br /&gt;
This CustomTask tries to achieve the load requested from a provided [[User Defined Functions|user defined function]] by adjusting the velocity of that material. It does that by dynamically estimating the relationship between the displacement and load and then uses a PID control algorithm to adjust the velocity.&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
&lt;br /&gt;
This custom task tries to dynamically estimate the relationship between load and displacement of the rigid material using the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt;A_t = \text{arg}\min_{A}  \left[ (1-\alpha) \frac{(L-Ax)^2}{0.5(L^2+(A_{t-1}x)^2)}+\alpha\frac{(A-A_{t-1})^2}{A_{t-1}^2}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;A_t&amp;lt;/math&amp;gt; is the  estimate the relationship between load and displacement at time ''t'', ''x'' is the displacement, ''L'' is the recorded load and &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; is the &amp;lt;tt&amp;gt;smooth&amp;lt;/tt&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
This gives:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt;A_t =\frac{\lambda L x + \gamma A_{t-1}}{\lambda x^2 +\gamma}&amp;lt;/math&amp;gt;  &amp;amp;nbsp;&amp;amp;nbsp;where&amp;amp;nbsp;&amp;amp;nbsp;   &amp;lt;math&amp;gt;\lambda =\frac{2(1-\alpha)}{L^2+(A_{t-1}x)^2}&amp;lt;/math&amp;gt;  &amp;amp;nbsp;&amp;amp;nbsp;and&amp;amp;nbsp;&amp;amp;nbsp;  &amp;lt;math&amp;gt;\gamma =\frac{\alpha}{A_{t-1}^2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then the error between requested load ''L(t)'' and recorded load ''L'' is smoothed and converted to velocity as:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt;e_t =(1-\alpha)\frac{L(t)-L}{A_t}+\alpha e_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrated error is calculated as:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt;Ie_t =\frac{L(t)-L}{A_t}+ Ie_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The derivative error is calculated with Brown's double exponential smoothing as:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt; e{\scriptstyle 2}_t =(1-\alpha)e_t+ \alpha e{\scriptstyle 2}_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt; De_t = \frac{1-\alpha}{\alpha}(e_t-e{\scriptstyle 2}_t) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then finally the velocity is set using the PID algorithm:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt;V_t  = K_p e_t + K_i Ie_t + 0.25K_i De_t&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: If the velocity has a magnitude larger than &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; than it is given that magnitude and the integrated error for that time step is not accrued.&lt;br /&gt;
&lt;br /&gt;
== Task Scheduling ==&lt;br /&gt;
&lt;br /&gt;
In scripted files, a &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task is scheduled with the following block:&lt;br /&gt;
&lt;br /&gt;
 CustomTask LoadControl&lt;br /&gt;
 Parameter velocity,(velocity)&lt;br /&gt;
 Parameter material,(int)&lt;br /&gt;
 Parameter direction,(int)&lt;br /&gt;
 Parameter MaxVelocity,(number)&lt;br /&gt;
 Parameter &amp;quot;Load_Function (user-inputted function)&amp;quot;&lt;br /&gt;
 Parameter Kp,(number)&lt;br /&gt;
 Parameter Ki,(number)&lt;br /&gt;
 Parameter smooth,(number)&lt;br /&gt;
 Parameter UpdateTime,(number)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, these task options are scheduled using &amp;lt;tt&amp;gt;&amp;lt;Schedule&amp;gt;&amp;lt;/tt&amp;gt; elements, which must be within the single &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Schedule name='LoadControl'&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='velocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='material'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='direction'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='MaxVelocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Load_Function (function)'/&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Kp'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Ki'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='smooth'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='UpdateTime'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are the parameters that this custom task needs to operate:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;velocity&amp;lt;/tt&amp;gt; - This is the starting velocity of the simulation for the specified  [[Rigid Material|Rigid material]]. The sign of this parameter is probably more important than its value, as long as it is something reasonable. It is needed for initializing the load control.&lt;br /&gt;
* &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt; - The material number of the [[Rigid Material|Rigid material]] to be controlled.&lt;br /&gt;
* &amp;lt;tt&amp;gt;direction&amp;lt;/tt&amp;gt; - An integer (1, 2, or 3) to choose the direction (x, y, or z) to contrtol for velocity and load.&lt;br /&gt;
* &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; - A positive number that limits the magnitude of the velocity of the controlled material - defaults to 5 m/s.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Load_Function&amp;lt;/tt&amp;gt; - A [[User Defined Functions|user defined function]] that gives the desired load. This task doesn't work well with discontinuous functions. Note that the function is provided in the &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; of the parameter as a single string. The first word of the string must be &amp;quot;Load_Function&amp;quot; and the remainder of the name is the [[User Defined Functions|user defined function]].&lt;br /&gt;
* &amp;lt;tt&amp;gt;smooth&amp;lt;/tt&amp;gt; - Exponential smoothing parameter in the range (0,1). Controls how fast the dynamic relationship between distance and load is updated and also how much smoothing is done on the load values (default 0.95).&lt;br /&gt;
* &amp;lt;tt&amp;gt;UpdateTime&amp;lt;/tt&amp;gt; - How often to run the load control algorithm. Should be exactly the same as the global archive time.&lt;br /&gt;
&lt;br /&gt;
These following parameters are for the control algorithm. The provided default parameters don't seem to really work. Try increasing &amp;lt;tt&amp;gt;Kp&amp;lt;/tt until it overshoots the target, then increase &amp;lt;tt&amp;gt;Ki&amp;lt;/tt to lessen the overshoot. &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;Kp&amp;lt;/tt&amp;gt; - Proportional gain factor for PID algorithm (default 0.1).&lt;br /&gt;
* &amp;lt;tt&amp;gt;Ki&amp;lt;/tt&amp;gt; - Integral and Derivative gain factors for PID algorithm. (Note: &amp;lt;tt&amp;gt;Kd = 0.25Ki&amp;lt;/tt&amp;gt;) (default 0.001).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== To be developed ==&lt;br /&gt;
Contact forces are corrupted with fat tail noise. A median filter would help reduce the effect of this noise.&lt;br /&gt;
&lt;br /&gt;
Self-tuning parameters.&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=MPM_Global_Archiving_Options&amp;diff=4897</id>
		<title>MPM Global Archiving Options</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=MPM_Global_Archiving_Options&amp;diff=4897"/>
		<updated>2016-10-21T01:45:44Z</updated>

		<summary type="html">&lt;p&gt;Chadh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Global archiving is an option to save selected calculated results in a single file. This section explains how to use this feature.&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
In MPM calculations, the solution is stored in a series of [[MPM Archiving Options|archive files]]. You can optionally create a global results file which will store selected calculated result such as average stress, total energy, &amp;lt;i&amp;gt;etc.&amp;lt;/i&amp;gt;, in a single text file. This file can plotted later in [[NairnFEAMPM]] or in [[NairnFEAMPMViz]] or can be opened later any spread-sheet software. The file is tab delimited with time (in [[ConsistentUnits Command#Legacy and Consistent Units|alt time units]]) in the first column and all requested results in subsequent columns.&lt;br /&gt;
&lt;br /&gt;
== Input Commands ==&lt;br /&gt;
&lt;br /&gt;
In script input files, global archiving is set up with the following commands:&lt;br /&gt;
&lt;br /&gt;
 GlobalArchive (quantity),&amp;lt;(mat)&amp;gt;&lt;br /&gt;
 GlobalArchiveTime (time)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; input files, global archive is set up with the following commands, which must be within the [[MPM Input Files#MPM Header|&amp;lt;tt&amp;gt;&amp;lt;MPMHeader&amp;gt;&amp;lt;/tt&amp;gt; element]]:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;GlobalArchive type='(quantity)' mat='(mat)'/&amp;gt;&lt;br /&gt;
 &amp;lt;GlobalArchiveTime&amp;gt;1&amp;lt;/GlobalArchiveTime&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;(quantity)&amp;lt;/tt&amp;gt; is the global quantity to be saved in the global results file. The case-sensitive options are:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Stresses&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;sxx&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;syy&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;szz&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;sxy&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;sxz&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;syz&amp;lt;/tt&amp;gt; - average element of the stress tensor in [[ConsistentUnits Command#Legacy and Consistent Units|pressure units]]&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;sRR&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;sZZ&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;sTT&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;sRZ&amp;lt;/tt&amp;gt; - average element of the axisymmetric stress tensor in [[ConsistentUnits Command#Legacy and Consistent Units|pressure units]] (synonyms for &amp;lt;tt&amp;gt;sxx&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;syy&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;szz&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;sxy&amp;lt;/tt&amp;gt;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Strains and Deformation&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;exx&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;eyy&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;ezz&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;exy&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;exz&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;eyz&amp;lt;/tt&amp;gt; - average element of the total [[#Notes|Biot]] strain tensor in [[ConsistentUnits Command#Legacy and Consistent Units|alt strain units]].&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;eRR&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;eZZ&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;eTT&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;eRZ&amp;lt;/tt&amp;gt; - average element of the axisymmetric total [[#Notes|Biot]] strain tensor in [[ConsistentUnits Command#Legacy and Consistent Units|alt strain units]] (synonyms for &amp;lt;tt&amp;gt;exx&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;eyy&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;ezz&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;exy&amp;lt;/tt&amp;gt;)&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;exxe&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;eyye&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;ezze&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;exye&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;exze&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;eyze&amp;lt;/tt&amp;gt; - average element of the elastic [[#Notes|Biot]] strain tensor in [[ConsistentUnits Command#Legacy and Consistent Units|alt strain units]], which is tptal [[#Notes|Biot]] strain minus plastic [[#Notes|Biot]] strain for plasticity materials.&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;eRRe&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;eZZe&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;eTTe&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;eRZe&amp;lt;/tt&amp;gt; - average element of the axisymmetric elastic [[#Notes|Biot]] strain tensor [[ConsistentUnits Command#Legacy and Consistent Units|alt strain units]] (synonyms for &amp;lt;tt&amp;gt;exxe&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;eyye&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;ezze&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;exye&amp;lt;/tt&amp;gt;)&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;exxp&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;eyyp&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;ezzp&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;exyp&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;exzp&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;eyzp&amp;lt;/tt&amp;gt; - average element of the plastic [[#Notes|Biot]] strain tensor in [[ConsistentUnits Command#Legacy and Consistent Units|alt strain units]]&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;eRRp&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;eZZp&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;eTTp&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;eRZp&amp;lt;/tt&amp;gt; - average element of the axisymmetric plastic [[#Notes|Biot]] strain tensor in [[ConsistentUnits Command#Legacy and Consistent Units|alt strain units]] (synonyms for &amp;lt;tt&amp;gt;exxe&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;eyye&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;ezze&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;exye&amp;lt;/tt&amp;gt;)&amp;lt;/li&amp;gt;&lt;br /&gt;
        &amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;Fij&amp;lt;/tt&amp;gt; (where i and j are x, y, or z) - any component of the total deformation gradient (absolute)&amp;lt;/li&amp;gt;&lt;br /&gt;
        &amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;Fij&amp;lt;/tt&amp;gt; (where i and j are R or Z) - any component of the total axisymmetric deformation gradient (absolute, synonyms for the x or y versions).&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;velx&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;vely&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;velz&amp;lt;/tt&amp;gt; - average component of velocity in [[ConsistentUnits Command#Legacy and Consistent Units|velocity units]]&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;velR&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;velZ&amp;lt;/tt&amp;gt; - average component of axisymmetric velocity in [[ConsistentUnits Command#Legacy and Consistent Units|velocity units]] (synonyms for &amp;lt;tt&amp;gt;velx&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;vely&amp;lt;/tt&amp;gt;)&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;dispx&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;dispy&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;dispz&amp;lt;/tt&amp;gt; - average component of displacement in [[ConsistentUnits Command#Legacy and Consistent Units|length units]]&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;dispR&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;dispZ&amp;lt;/tt&amp;gt; - average component of axisymmetric displacement in [[ConsistentUnits Command#Legacy and Consistent Units|length units]] (synonyms for &amp;lt;tt&amp;gt;dispx&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;dispy&amp;lt;/tt&amp;gt;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Momenta&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;px&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;py&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;pz&amp;lt;/tt&amp;gt; - average component of momentum (in [[ConsistentUnits Command#Legacy and Consistent Units|force-time units]])&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;pR&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;pR&amp;lt;/tt&amp;gt; - average component of axisymmetric momentum (in [[ConsistentUnits Command#Legacy and Consistent Units|force-time units]]) (synonyms for &amp;lt;tt&amp;gt;px&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;py&amp;lt;/tt&amp;gt;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;Lx&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;Ly&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;Lz&amp;lt;/tt&amp;gt; - average component of angular momentum (in [[ConsistentUnits Command#Legacy and Consistent Units|energy-time units]]) (note that only &amp;lt;tt&amp;gt;Lz&amp;lt;/tt&amp;gt; is non-zero in 2D or axisymmetric calculations).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&amp;lt;tt&amp;gt;Lpx&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;Lpy&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;Lpz&amp;lt;/tt&amp;gt; - average component of particle spin angular momentum (in [[ConsistentUnits Command#Legacy and Consistent Units|energy-time units]]) (note that only &amp;lt;tt&amp;gt;Lpz&amp;lt;/tt&amp;gt; is non-zero in 2D or axisymmetric calculations and the simulation must be [[Analysis Command#Tracking Particle Spin|tracking particle spin]] for any compononent to be non zero).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;wpx&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;wpy&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;wpz&amp;lt;/tt&amp;gt; - average component of particle spin velocity (in [[ConsistentUnits Command#Legacy and Consistent Units|1/time units]]) (note that only &amp;lt;tt&amp;gt;wpz&amp;lt;/tt&amp;gt; is non-zero in 2D or axisymmetric calculations and the simulation must be [[Analysis Command#Tracking Particle Spin|tracking particle spin]] for any compononent to be non zero).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Contact and Reaction Forces&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;contactx&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;contacty&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;contactz&amp;lt;/tt&amp;gt; - component of the total contact force on the grid for [[Multimaterial MPM|multimaterial mode]] simulations when they include [[Rigid Material|rigid materials]] that have &amp;lt;tt&amp;gt;SetDirection=8&amp;lt;/tt&amp;gt;. It is a sum of all contact forces for the rigid material on the object in [[ConsistentUnits Command#Legacy and Consistent Units|force units]].&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;contactR&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;contactZ&amp;lt;/tt&amp;gt; - component of the total contact force per radian on the axisymmetric grid in [[ConsistentUnits Command#Legacy and Consistent Units|force units]] (synonyms for &amp;lt;tt&amp;gt;contactx&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;contacty&amp;lt;/tt&amp;gt;)&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;reactionx&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;reactiony&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;reactionz&amp;lt;/tt&amp;gt; - component of the reaction force at nodes with velocity boundary conditions in [[ConsistentUnits Command#Legacy and Consistent Units|force units]]. If option &amp;lt;tt&amp;gt;(material)&amp;lt;/tt&amp;gt; specifies a material, the force will be for all velocity conditions created by that [[Rigid Material|rigid material]]; if &amp;lt;tt&amp;gt;(material)&amp;lt;/tt&amp;gt; is omitted the force will sum all velocity boundary conditions (specified or created by rigid particles); if &amp;lt;tt&amp;gt;(material)&amp;lt;/tt&amp;gt; &amp;lt; 0, the force will be only for velocity boundary conditions with that [[Setting Velocity, Temperature, and Concentration#Boundary Condition ID|boundary condition ID]]. When the [[ExtrapolateRigid Command|ExtrapolateRigid mode]] is used, set (material) to -40 to get reaction force for all rigid materials (and in this mode it is not possible to get separate forces on different rigid materials).&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;reactionR&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;reactionZ&amp;lt;/tt&amp;gt; - component of the reaction force per radian at axisymmetric nodes with velocity boundary conditions in [[ConsistentUnits Command#Legacy and Consistent Units|force units]] (synonyms for &amp;lt;tt&amp;gt;reactionx&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;reactiony&amp;lt;/tt&amp;gt; and see those options for meaning of the &amp;lt;tt&amp;gt;(material)&amp;lt;/tt&amp;gt; option)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Temperature and Heat&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;temp&amp;lt;/tt&amp;gt; - average temperature (when doing  [[Thermal Calculations|thermal calculations]])&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;Heat Energy&amp;lt;/tt&amp;gt; - total heat energy in [[ConsistentUnits Command#Legacy and Consistent Units|energy units]]&amp;lt;/li&amp;gt;&lt;br /&gt;
        &amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;Friction Work&amp;lt;/tt&amp;gt; - total friction work converted into heat in [[ConsistentUnits Command#Legacy and Consistent Units|energy units]].&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;heatWatts&amp;lt;/tt&amp;gt; - the reaction heating rate at nodes with temperature boundary conditions in [[ConsistentUnits Command#Legacy and Consistent Units|energy/time units]]. If option &amp;lt;tt&amp;gt;(material)&amp;lt;/tt&amp;gt; specifies a material, the heating rate will be for all temperature conditions created by that [[Rigid Material|rigid material]]; if &amp;lt;tt&amp;gt;(material)&amp;lt;/tt&amp;gt; is omitted the force will sum all temperature boundary conditions (specified or created by rigid particles); if &amp;lt;tt&amp;gt;(material)&amp;lt;/tt&amp;gt; &amp;lt; 0, the heating rate will be only for temperature boundary conditions with that [[Setting Velocity, Temperature, and Concentration#Boundary Condition ID|boundary condition ID]].&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Thermodynamics Functions&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;Work Energy&amp;lt;/tt&amp;gt; - total work energy in [[ConsistentUnits Command#Legacy and Consistent Units|energy units]], which is cumulative &amp;amp;sigma;.d&amp;amp;epsilon;&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;Strain Energy&amp;lt;/tt&amp;gt; - total strain energy in [[ConsistentUnits Command#Legacy and Consistent Units|energy units]], which is cumulative &amp;amp;sigma;.(d&amp;amp;epsilon;-d&amp;amp;epsilon;&amp;lt;sub&amp;gt;res&amp;lt;/sub&amp;gt;)&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;Kinetic Energy&amp;lt;/tt&amp;gt; - total kinetic energy in [[ConsistentUnits Command#Legacy and Consistent Units|energy units]] on the particles&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;Grid Kinetic Energy&amp;lt;/tt&amp;gt; - total kinetic energy in[[ConsistentUnits Command#Legacy and Consistent Units|energy units]] on the grid&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;Heat Energy&amp;lt;/tt&amp;gt; - total heat energy in [[ConsistentUnits Command#Legacy and Consistent Units|energy units]]&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;Entropy&amp;lt;/tt&amp;gt; - total entropy in [[ConsistentUnits Command#Legacy and Consistent Units|energy units]]&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;Internal Energy&amp;lt;/tt&amp;gt; - sum of work and heat energy (U = w + q) in [[ConsistentUnits Command#Legacy and Consistent Units|energy units]]&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;Helmholz Energy&amp;lt;/tt&amp;gt; - total Helmholz free energy (A = U - TS) in [[ConsistentUnits Command#Legacy and Consistent Units|energy units]]&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;Interface Energy&amp;lt;/tt&amp;gt; - total energy associated with cracks having imperfect interfaces in [[ConsistentUnits Command#Legacy and Consistent Units|energy units]].&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;Plastic Energy&amp;lt;/tt&amp;gt; - total dissipated energy in [[ConsistentUnits Command#Legacy and Consistent Units|energy units]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Damping Terms&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;alpha&amp;lt;/tt&amp;gt; - the total grid damping coefficient, &amp;amp;alpha;&amp;lt;sub&amp;gt;g&amp;lt;/sub&amp;gt;(''t''), which is a combination of [[Damping Options#Grid Damping|constant and feedback grid damping]] terms (in [[ConsistentUnits Command#Legacy and Consistent Units|1/time units]])&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;palpha&amp;lt;/tt&amp;gt; - the total particle damping coefficient, &amp;amp;alpha;&amp;lt;sub&amp;gt;p&amp;lt;/sub&amp;gt;(''t''), which is a combination of [[Damping Options#Particle Damping|constant and feedback particle damping]] terms (in [[ConsistentUnits Command#Legacy and Consistent Units|1/time units]]) ([[OSParticulas]] only).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Other Properties&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;concentration&amp;lt;/tt&amp;gt; - weight fraction concentration (when doing [[Diffusion Calculations|diffusion calculations]])&amp;lt;/li&amp;gt;	&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;Step number&amp;lt;/tt&amp;gt; - the current MPM step number&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;Elapsed time&amp;lt;/tt&amp;gt; - elapsed clock time for the current calculation (in [[ConsistentUnits Command#Legacy and Consistent Units|time units]])&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;CPU time&amp;lt;/tt&amp;gt; - total CPU time for the current calculation (in [[ConsistentUnits Command#Legacy and Consistent Units|time units]])&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;The optional &amp;lt;tt&amp;gt;(mat)&amp;lt;/tt&amp;gt; is the [[Material Command Block|material ID]] for a previously defined [[Material Models|material]]. Most of the global quantities are averaged over particles. You can specify this optional second parameter with a material ID and the average will be only for particles of that material type. Omit this parameter (or attribute) to indicate an average over all particles. Most quantites on the grid (&amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;, &amp;lt;tt&amp;gt;Grid Kinetic Energy&amp;lt;/tt&amp;gt; but not &amp;lt;tt&amp;gt;reactionx(y,z,R,Z)&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;contactx(y,z,R,Z)&amp;lt;/tt&amp;gt;) will ignore the material ID.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;The optional &amp;lt;tt&amp;gt;(time)&amp;lt;/tt&amp;gt; is the time interval for storing global results. In scripted file, &amp;lt;tt&amp;gt;(time)&amp;lt;/tt&amp;gt; it is is in [[ConsistentUnits Command#Legacy and Consistent Units|alt time units]] (it can be an [[Entity Command|entity]] that evaluates to value in [[ConsistentUnits Command#Legacy and Consistent Units|time units]]). In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, it is in [[ConsistentUnits Command#Legacy and Consistent Units|time units]] (or determined by a a [[Units Attribute|units attribute]]). If the time interval is not specified, it will be set to the archiving interval specified in the [[MPM Archiving Options|archiving options]]. Specifying another time lets these two archiving times be different if desired.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
# When global archiving of strains, they are calculated as a Biot strain in the current configuration. The Biot strain is defined is '''V-I''' where '''V''' is the left-stretch tensor. This strain is also the Seth-Hill strain with m=1/2 in current configuration. For small strain problems it is equivalent to the small strain tensor.&lt;br /&gt;
# You can store as many quantities as you want in the global results file by having any number of &amp;lt;tt&amp;gt;GlobalArchive&amp;lt;/tt&amp;gt; commands, but only one option can be in each command. Each quantity will be in a labeled column in the global archive text file.&lt;br /&gt;
# The global archive text will be be stored at the path given in the [[MPM Archiving Options|archiving options]] with extension &amp;lt;tt&amp;gt;.global&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Note that all terms involving heat (&amp;quot;Heat Energy&amp;quot;, &amp;quot;Entropy&amp;quot;, &amp;quot;Internal Energy&amp;quot;, and &amp;quot;Helmholz Energy&amp;quot;) will only be physically correct if all materials have specified their heat capacity.&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4815</id>
		<title>LoadControl Custom Task</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4815"/>
		<updated>2016-08-15T22:15:13Z</updated>

		<summary type="html">&lt;p&gt;Chadh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[MPM Input Files#Custom Tasks|custom task]] run a load control simulation based on calculations contact or reaction forces. .&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task needs either [[MPM Global Archiving Options|global contact]] or [[MPM Global Archiving Options|global reaction]] for the specified [[Rigid Material|Rigid material]] depending on if contact for that material is enabled.&lt;br /&gt;
&lt;br /&gt;
This CustomTask tries to achieve the load requested from a provided [[User Defined Functions|user defined function]] by adjusting the velocity of that material. It does that by dynamically estimating the relationship between the displacement and load and then uses a PID control algorithm to adjust the velocity.&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
&lt;br /&gt;
This custom task tries to dynamically estimate the relationship between load and displacement of the rigid material using the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt;A_t = \text{arg}\min_{A}  \left[ (1-\alpha) \frac{(L-Ax)^2}{0.5(L^2+(A_{t-1}x)^2)}+\alpha\frac{(A-A_{t-1})^2}{A_{t-1}^2}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;A_t&amp;lt;/math&amp;gt; is the  estimate the relationship between load and displacement at time ''t'', ''x'' is the displacement, ''L'' is the recorded load and &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; is the &amp;lt;tt&amp;gt;smooth&amp;lt;/tt&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
This gives:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt;A_t =\frac{\lambda L x + \gamma A_{t-1}}{\lambda x^2 +\gamma}&amp;lt;/math&amp;gt;  &amp;amp;nbsp;&amp;amp;nbsp;where&amp;amp;nbsp;&amp;amp;nbsp;   &amp;lt;math&amp;gt;\lambda =\frac{2(1-\alpha)}{L^2+(A_{t-1}x)^2}&amp;lt;/math&amp;gt;  &amp;amp;nbsp;&amp;amp;nbsp;and&amp;amp;nbsp;&amp;amp;nbsp;  &amp;lt;math&amp;gt;\gamma =\frac{\alpha}{A_{t-1}^2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then the error between requested load ''L(t)'' and recorded load ''L'' is smoothed and converted to velocity as:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt;e_t =(1-\alpha)\frac{L(t)-L}{A_t}+\alpha e_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrated error is calculated as:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt;Ie_t =\frac{L(t)-L}{A_t}+ Ie_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The derivative error is calculated with Brown's double exponential smoothing as:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt; e{\scriptstyle 2}_t =(1-\alpha)e_t+ \alpha e{\scriptstyle 2}_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt; De_t = \frac{1-\alpha}{\alpha}(e_t-e{\scriptstyle 2}_t) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then finally the velocity is set using the PID algorithm:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt;V_t  = K_p e_t + K_i Ie_t + 0.25K_i De_t&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: If the velocity has a magnitude larger than &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; than it is given that magnitude and the integrated error for that time step is not accrued.&lt;br /&gt;
&lt;br /&gt;
== Task Scheduling ==&lt;br /&gt;
&lt;br /&gt;
In scripted files, a &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task is scheduled with the following block:&lt;br /&gt;
&lt;br /&gt;
 CustomTask LoadControl&lt;br /&gt;
 Parameter velocity,(velocity)&lt;br /&gt;
 Parameter material,(int)&lt;br /&gt;
 Parameter direction,(int)&lt;br /&gt;
 Parameter MaxVelocity,(number)&lt;br /&gt;
 Parameter &amp;quot;Load_Function (user-inputted function)&amp;quot;&lt;br /&gt;
 Parameter Kp,(number)&lt;br /&gt;
 Parameter Ki,(number)&lt;br /&gt;
 Parameter smooth,(number)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, these task options are scheduled using &amp;lt;tt&amp;gt;&amp;lt;Schedule&amp;gt;&amp;lt;/tt&amp;gt; elements, which must be within the single &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Schedule name='LoadControl'&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='velocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='material'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='direction'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='MaxVelocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Load_Function (function)'/&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Kp'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Ki'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='smooth'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are the parameters that this custom task needs to operate:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;velocity&amp;lt;/tt&amp;gt; - This is the starting velocity of the simulation for the specified  [[Rigid Material|Rigid material]]. The sign of this parameter is probably more important than its value, as long as it is something reasonable. It is needed for initializing the load control.&lt;br /&gt;
* &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt; - The material number of the [[Rigid Material|Rigid material]] to be controlled.&lt;br /&gt;
* &amp;lt;tt&amp;gt;direction&amp;lt;/tt&amp;gt; - An integer (1, 2, or 3) to choose the direction (x, y, or z) to contrtol for velocity and load.&lt;br /&gt;
* &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; - A positive number that limits the magnitude of the velocity of the controlled material - defaults to 5 m/s.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Load_Function&amp;lt;/tt&amp;gt; - A [[User Defined Functions|user defined function]] that gives the desired load. This task doesn't work well with discontinuous functions. Note that the function is provided in the &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; of the parameter as a single string. The first word of the string must be &amp;quot;Load_Function&amp;quot; and the remainder of the name is the [[User Defined Functions|user defined function]].&lt;br /&gt;
&lt;br /&gt;
These following parameters are for the control algorithm. The provided default parameters seem to work well, but each can be changed if needed.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;Kp&amp;lt;/tt&amp;gt; - Proportional gain factor for PID algorithm (default 0.1).&lt;br /&gt;
* &amp;lt;tt&amp;gt;Ki&amp;lt;/tt&amp;gt; - Integral and Derivative gain factors for PID algorithm. (Note: &amp;lt;tt&amp;gt;Kd = 0.25Ki&amp;lt;/tt&amp;gt;) (default 0.001).&lt;br /&gt;
* &amp;lt;tt&amp;gt;smooth&amp;lt;/tt&amp;gt; - Exponential smoothing parameter in the range (0,1). Controls how fast the dynamic relationship between distance and load is updated and also how much smoothing is done on the load values (default 0.95).&lt;br /&gt;
&lt;br /&gt;
== To be developed ==&lt;br /&gt;
Contact forces are corrupted with fat tail noise. A median filter would help reduce the effect of this noise.&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=ExtractMPM&amp;diff=4741</id>
		<title>ExtractMPM</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=ExtractMPM&amp;diff=4741"/>
		<updated>2016-07-06T21:18:01Z</updated>

		<summary type="html">&lt;p&gt;Chadh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The ExtractMPM tool will extract data from [[NairnMPM]] archive files and write them to text, binary or &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files. You can use your own visualization tools to work with the extracted data.&lt;br /&gt;
&lt;br /&gt;
== Compiling ExtractMPM ==&lt;br /&gt;
&lt;br /&gt;
The first step is to compile the ExtractMPM command-line tool. When using MacOS X, you can compile ExtractMPM using that target in the project found at &amp;lt;tt&amp;gt;nairn-mpm-fea/Common/Projects/NairnMPM.xcodeproj&amp;lt;/tt&amp;gt;. On any other system (or alternatively in MacOS X), you can compile using the command line&lt;br /&gt;
&lt;br /&gt;
 c++ -O3 -o ExtractMPM ExtractMPM.cpp&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;-O3&amp;lt;/tt&amp;gt; options turns on optimization. You can change the &amp;lt;tt&amp;gt;-o&amp;lt;/tt&amp;gt; path name as desired to install the executable at any location.&lt;br /&gt;
&lt;br /&gt;
== Using Extract MPM ==&lt;br /&gt;
&lt;br /&gt;
You run the ExtractMPM command line tool on a command line with&lt;br /&gt;
&lt;br /&gt;
 ExtractMPM [-hdDfFTXVsH23PC] [-b format] [-c format] [-m num] [-M num]&lt;br /&gt;
                [-q data] [-n text] [-o path] archive0 archive1 ...&lt;br /&gt;
&lt;br /&gt;
ExtractMPM reads the [[NairnMPM]] binary archive files in &amp;lt;tt&amp;gt;archive0&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;archive1&amp;lt;/tt&amp;gt;, &amp;lt;i&amp;gt;etc.&amp;lt;/i&amp;gt;, extracts the data selected by the options, and outputs it all to standard output or to file(s) specified in the options.The flags and their descriptions, in alphabetical order, are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-b&amp;lt;/b&amp;gt; &amp;lt;u&amp;gt;format&amp;lt;/u&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Specify the archive &amp;lt;u&amp;gt;format&amp;lt;/u&amp;gt; of the file. Only needed for ver3 archive files.  For ver4 archive files or newer it is overridden by the file format specified in the [[Archive File Formats#Archive File Header|archive file's header]]. See [[Archive File Formats#NairnMPM Output Files|MPM output file format]] information for more details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-c&amp;lt;/b&amp;gt; &amp;lt;u&amp;gt;format&amp;lt;/u&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Specify the crack archive &amp;lt;u&amp;gt;format&amp;lt;/u&amp;gt; of the file. Only needed for ver3 archive files.  For ver4 archive files or newer it is overridden by the file format specified in the [[Archive File Formats#Archive File Header|archive file's header]]. See [[Archive File Formats#NairnMPM Output Files|MPM output file format]] information for more details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-C&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Specify to export crack particle data only. The selected quantities should be only crack particle properties.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-d&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Output as little Endian binary file with double precision numbers (extension &amp;lt;tt&amp;gt;.data&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-D&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Output as big Endian binary file with double precision numbers (extension &amp;lt;tt&amp;gt;.data&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-f&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Output as little Endian binary file with single precision numbers or floats (extension &amp;lt;tt&amp;gt;.data&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-F&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Output as big Endian binary file with single precision numbers or floats (extension &amp;lt;tt&amp;gt;.data&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-h&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Include a header at the beginning of the file. The header has text that describes the content of the file. Each line begins with a key word. The text after the space is the setting for that keyword. The possible keywords are&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Name - optional text if the &amp;lt;b&amp;gt;-n&amp;lt;/b&amp;gt; options is used&lt;br /&gt;
&amp;lt;li&amp;gt;Source - name of the input archive file&lt;br /&gt;
&amp;lt;li&amp;gt;Data - space delimited list of columns in the output&lt;br /&gt;
&amp;lt;li&amp;gt;Included_Materials - space delimited list of included materials&lt;br /&gt;
&amp;lt;li&amp;gt;Excluded_Materials - space delimited list of omitted materials&lt;br /&gt;
&amp;lt;li&amp;gt;Format - format of the output numbers (&amp;lt;tt&amp;gt;text&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;xml&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;double&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;float&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&amp;lt;li&amp;gt;Endian - for binary output will be &amp;lt;tt&amp;gt;little&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;big&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;li&amp;gt;EndHeader - last line of the header&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
The header ends with the line feed character (&amp;lt;tt&amp;gt;0x0A&amp;lt;/tt&amp;gt;) after &amp;lt;tt&amp;gt;EndHeader&amp;lt;/tt&amp;gt;. For binary files, the header is padded to be a multiple of 8&lt;br /&gt;
bytes long. For VTK Legacy files, the name (if provided) and source will always be output on the second line of the file (&amp;lt;i&amp;gt;i.e&amp;lt;/i&amp;gt;, the &amp;lt;b&amp;gt;-h&amp;lt;/b&amp;gt; option is not needed).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-H&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Print synopsis of ExtractMPM with brief description of all&lt;br /&gt;
options and variables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-m&amp;lt;/b&amp;gt; &amp;lt;u&amp;gt;num&amp;lt;/u&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Omit data for particles with material number &amp;lt;u&amp;gt;num&amp;lt;/u&amp;gt;.  More than one use can remove multiple material types.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-M&amp;lt;/b&amp;gt; &amp;lt;u&amp;gt;num&amp;lt;/u&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Include data for particles with material number &amp;lt;u&amp;gt;num&amp;lt;/u&amp;gt;. More than one use can include multiple material types. If no &amp;lt;b&amp;gt;-M&amp;lt;/b&amp;gt; options are used, then all materials are included. A material that is both included and excluded, will be excluded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-n&amp;lt;/b&amp;gt; &amp;lt;u&amp;gt;text&amp;lt;/u&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;The text defines a title or any brief comment about the extracted file. It is output in the header, but only if the &amp;lt;b&amp;gt;-h&amp;lt;/b&amp;gt; option is used. For text with spaces, include it in quotes. For VTK Lagacy files it is output on the second line of the file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-o&amp;lt;/b&amp;gt; &amp;lt;u&amp;gt;path&amp;lt;/u&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;The output will be to standard output unless an output file path is specified in this option. The output file should not include an extension because one will be generated automatically based on the selected file type. When multiple archive files are extracted in a single command, the output&lt;br /&gt;
files will add an index number to this specified output file name for each additional file (unless this default index number is overridden by the &amp;lt;tt&amp;gt;-s&amp;lt;/tt&amp;gt; option).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-P&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Specify to export particle data only. Because particle data export is the default assumption, this option is normally not needed. The selected quantities should be only particle properties.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-q&amp;lt;/b&amp;gt; &amp;lt;u&amp;gt;data&amp;lt;/u&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;When exporting particle data, the output always includes particle position (&amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;y&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;z&amp;lt;/tt&amp;gt; (for 3D)), but can include additional data for each &amp;lt;b&amp;gt;-q&amp;lt;/b&amp;gt; option. The allowed quantities for particle data are:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;mat&amp;lt;/tt&amp;gt; for material number&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;mass&amp;lt;/tt&amp;gt; for particle mass (in g)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;velx&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;vely&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;velz&amp;lt;/tt&amp;gt; for component of velocity vector (in mm/sec)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;dispx&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;dispy&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;dispz&amp;lt;/tt&amp;gt; for component of displacement vector (in mm)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;sxx&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;syy&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;szz&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;sxy&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;sxz&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;syz&amp;lt;/tt&amp;gt; for a component of the stress tensor (in Pa)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;pressure&amp;lt;/tt&amp;gt; for pressure (in Pa)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;vonmises&amp;lt;/tt&amp;gt; for von Mises (or equivalent) stress (= sqrt(3 J2)) (in Pa)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;exx&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;eyy&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;ezz&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;exy&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;exz&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;eyz&amp;lt;/tt&amp;gt; for a component of the strain tensor, which is elastic strain for plasticity materials (absolute)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;pexx&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;peyy&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;pezz&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;pexy&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;pexz&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;peyz&amp;lt;/tt&amp;gt; for a component of the plastic strain tensor (absolute)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;equivstrain&amp;lt;/tt&amp;gt; for equivalent strain (= sqrt(2/3)|'''s'''| where '''s''' is deviatoric strain tensor from elastic strain only) (absolute)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;strerg&amp;lt;/tt&amp;gt; for strain energy (in J)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;work&amp;lt;/tt&amp;gt; for work energy (in J)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;heat&amp;lt;/tt&amp;gt; for heat energy (in J)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;plerg&amp;lt;/tt&amp;gt; for plastic energy (in J)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;temp&amp;lt;/tt&amp;gt; for temperature (in K)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;conc&amp;lt;/tt&amp;gt; for concentration (in wt %)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;hist1&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;hist2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;hist3&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;hist4&amp;lt;/tt&amp;gt; for history variable 1 through 4&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files always include mat and can include mass; they currently cannot include stress or strain.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;When exporting crack particle data, the output always includes the crack number followed by the crack particle position (&amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;y&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;z&amp;lt;/tt&amp;gt; (for 3D)), but can include additional data for each &amp;lt;b&amp;gt;-q&amp;lt;/b&amp;gt; option. The allowed quantities for crack particle data are:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;J1 and J2 for crack tip J integral terms&lt;br /&gt;
&amp;lt;li&amp;gt;KI and KII for crack tip stress intensity factors&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files only include crack particle positions and the tip material ID (1 based) if available in the archive file; they currently cannot include J integral or stress intensity tt.&lt;br /&gt;
Any requested particle or crack quantity not in the archive file will be output as zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-s&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Include the step number in the output file name. &amp;lt;tt&amp;gt;NairnMPM&amp;lt;/tt&amp;gt; archive files should have the step number as an extension. For example, if you are extracting data to a text file with root name &amp;lt;tt&amp;gt;ParticleData&amp;lt;/tt&amp;gt; from archive file named &amp;lt;tt&amp;gt;archive.323&amp;lt;/tt&amp;gt; while using the &amp;lt;tt&amp;gt;-s&amp;lt;/tt&amp;gt; option, the extracted file name will be &amp;lt;tt&amp;gt;ParticleData_323.txt&amp;lt;/tt&amp;gt;. When extracting multiple files, inclusion of a step number will override the default index number (see &amp;lt;tt&amp;gt;-o&amp;lt;/tt&amp;gt; option). If two of the multiple files have the same step number, the second one will overwrite the first. This problem will never occur when extracting from multiple files resulting from a single simulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-T&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Output as tab-delimited text file (extension &amp;lt;tt&amp;gt;.data&amp;lt;/tt&amp;gt;). This option is the default output mode unless overridden by &amp;lt;b&amp;gt;-d&amp;lt;/b&amp;gt;, &amp;lt;b&amp;gt;-D&amp;lt;/b&amp;gt;, &amp;lt;b&amp;gt;-f&amp;lt;/b&amp;gt;, &amp;lt;b&amp;gt;-F&amp;lt;/b&amp;gt;, or &amp;lt;b&amp;gt;-X&amp;lt;/b&amp;gt; option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-V&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Output as a VTK Legacy file suitable for reading in visualization tools such as [[ParaView]]. The file will have only particle data, which may limit options in visualizations tools that need cell data. (extension &amp;lt;tt&amp;gt;.vtk&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-X&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Output an XML file, but see [[#XML File Extractions|below]] for details. These files are intended for input to new calculations. (extension &amp;lt;tt&amp;gt;.xml&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-2&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Specify the archive file as one having 2D results. Because 2D results is the default assumption, this option is normally not needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-3&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Specify the archive file as one having 3D results. Only needed&lt;br /&gt;
for &amp;lt;tt&amp;gt;ver3&amp;lt;/tt&amp;gt; archive files.  For &amp;lt;tt&amp;gt;ver4&amp;lt;/tt&amp;gt; archive files or newer it is overridden by the file format specified in the [[Archive File Formats#Archive File Header|archive file's header]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/dl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples== &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The following examples are shown as given to the shell:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dl&amp;gt;&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;tt&amp;gt;ExtractMPM -h -o positions arch.57&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Output particle positions from a &amp;lt;tt&amp;gt;ver4&amp;lt;/tt&amp;gt; or newer archive file (&amp;lt;tt&amp;gt;arch.57&amp;lt;/tt&amp;gt;) to the text file named &amp;lt;tt&amp;gt;positions.txt&amp;lt;/tt&amp;gt; with a header at the beginning of the file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;tt&amp;gt;ExtractMPM -d -b iYYYYNNNNNNNYNNNN -q syy -q szz -o str disks.78&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Output particle positions and &amp;lt;tt&amp;gt;y&amp;lt;/tt&amp;gt;- and &amp;lt;tt&amp;gt;z&amp;lt;/tt&amp;gt;-direction normal stress from a &amp;lt;tt&amp;gt;ver4&amp;lt;/tt&amp;gt; or newer archive file (disks.78) to a little Endian file of double named &amp;lt;tt&amp;gt;str.data&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;tt&amp;gt;ExtractMPM -hF -q sxx -M 1 -o strxx disks.*&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Output particle positions and &amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt;-direction normal stress from several ver4 archive files (&amp;lt;tt&amp;gt;disks.*&amp;lt;/tt&amp;gt;) to a series big Endian files of floats named&lt;br /&gt;
&amp;lt;tt&amp;gt;strxx.data&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;strxx_1.data&amp;lt;/tt&amp;gt;, &amp;lt;i&amp;gt;etc.&amp;lt;/i&amp;gt;, including headers. The output file will include only data from particles for material number 1.&lt;br /&gt;
The header will help determine which output file came from which archive file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;tt&amp;gt;ExtractMPM -hC -o cracks disks.1289&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Output crack number and crack particle particle positions from a ver4 archive file to a text file &amp;lt;tt&amp;gt;cracks.txt&amp;lt;/tt&amp;gt; including a header. The output file will include only crack particle data.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;tt&amp;gt;ExtractMPM -V -q sxx -q velx -q dispx -s -o Output archive.*&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Extract data for all &amp;quot;archive.#&amp;quot; files in the current folder and write to VTK file with name &amp;quot;Output_#.vtk&amp;quot;. These output files can be read by [[ParaView]] for an alternate method of generating [[ParaView#Particle Plots in ParaView|particle based plots]] for any extracted quantity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/dl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You only need to specify file formats (in &amp;lt;b&amp;gt;-b&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;-c&amp;lt;/b&amp;gt; options) and dimensionality (in &amp;lt;b&amp;gt;-3&amp;lt;/b&amp;gt; option) for &amp;lt;tt&amp;gt;ver3&amp;lt;/tt&amp;gt; archive files. These options will be read from the [[Archive File Formats#Archive File Header|header]] of &amp;lt;tt&amp;gt;ver4&amp;lt;/tt&amp;gt; or newer files.  The version ID of any archive file can be determined by looking at the first 4 bytes of the file. The &amp;lt;tt&amp;gt;ver4&amp;lt;/tt&amp;gt; or newer format took effect 25 OCT 2007. See  [[Archive File Formats#NairnMPM Output Files|MPM output file format]] information for more details on archive file versions.&lt;br /&gt;
&lt;br /&gt;
Since the archive file format is specified in the command, when extracting from multiple &amp;lt;tt&amp;gt;ver3&amp;lt;/tt&amp;gt; archive files in a single command, they must all have the same format. This restriction does not apply when extracting from multiple &amp;lt;tt&amp;gt;ver4&amp;lt;/tt&amp;gt; or newer files.&lt;br /&gt;
&lt;br /&gt;
== XML File Extraction To Extend Calculations ==&lt;br /&gt;
&lt;br /&gt;
The main use of &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; file extractions is to restart &amp;lt;tt&amp;gt;NairnMPM&amp;lt;/tt&amp;gt; calculations with particle results from a previous calculation. As a result, the &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; file uses a format intended for defining material points in a &amp;lt;tt&amp;gt;NairnMPM&amp;lt;/tt&amp;gt; input commands file. All material points will be in a single &amp;lt;tt&amp;gt;&amp;amp;lt;PointList&amp;amp;gt;&amp;lt;/tt&amp;gt; structure. Each material point in the structure will have the following format:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;PointList&amp;amp;gt;&lt;br /&gt;
      . . .&lt;br /&gt;
    &amp;amp;lt;mp matl='1' angle='0' thick='1' wtconc='0' temp='0'&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;pt units='mm' x='1.25' y='-11.25'/&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;vel units='mm/sec' x='0' y='0'/&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;mass m='1e-3'/&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;/mp&amp;amp;gt;&lt;br /&gt;
        . . .&lt;br /&gt;
 &amp;amp;lt;/PointList&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
The material number (&amp;lt;tt&amp;gt;matl&amp;lt;/tt&amp;gt;), material angle (&amp;lt;tt&amp;gt;angle&amp;lt;/tt&amp;gt;, if 2D), thickness (&amp;lt;tt&amp;gt;thick&amp;lt;/tt&amp;gt;, if 2D), and  position (&amp;lt;tt&amp;gt;pt&amp;lt;/tt&amp;gt; element) will always be in the extracted file. To include concentration (&amp;lt;tt&amp;gt;wtconc&amp;lt;/tt&amp;gt;) and/or temperature (&amp;lt;tt&amp;gt;temp&amp;lt;/tt&amp;gt;), use the &amp;lt;tt&amp;gt;-q conc&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;-q temp&amp;lt;/tt&amp;gt; options,  respectively. To include the velocity use the &amp;lt;tt&amp;gt;-q velx&amp;lt;/tt&amp;gt; option (which will include all components of velocity). To include mass (and you normally should) use a &amp;lt;tt&amp;gt;-q mass&amp;lt;/tt&amp;gt; option. Concentration, temperature, and velocity will only appear if they are in the archive file. All other requested quantities (including other components of velocity) will be ignored.&lt;br /&gt;
&lt;br /&gt;
If you only want certain types of material points in the new calculations, use the &amp;lt;tt&amp;gt;-m&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;-M&amp;lt;/tt&amp;gt; options to select the desired material types. You can include a header with the &amp;lt;tt&amp;gt;-h&amp;lt;/tt&amp;gt; option and it will appear at the beginning of the file in an &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; comment structure.&lt;br /&gt;
&lt;br /&gt;
Finally, you can use the extracted &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; file to define all or some of the material points in a new calculation. First, define the path to the new file in an &amp;lt;tt&amp;gt;ENTITY&amp;lt;/tt&amp;gt; element in the file's &amp;lt;tt&amp;gt;DOCTYPE&amp;lt;/tt&amp;gt; element such as:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!DOCTYPE JANFEAInput SYSTEM '/full path to/NairnMPM.dtd'&lt;br /&gt;
 [&lt;br /&gt;
   &amp;lt;!ENTITY mpfile &amp;quot;path to/pointlist.xml&amp;quot;&amp;gt;&lt;br /&gt;
 ]&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;tt&amp;gt;pointlist.xml&amp;lt;/tt&amp;gt; is the name of the newly extracted &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
Then, import that file in the &amp;lt;tt&amp;gt;&amp;amp;lt;MaterialPoints&amp;amp;gt;&amp;lt;/tt&amp;gt; element such as:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;MaterialPoints&amp;gt;&lt;br /&gt;
    &amp;amp;amp;mpfile;&lt;br /&gt;
 &amp;lt;/MaterialPoints&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In scripted files, the above can be done [[Entity Command|&amp;lt;tt&amp;gt;Entity&amp;lt;/tt&amp;gt;]] and [[XMLData Command|&amp;lt;tt&amp;gt;XMLData&amp;lt;/tt&amp;gt;]] commands.&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=ExtractMPM&amp;diff=4740</id>
		<title>ExtractMPM</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=ExtractMPM&amp;diff=4740"/>
		<updated>2016-07-06T21:16:33Z</updated>

		<summary type="html">&lt;p&gt;Chadh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The ExtractMPM tool will extract data from [[NairnMPM]] archive files and write them to text, binary or &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files. You can use your own visualization tools to work with the extracted data.&lt;br /&gt;
&lt;br /&gt;
== Compiling ExtractMPM ==&lt;br /&gt;
&lt;br /&gt;
The first step is to compile the ExtractMPM command-line tool. When using MacOS X, you can compile ExtractMPM using that target in the project found at &amp;lt;tt&amp;gt;nairn-mpm-fea/Common/Projects/NairnMPM.xcodeproj&amp;lt;/tt&amp;gt;. On any other system (or alternatively in MacOS X), you can compile using the command line&lt;br /&gt;
&lt;br /&gt;
 c++ -O3 -o ExtractMPM ExtractMPM.cpp&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;-O3&amp;lt;/tt&amp;gt; options turns on optimization. You can change the &amp;lt;tt&amp;gt;-o&amp;lt;/tt&amp;gt; path name as desired to install the executeable at any location.&lt;br /&gt;
&lt;br /&gt;
== Using Extract MPM ==&lt;br /&gt;
&lt;br /&gt;
You run the ExtractMPM command line tool on a command line with&lt;br /&gt;
&lt;br /&gt;
 ExtractMPM [-hdDfFTXVsH23PC] [-b format] [-c format] [-m num] [-M num]&lt;br /&gt;
                [-q data] [-n text] [-o path] archive0 archive1 ...&lt;br /&gt;
&lt;br /&gt;
ExtractMPM reads the [[NairnMPM]] binary archive files in &amp;lt;tt&amp;gt;archive0&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;archive1&amp;lt;/tt&amp;gt;, &amp;lt;i&amp;gt;etc.&amp;lt;/i&amp;gt;, extracts the data selected by the options, and outputs it all to standard output or to file(s) specified in the options.The flags and their descriptions, in alphabetical order, are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-b&amp;lt;/b&amp;gt; &amp;lt;u&amp;gt;format&amp;lt;/u&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Specify the archive &amp;lt;u&amp;gt;format&amp;lt;/u&amp;gt; of the file. Only needed for ver3 archive files.  For ver4 archive files or newer it is overridden by the file format specified in the [[Archive File Formats#Archive File Header|archive file's header]]. See [[Archive File Formats#NairnMPM Output Files|MPM output file format]] information for more details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-c&amp;lt;/b&amp;gt; &amp;lt;u&amp;gt;format&amp;lt;/u&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Specify the crack archive &amp;lt;u&amp;gt;format&amp;lt;/u&amp;gt; of the file. Only needed for ver3 archive files.  For ver4 archive files or newer it is overridden by the file format specified in the [[Archive File Formats#Archive File Header|archive file's header]]. See [[Archive File Formats#NairnMPM Output Files|MPM output file format]] information for more details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-C&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Specify to export crack particle data only. The selected quantities should be only crack particle properties.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-d&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Output as little Endian binary file with double precision numbers (extension &amp;lt;tt&amp;gt;.data&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-D&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Output as big Endian binary file with double precision numbers (extension &amp;lt;tt&amp;gt;.data&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-f&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Output as little Endian binary file with single precision numbers or floats (extension &amp;lt;tt&amp;gt;.data&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-F&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Output as big Endian binary file with single precision numbers or floats (extension &amp;lt;tt&amp;gt;.data&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-h&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Include a header at the beginning of the file. The header has text that describes the content of the file. Each line begins with a key word. The text after the space is the setting for that keyword. The possible keywords are&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Name - optional text if the &amp;lt;b&amp;gt;-n&amp;lt;/b&amp;gt; options is used&lt;br /&gt;
&amp;lt;li&amp;gt;Source - name of the input archive file&lt;br /&gt;
&amp;lt;li&amp;gt;Data - space delimited list of columns in the output&lt;br /&gt;
&amp;lt;li&amp;gt;Included_Materials - space delimited list of included materials&lt;br /&gt;
&amp;lt;li&amp;gt;Excluded_Materials - space delimited list of omitted materials&lt;br /&gt;
&amp;lt;li&amp;gt;Format - format of the output numbers (&amp;lt;tt&amp;gt;text&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;xml&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;double&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;float&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&amp;lt;li&amp;gt;Endian - for binary output will be &amp;lt;tt&amp;gt;little&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;big&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;li&amp;gt;EndHeader - last line of the header&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
The header ends with the line feed character (&amp;lt;tt&amp;gt;0x0A&amp;lt;/tt&amp;gt;) after &amp;lt;tt&amp;gt;EndHeader&amp;lt;/tt&amp;gt;. For binary files, the header is padded to be a multiple of 8&lt;br /&gt;
bytes long. For VTK Legacy files, the name (if provided) and source will always be output on the second line of the file (&amp;lt;i&amp;gt;i.e&amp;lt;/i&amp;gt;, the &amp;lt;b&amp;gt;-h&amp;lt;/b&amp;gt; option is not needed).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-H&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Print synopsis of ExtractMPM with brief description of all&lt;br /&gt;
options and variables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-m&amp;lt;/b&amp;gt; &amp;lt;u&amp;gt;num&amp;lt;/u&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Omit data for particles with material number &amp;lt;u&amp;gt;num&amp;lt;/u&amp;gt;.  More than one use can remove multiple material types.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-M&amp;lt;/b&amp;gt; &amp;lt;u&amp;gt;num&amp;lt;/u&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Include data for particles with material number &amp;lt;u&amp;gt;num&amp;lt;/u&amp;gt;. More than one use can include multiple material types. If no &amp;lt;b&amp;gt;-M&amp;lt;/b&amp;gt; options are used, then all materials are included. A material that is both included and excluded, will be excluded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-n&amp;lt;/b&amp;gt; &amp;lt;u&amp;gt;text&amp;lt;/u&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;The text defines a title or any brief comment about the extracted file. It is output in the header, but only if the &amp;lt;b&amp;gt;-h&amp;lt;/b&amp;gt; option is used. For text with spaces, include it in quotes. For VTK Lagacy files it is output on the second line of the file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-o&amp;lt;/b&amp;gt; &amp;lt;u&amp;gt;path&amp;lt;/u&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;The output will be to standard output unless an output file path is specified in this option. The output file should not include an extension because one will be generated automatically based on the selected file type. When multiple archive files are extracted in a single command, the output&lt;br /&gt;
files will add an index number to this specifed output file name for each additional file (unless this default index number is overridden by the &amp;lt;tt&amp;gt;-s&amp;lt;/tt&amp;gt; option).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-P&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Specify to export particle data only. Because particle data export is the default assumption, this option is normally not needed. The selected quantities should be only particle properties.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-q&amp;lt;/b&amp;gt; &amp;lt;u&amp;gt;data&amp;lt;/u&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;When exporting particle data, the output always includes particle position (&amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;y&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;z&amp;lt;/tt&amp;gt; (for 3D)), but can include additional data for each &amp;lt;b&amp;gt;-q&amp;lt;/b&amp;gt; option. The allowed quantities for particle data are:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;mat&amp;lt;/tt&amp;gt; for material number&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;mass&amp;lt;/tt&amp;gt; for particle mass (in g)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;velx&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;vely&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;velz&amp;lt;/tt&amp;gt; for component of velocity vector (in mm/sec)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;dispx&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;dispy&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;dispz&amp;lt;/tt&amp;gt; for component of displacement vector (in mm)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;sxx&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;syy&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;szz&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;sxy&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;sxz&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;syz&amp;lt;/tt&amp;gt; for a component of the stress tensor (in Pa)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;pressure&amp;lt;/tt&amp;gt; for pressure (in Pa)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;vonmises&amp;lt;/tt&amp;gt; for von Mises (or equivalent) stress (= sqrt(3 J2)) (in Pa)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;exx&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;eyy&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;ezz&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;exy&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;exz&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;eyz&amp;lt;/tt&amp;gt; for a component of the strain tensor, which is elastic strain for plasticity materials (absolute)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;pexx&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;peyy&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;pezz&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;pexy&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;pexz&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;peyz&amp;lt;/tt&amp;gt; for a component of the plastic strain tensor (absolute)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;equivstrain&amp;lt;/tt&amp;gt; for equivalent strain (= sqrt(2/3)|'''s'''| where '''s''' is deviatoric strain tensor from elastic strain only) (absolute)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;strerg&amp;lt;/tt&amp;gt; for strain energy (in J)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;work&amp;lt;/tt&amp;gt; for work energy (in J)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;heat&amp;lt;/tt&amp;gt; for heat energy (in J)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;plerg&amp;lt;/tt&amp;gt; for plastic energy (in J)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;temp&amp;lt;/tt&amp;gt; for temperature (in K)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;conc&amp;lt;/tt&amp;gt; for concentration (in wt %)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;hist1&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;hist2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;hist3&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;hist4&amp;lt;/tt&amp;gt; for history variable 1 through 4&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files always include mat and can include mass; they currently cannot include stress or strain.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;When exporting crack particle data, the output always includes the crack number followed by the crack particle position (&amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;y&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;z&amp;lt;/tt&amp;gt; (for 3D)), but can include additional data for each &amp;lt;b&amp;gt;-q&amp;lt;/b&amp;gt; option. The allowed quantities for crack particle data are:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;J1 and J2 for crack tip J integral terms&lt;br /&gt;
&amp;lt;li&amp;gt;KI and KII for crack tip stress intensity factors&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files only include crack particle positions and the tip material ID (1 based) if available in the archive file; they currently cannot include J integral or stress intensity tt.&lt;br /&gt;
Any requested particle or crack quantity not in the archive file will be output as zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-s&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Include the step number in the output file name. &amp;lt;tt&amp;gt;NairnMPM&amp;lt;/tt&amp;gt; archive files should have the step number as an extension. For example, if you are extracting data to a text file with root name &amp;lt;tt&amp;gt;ParticleData&amp;lt;/tt&amp;gt; from archive file named &amp;lt;tt&amp;gt;archive.323&amp;lt;/tt&amp;gt; while using the &amp;lt;tt&amp;gt;-s&amp;lt;/tt&amp;gt; option, the extracted file name will be &amp;lt;tt&amp;gt;ParticleData_323.txt&amp;lt;/tt&amp;gt;. When extracting multiple files, inclusion of a step number will overide the default index number (see &amp;lt;tt&amp;gt;-o&amp;lt;/tt&amp;gt; option). If two of the multiple files have the same step number, the second one will overwrite the first. This problem will never occur when extracting from multiple files resulting from a single simulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-T&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Output as tab-delimited text file (extension &amp;lt;tt&amp;gt;.data&amp;lt;/tt&amp;gt;). This option is the default output mode unless overridden by &amp;lt;b&amp;gt;-d&amp;lt;/b&amp;gt;, &amp;lt;b&amp;gt;-D&amp;lt;/b&amp;gt;, &amp;lt;b&amp;gt;-f&amp;lt;/b&amp;gt;, &amp;lt;b&amp;gt;-F&amp;lt;/b&amp;gt;, or &amp;lt;b&amp;gt;-X&amp;lt;/b&amp;gt; option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-V&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Output as a VTK Legacy file suitable for reading in visualization tools such as [[ParaView]]. The file will have only particle data, which may limit options in visualizations tools that need cell data. (extension &amp;lt;tt&amp;gt;.vtk&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-X&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Output an XML file, but see [[#XML File Extractions|below]] for details. These files are intended for input to new calculations. (extension &amp;lt;tt&amp;gt;.xml&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-2&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Specify the archive file as one having 2D results. Because 2D results is the default assumption, this option is normally not needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;-3&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Specify the archive file as one having 3D results. Only needed&lt;br /&gt;
for &amp;lt;tt&amp;gt;ver3&amp;lt;/tt&amp;gt; archive files.  For &amp;lt;tt&amp;gt;ver4&amp;lt;/tt&amp;gt; archive files or newer it is overridden by the file format specified in the [[Archive File Formats#Archive File Header|archive file's header]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/dl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples== &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The following examples are shown as given to the shell:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dl&amp;gt;&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;tt&amp;gt;ExtractMPM -h -o positions arch.57&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Output particle positions from a &amp;lt;tt&amp;gt;ver4&amp;lt;/tt&amp;gt; or newer archive file (&amp;lt;tt&amp;gt;arch.57&amp;lt;/tt&amp;gt;) to the text file named &amp;lt;tt&amp;gt;positions.txt&amp;lt;/tt&amp;gt; with a header at the beginning of the file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;tt&amp;gt;ExtractMPM -d -b iYYYYNNNNNNNYNNNN -q syy -q szz -o str disks.78&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Output particle positions and &amp;lt;tt&amp;gt;y&amp;lt;/tt&amp;gt;- and &amp;lt;tt&amp;gt;z&amp;lt;/tt&amp;gt;-direction normal stress from a &amp;lt;tt&amp;gt;ver4&amp;lt;/tt&amp;gt; or newer archive file (disks.78) to a little Endian file of double named &amp;lt;tt&amp;gt;str.data&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;tt&amp;gt;ExtractMPM -hF -q sxx -M 1 -o strxx disks.*&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Output particle positions and &amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt;-direction normal stress from several ver4 archive files (&amp;lt;tt&amp;gt;disks.*&amp;lt;/tt&amp;gt;) to a series big Endian files of floats named&lt;br /&gt;
&amp;lt;tt&amp;gt;strxx.data&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;strxx_1.data&amp;lt;/tt&amp;gt;, &amp;lt;i&amp;gt;etc.&amp;lt;/i&amp;gt;, including headers. The output file will include only data from particles for material number 1.&lt;br /&gt;
The header will help determine which output file came from which archive file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;tt&amp;gt;ExtractMPM -hC -o cracks disks.1289&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Output crack number and crack particle particle positions from a ver4 archive file to a text file &amp;lt;tt&amp;gt;cracks.txt&amp;lt;/tt&amp;gt; including a header. The output file will include only crack particle data.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;&amp;lt;tt&amp;gt;ExtractMPM -V -q sxx -q velx -q dispx -s -o Output archive.*&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;Extract data for all &amp;quot;archive.#&amp;quot; files in the current folder and write to VTK file with name &amp;quot;Output_#.vtk&amp;quot;. These output files can be read by [[ParaView]] for an alternate method of generating [[ParaView#Particle Plots in ParaView|particle based plots]] for any extracted quantity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/dl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You only need to specify file formats (in &amp;lt;b&amp;gt;-b&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;-c&amp;lt;/b&amp;gt; options) and dimensionality (in &amp;lt;b&amp;gt;-3&amp;lt;/b&amp;gt; option) for &amp;lt;tt&amp;gt;ver3&amp;lt;/tt&amp;gt; archive files. These options will be read from the [[Archive File Formats#Archive File Header|header]] of &amp;lt;tt&amp;gt;ver4&amp;lt;/tt&amp;gt; or newer files.  The version ID of any archive file can be determined by looking at the first 4 bytes of the file. The &amp;lt;tt&amp;gt;ver4&amp;lt;/tt&amp;gt; or newer format took effect 25 OCT 2007. See  [[Archive File Formats#NairnMPM Output Files|MPM output file format]] information for more details on archive file versions.&lt;br /&gt;
&lt;br /&gt;
Since the archive file format is specified in the command, when extracting from multiple &amp;lt;tt&amp;gt;ver3&amp;lt;/tt&amp;gt; archive files in a single command, they must all have the same format. This restriction does not apply when extracting from multiple &amp;lt;tt&amp;gt;ver4&amp;lt;/tt&amp;gt; or newer files.&lt;br /&gt;
&lt;br /&gt;
== XML File Extraction To Extend Calculations ==&lt;br /&gt;
&lt;br /&gt;
The main use of &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; file extractions is to restart &amp;lt;tt&amp;gt;NairnMPM&amp;lt;/tt&amp;gt; calculations with particle results from a previous calculation. As a result, the &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; file uses a format intended for defining material points in a &amp;lt;tt&amp;gt;NairnMPM&amp;lt;/tt&amp;gt; input commands file. All material points will be in a single &amp;lt;tt&amp;gt;&amp;amp;lt;PointList&amp;amp;gt;&amp;lt;/tt&amp;gt; structure. Each material point in the structure will have the following format:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;PointList&amp;amp;gt;&lt;br /&gt;
      . . .&lt;br /&gt;
    &amp;amp;lt;mp matl='1' angle='0' thick='1' wtconc='0' temp='0'&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;pt units='mm' x='1.25' y='-11.25'/&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;vel units='mm/sec' x='0' y='0'/&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;mass m='1e-3'/&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;/mp&amp;amp;gt;&lt;br /&gt;
        . . .&lt;br /&gt;
 &amp;amp;lt;/PointList&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
The material number (&amp;lt;tt&amp;gt;matl&amp;lt;/tt&amp;gt;), material angle (&amp;lt;tt&amp;gt;angle&amp;lt;/tt&amp;gt;, if 2D), thickness (&amp;lt;tt&amp;gt;thick&amp;lt;/tt&amp;gt;, if 2D), and  position (&amp;lt;tt&amp;gt;pt&amp;lt;/tt&amp;gt; element) will always be in the extracted file. To include concentration (&amp;lt;tt&amp;gt;wtconc&amp;lt;/tt&amp;gt;) and/or temperature (&amp;lt;tt&amp;gt;temp&amp;lt;/tt&amp;gt;), use the &amp;lt;tt&amp;gt;-q conc&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;-q temp&amp;lt;/tt&amp;gt; options,  respectively. To include the velocity use the &amp;lt;tt&amp;gt;-q velx&amp;lt;/tt&amp;gt; option (which will include all components of velocity). To include mass (and you normally should) use a &amp;lt;tt&amp;gt;-q mass&amp;lt;/tt&amp;gt; option. Concentration, temperature, and velocity will only appear if they are in the archive file. All other requested quantities (including other components of velocity) will be ignored.&lt;br /&gt;
&lt;br /&gt;
If you only want certain types of material points in the new calculations, use the &amp;lt;tt&amp;gt;-m&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;-M&amp;lt;/tt&amp;gt; options to select the desired material types. You can include a header with the &amp;lt;tt&amp;gt;-h&amp;lt;/tt&amp;gt; option and it will appear at the beginning of the file in an &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; comment structure.&lt;br /&gt;
&lt;br /&gt;
Finally, you can use the extracted &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; file to define all or some of the material points in a new calculation. First, define the path to the new file in an &amp;lt;tt&amp;gt;ENTITY&amp;lt;/tt&amp;gt; element in the file's &amp;lt;tt&amp;gt;DOCTYPE&amp;lt;/tt&amp;gt; element such as:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!DOCTYPE JANFEAInput SYSTEM '/full path to/NairnMPM.dtd'&lt;br /&gt;
 [&lt;br /&gt;
   &amp;lt;!ENTITY mpfile &amp;quot;path to/pointlist.xml&amp;quot;&amp;gt;&lt;br /&gt;
 ]&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;tt&amp;gt;pointlist.xml&amp;lt;/tt&amp;gt; is the name of the newly extracted &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
Then, import that file in the &amp;lt;tt&amp;gt;&amp;amp;lt;MaterialPoints&amp;amp;gt;&amp;lt;/tt&amp;gt; element such as:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;MaterialPoints&amp;gt;&lt;br /&gt;
    &amp;amp;amp;mpfile;&lt;br /&gt;
 &amp;lt;/MaterialPoints&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In scripted files, the above can be done [[Entity Command|&amp;lt;tt&amp;gt;Entity&amp;lt;/tt&amp;gt;]] and [[XMLData Command|&amp;lt;tt&amp;gt;XMLData&amp;lt;/tt&amp;gt;]] commands.&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4702</id>
		<title>LoadControl Custom Task</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4702"/>
		<updated>2016-05-06T05:12:10Z</updated>

		<summary type="html">&lt;p&gt;Chadh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[MPM Input Files#Custom Tasks|custom task]] run a load control simulation based on calculations contact or reaction forces. .&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task needs either [[MPM Global Archiving Options|global contact]] or [[MPM Global Archiving Options|global reaction]] for the specified [[Rigid Material|Rigid material]] depending on if contact for that material is enabled.&lt;br /&gt;
&lt;br /&gt;
This CustomTask tries to achieve the load requested from a provided [[User Defined Functions|user defined function]] by adjusting the velocity of that material. It does that by dynamically estimating the relationship between the displacement and load and then uses a PID control algorithm to adjust the velocity.&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
&lt;br /&gt;
This custom task tries to dynamically estimate the relationship between load and displacement of the rigid material using the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt;A_t = \text{arg}\min_{A}  \left[ \alpha \frac{(L-Ax)^2}{0.5(L^2+(A_{t-1}x)^2)}+(1-\alpha)\frac{(A-A_{t-1})^2}{A_{t-1}^2}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;A_t&amp;lt;/math&amp;gt; is the  estimate the relationship between load and displacement at time ''t'', ''x'' is the displacement, ''L'' is the recorded load and &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; is the &amp;lt;tt&amp;gt;smooth&amp;lt;/tt&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
This gives:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt;A_t =\frac{\lambda L x + \gamma A_{t-1}}{\lambda x^2 +\gamma}&amp;lt;/math&amp;gt;  &amp;amp;nbsp;&amp;amp;nbsp;where&amp;amp;nbsp;&amp;amp;nbsp;   &amp;lt;math&amp;gt;\lambda =\frac{2(1-\alpha)}{L^2+(A_{t-1}x)^2}&amp;lt;/math&amp;gt;  &amp;amp;nbsp;&amp;amp;nbsp;and&amp;amp;nbsp;&amp;amp;nbsp;  &amp;lt;math&amp;gt;\gamma =\frac{\alpha}{A_{t-1}^2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then the error between requested load ''L(t)'' and recorded load ''L'' is smoothed and converted to velocity as:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt;e_t =(1-\alpha)\frac{L(t)-L}{A_t}+\alpha e_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrated error is calculated as:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt;Ie_t =\frac{L(t)-L}{A_t}+ Ie_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The derivative error is calculated with Brown's double exponential smoothing as:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt; e{\scriptstyle 2}_t =(1-\alpha)e_t+ \alpha e{\scriptstyle 2}_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt; De_t = \frac{1-\alpha}{\alpha}(e_t-e{\scriptstyle 2}_t) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then finally the velocity is set using the PID algorithm:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;math&amp;gt;V_t  = K_p e_t + K_i Ie_t + 0.25K_i De_t&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: If the velocity has a magnitude larger than &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; than it is given that magnitude and the integrated error for that time step is not accrued.&lt;br /&gt;
&lt;br /&gt;
== Task Scheduling ==&lt;br /&gt;
&lt;br /&gt;
In scripted files, a &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task is scheduled with the following block:&lt;br /&gt;
&lt;br /&gt;
 CustomTask LoadControl&lt;br /&gt;
 Parameter velocity,(velocity)&lt;br /&gt;
 Parameter material,(int)&lt;br /&gt;
 Parameter direction,(int)&lt;br /&gt;
 Parameter MaxVelocity,(number)&lt;br /&gt;
 Parameter &amp;quot;Load_Function (user-inputted function)&amp;quot;&lt;br /&gt;
 Parameter Kp,(number)&lt;br /&gt;
 Parameter Ki,(number)&lt;br /&gt;
 Parameter smooth,(number)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, these task options are scheduled using &amp;lt;tt&amp;gt;&amp;lt;Schedule&amp;gt;&amp;lt;/tt&amp;gt; elements, which must be within the single &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Schedule name='LoadControl'&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='velocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='material'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='direction'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='MaxVelocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Load_Function (function)'/&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Kp'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Ki'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='smooth'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are the parameters that this custom task needs to operate:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;velocity&amp;lt;/tt&amp;gt; - This is the starting velocity of the simulation for the specified  [[Rigid Material|Rigid material]]. The sign of this parameter is probably more important than its value, as long as it is something reasonable. It is needed for initializing the load control.&lt;br /&gt;
* &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt; - The material number of the [[Rigid Material|Rigid material]] to be controlled.&lt;br /&gt;
* &amp;lt;tt&amp;gt;direction&amp;lt;/tt&amp;gt; - An integer (1, 2, or 3) to choose the direction (x, y, or z) to contrtol for velocity and load.&lt;br /&gt;
* &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; - A positive number that limits the magnitude of the velocity of the controlled material - defaults to 5 m/s.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Load_Function&amp;lt;/tt&amp;gt; - A [[User Defined Functions|user defined function]] that gives the desired load. This task doesn't work well with discontinuous functions. Note that the function is provided in the &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; of the parameter as a single string. The first word of the string must be &amp;quot;Load_Function&amp;quot; and the remainder of the name is the [[User Defined Functions|user defined function]].&lt;br /&gt;
&lt;br /&gt;
These following parameters are for the control algorithm. The provided default parameters seem to work well, but each can be changed if needed.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;Kp&amp;lt;/tt&amp;gt; - Proportional gain factor for PID algorithm (default 0.1).&lt;br /&gt;
* &amp;lt;tt&amp;gt;Ki&amp;lt;/tt&amp;gt; - Integral and Derivative gain factors for PID algorithm. (Note: &amp;lt;tt&amp;gt;Kd = 0.25Ki&amp;lt;/tt&amp;gt;) (default 0.001).&lt;br /&gt;
* &amp;lt;tt&amp;gt;smooth&amp;lt;/tt&amp;gt; - Exponential smoothing parameter in the range (0,1). Controls how fast the dynamic relationship between distance and load is updated and also how much smoothing is done on the load values (default 0.95).&lt;br /&gt;
&lt;br /&gt;
== To be developed ==&lt;br /&gt;
Contact forces are corrupted with fat tail noise. A median filter would help reduce the effect of this noise.&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4673</id>
		<title>LoadControl Custom Task</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4673"/>
		<updated>2016-04-27T02:41:06Z</updated>

		<summary type="html">&lt;p&gt;Chadh: /* Theory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[MPM Input Files#Custom Tasks|custom task]] run a load control simulation based on calculations contact or reaction forces. .&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task needs either [[MPM Global Archiving Options|global contact]] or [[MPM Global Archiving Options|global reaction]] for the specified [[Rigid Material|Rigid material]] depending on if contact for that material is enabled.&lt;br /&gt;
&lt;br /&gt;
This CustomTask tries to achieve the load requested from the [[User Defined Functions|user defined function]] by adjusting the velocity of that material. It does that by dynamically estimating the relationship between the displacement and load and then uses a PID control algorithm to adjust the velocity.&lt;br /&gt;
&lt;br /&gt;
== Task Scheduling ==&lt;br /&gt;
&lt;br /&gt;
In scripted files, a &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task is scheduled with the following block:&lt;br /&gt;
&lt;br /&gt;
 CustomTask LoadControl&lt;br /&gt;
 Parameter velocity, (velocity)&lt;br /&gt;
 Parameter material, (int)&lt;br /&gt;
 Parameter direction, (int)&lt;br /&gt;
 Parameter MaxVelocity,(number)&lt;br /&gt;
 Parameter Load_Function (user-inputted function)&lt;br /&gt;
 Parameter Kp,(number)&lt;br /&gt;
 Parameter Ki,(number)&lt;br /&gt;
 Parameter smooth,(number)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, these task options are scheduled using &amp;lt;tt&amp;gt;&amp;lt;Schedule&amp;gt;&amp;lt;/tt&amp;gt; elements, which must be within the single &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Schedule name='LoadControl'&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='velocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='material'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='direction'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='MaxVelocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Load_Function (function)'/&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Kp'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Ki'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='smooth'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are the parameters that this custom task needs to operate:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;velocity&amp;lt;/tt&amp;gt; - This is the starting velocity of the simulation for the specified  [[Rigid Material|Rigid material]]. The sign of this parameter is probably more important than its value, as long as it is something reasonable. It is needed for initializing the load control.&lt;br /&gt;
* &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt; - The material number of the [[Rigid Material|Rigid material]] to be controlled.&lt;br /&gt;
* &amp;lt;tt&amp;gt;direction&amp;lt;/tt&amp;gt; - An integer [1,2,3] to choose the direction to consider for velocity and load.&lt;br /&gt;
* &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; - A positive number that limits the magnitude of the velocity of the controlled material - defaults to 5 m/s.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Load_Function&amp;lt;/tt&amp;gt; - A [[User Defined Functions|user defined function]] that gives the desired load. This task doesn't work well with discontinuous functions.&lt;br /&gt;
&lt;br /&gt;
These parameters are for the control algorithm :&lt;br /&gt;
* &amp;lt;tt&amp;gt;Kp&amp;lt;/tt&amp;gt; - Proportional gain factor for PID algorithm. The default value of 0.1 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Ki&amp;lt;/tt&amp;gt; - Integral and Derivative gain factors for PID algorithm. (Note: &amp;lt;tt&amp;gt;Kd = 0.25Ki&amp;lt;/tt&amp;gt;) The default value of 0.001 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;smooth&amp;lt;/tt&amp;gt; - Exponential smoothing parameter in (0,1). Controls how fast the dynamic relationship between distance and load is updated and also how much smoothing is done on the load values. The default value of 0.95 works well.&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
&lt;br /&gt;
This custom task tries to dynamically estimate the relationship between load and displacement of the rigid material using the following equation:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;math&amp;gt;K_t = \text{arg}\min_{K}  \left[ \alpha \frac{(L-Kx)^2}{0.5(L^2+(K_{t-1}x)^2)}+(1-\alpha)\frac{(K-K_{t-1})^2}{K_{t-1}^2}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;K_t&amp;lt;/math&amp;gt; is the  estimate the relationship between load and displacement at time ''t'', ''x'' is the displacement, ''L'' is the recorded load and &amp;lt;math&amp;gt;\alpha = smooth&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This gives:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;math&amp;gt;K_t =\frac{\lambda L x + \gamma K_{t-1}}{\lambda x^2 +\gamma}&amp;lt;/math&amp;gt;  where   &amp;lt;math&amp;gt;\lambda =\frac{2(1-\alpha)}{L^2+(K_{t-1}x)^2}&amp;lt;/math&amp;gt;  and  &amp;lt;math&amp;gt;\gamma =\frac{\alpha}{K_{t-1}^2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then the error between requested load ''L(t)'' and recorded load ''L'' is smoothed and converted to velocity as:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;math&amp;gt;e_t =(1-\alpha)\frac{L(t)-L}{K_t}+\alpha e_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrated error is calculated as:&lt;br /&gt;
 &amp;lt;math&amp;gt;Ie_t =\frac{L(t)-L}{K_t}+ Ie_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative error is calculated with Brown's double exponential smoothing as:&lt;br /&gt;
 &amp;lt;math&amp;gt; e{\scriptstyle 2}_t =(1-\alpha)e_t+ \alpha e{\scriptstyle 2}_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
 &amp;lt;math&amp;gt; De_t = \frac{1-\alpha}{\alpha}(e_t-e{\scriptstyle 2}_t) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then finally the velocity is set using the PID algorithm:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;math&amp;gt;V_t  = K_p e_t + K_i Ie_t + 0.25K_i De_t&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: If the velocity has a magnitude larger than &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; than it is given that magnitude and the integrated error for that time step is not accrued.&lt;br /&gt;
&lt;br /&gt;
== To be developed ==&lt;br /&gt;
Contact forces are corrupted with fat tail noise. A median filter would help reduce the effect of this noise.&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4672</id>
		<title>LoadControl Custom Task</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4672"/>
		<updated>2016-04-27T02:32:42Z</updated>

		<summary type="html">&lt;p&gt;Chadh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[MPM Input Files#Custom Tasks|custom task]] run a load control simulation based on calculations contact or reaction forces. .&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task needs either [[MPM Global Archiving Options|global contact]] or [[MPM Global Archiving Options|global reaction]] for the specified [[Rigid Material|Rigid material]] depending on if contact for that material is enabled.&lt;br /&gt;
&lt;br /&gt;
This CustomTask tries to achieve the load requested from the [[User Defined Functions|user defined function]] by adjusting the velocity of that material. It does that by dynamically estimating the relationship between the displacement and load and then uses a PID control algorithm to adjust the velocity.&lt;br /&gt;
&lt;br /&gt;
== Task Scheduling ==&lt;br /&gt;
&lt;br /&gt;
In scripted files, a &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task is scheduled with the following block:&lt;br /&gt;
&lt;br /&gt;
 CustomTask LoadControl&lt;br /&gt;
 Parameter velocity, (velocity)&lt;br /&gt;
 Parameter material, (int)&lt;br /&gt;
 Parameter direction, (int)&lt;br /&gt;
 Parameter MaxVelocity,(number)&lt;br /&gt;
 Parameter Load_Function (user-inputted function)&lt;br /&gt;
 Parameter Kp,(number)&lt;br /&gt;
 Parameter Ki,(number)&lt;br /&gt;
 Parameter smooth,(number)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, these task options are scheduled using &amp;lt;tt&amp;gt;&amp;lt;Schedule&amp;gt;&amp;lt;/tt&amp;gt; elements, which must be within the single &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Schedule name='LoadControl'&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='velocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='material'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='direction'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='MaxVelocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Load_Function (function)'/&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Kp'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Ki'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='smooth'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are the parameters that this custom task needs to operate:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;velocity&amp;lt;/tt&amp;gt; - This is the starting velocity of the simulation for the specified  [[Rigid Material|Rigid material]]. The sign of this parameter is probably more important than its value, as long as it is something reasonable. It is needed for initializing the load control.&lt;br /&gt;
* &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt; - The material number of the [[Rigid Material|Rigid material]] to be controlled.&lt;br /&gt;
* &amp;lt;tt&amp;gt;direction&amp;lt;/tt&amp;gt; - An integer [1,2,3] to choose the direction to consider for velocity and load.&lt;br /&gt;
* &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; - A positive number that limits the magnitude of the velocity of the controlled material - defaults to 5 m/s.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Load_Function&amp;lt;/tt&amp;gt; - A [[User Defined Functions|user defined function]] that gives the desired load. This task doesn't work well with discontinuous functions.&lt;br /&gt;
&lt;br /&gt;
These parameters are for the control algorithm :&lt;br /&gt;
* &amp;lt;tt&amp;gt;Kp&amp;lt;/tt&amp;gt; - Proportional gain factor for PID algorithm. The default value of 0.1 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Ki&amp;lt;/tt&amp;gt; - Integral and Derivative gain factors for PID algorithm. (Note: &amp;lt;tt&amp;gt;Kd = 0.25Ki&amp;lt;/tt&amp;gt;) The default value of 0.001 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;smooth&amp;lt;/tt&amp;gt; - Exponential smoothing parameter in (0,1). Controls how fast the dynamic relationship between distance and load is updated and also how much smoothing is done on the load values. The default value of 0.95 works well.&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
&lt;br /&gt;
This custom task tries to dynamically estimate the relationship between load and displacement of the rigid material using the following equation:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;math&amp;gt;K_t = \text{arg}\min_{K}  \left[ \alpha \frac{(L-Kx)^2}{0.5(L^2+(K_{t-1}x)^2)}+(1-\alpha)\frac{(K-K_{t-1})^2}{K_{t-1}^2}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;K_t&amp;lt;/math&amp;gt; is the  estimate the relationship between load and displacement at time ''t'', ''x'' is the displacement, ''L'' is the recorded load and &amp;lt;math&amp;gt;\alpha = smooth&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This gives:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;math&amp;gt;K_t =\frac{\lambda L x + \gamma K_{t-1}}{\lambda x^2 +\gamma}&amp;lt;/math&amp;gt;  where   &amp;lt;math&amp;gt;\lambda =\frac{2(1-\alpha)}{L^2+(K_{t-1}x)^2}&amp;lt;/math&amp;gt;  and  &amp;lt;math&amp;gt;\gamma =\frac{\alpha}{K_{t-1}^2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then the error between requested load ''L(t)'' and recorded load ''L'' is smoothed and converted to velocity as:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;math&amp;gt;e_t =(1-\alpha)\frac{L(t)-L}{K_t}+\alpha e_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrated error is calculated as:&lt;br /&gt;
 &amp;lt;math&amp;gt;Ie_t =\frac{L(t)-L}{K_t}+ Ie_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative error is calculated with Brown's double exponential smoothing as:&lt;br /&gt;
 &amp;lt;math&amp;gt;e2_t =(1-\alpha)e_t+ \alpha e2_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
 &amp;lt;math&amp;gt; De_t = \frac{1-\alpha}{\alpha}(e_t-e2_t) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then finally the velocity is set using the PID algorithm:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;math&amp;gt;V_t  = K_p e_t + K_i Ie_t + 0.25K_i De_t&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: If the velocity has a magnitude larger than &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; than it is given that magnitude and the integrated error for that time step is not accrued.&lt;br /&gt;
&lt;br /&gt;
== To be developed ==&lt;br /&gt;
Contact forces are corrupted with fat tail noise. A median filter would help reduce the effect of this noise.&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4671</id>
		<title>LoadControl Custom Task</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4671"/>
		<updated>2016-04-27T02:30:03Z</updated>

		<summary type="html">&lt;p&gt;Chadh: /* Control Theory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[MPM Input Files#Custom Tasks|custom task]] run a load control simulation based on calculations contact or reaction forces. .&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task needs either [[MPM Global Archiving Options|global contact]] or [[MPM Global Archiving Options|global reaction]] for the specified [[Rigid Material|Rigid material]] depending on if contact for that material is enabled.&lt;br /&gt;
&lt;br /&gt;
This CustomTask tries to achieve the load requested from the [[User Defined Functions|user defined function]] by adjusting the velocity of that material. It does that by dynamically estimating the relationship between the displacement and load and then uses a PID control algorithm to adjust the velocity.&lt;br /&gt;
&lt;br /&gt;
== Task Scheduling ==&lt;br /&gt;
&lt;br /&gt;
In scripted files, a &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task is scheduled with the following block:&lt;br /&gt;
&lt;br /&gt;
 CustomTask LoadControl&lt;br /&gt;
 Parameter velocity, (velocity)&lt;br /&gt;
 Parameter material, (int)&lt;br /&gt;
 Parameter direction, (int)&lt;br /&gt;
 Parameter MaxVelocity,(number)&lt;br /&gt;
 Parameter Load_Function (user-inputted function)&lt;br /&gt;
 Parameter Kp,(number)&lt;br /&gt;
 Parameter Ki,(number)&lt;br /&gt;
 Parameter smooth,(number)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, these task options are scheduled using &amp;lt;tt&amp;gt;&amp;lt;Schedule&amp;gt;&amp;lt;/tt&amp;gt; elements, which must be within the single &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Schedule name='LoadControl'&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='velocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='material'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='direction'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='MaxVelocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Load_Function (function)'/&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Kp'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Ki'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='smooth'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are the parameters that this custom task needs to operate:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;velocity&amp;lt;/tt&amp;gt; - This is the starting velocity of the simulation for the specified  [[Rigid Material|Rigid material]]. The sign of this parameter is probably more important than its value, as long as it is something reasonable. It is needed for initializing the load control.&lt;br /&gt;
* &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt; - The material number of the [[Rigid Material|Rigid material]] to be controlled.&lt;br /&gt;
* &amp;lt;tt&amp;gt;direction&amp;lt;/tt&amp;gt; - An integer [1,2,3] to choose the direction to consider for velocity and load.&lt;br /&gt;
* &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; - A positive number that limits the velocity of the controlled material - defaults to 5 m/s.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Load_Function&amp;lt;/tt&amp;gt; - A [[User Defined Functions|user defined function]] that gives the desired load. This task doesn't work well with discontinuous functions.&lt;br /&gt;
&lt;br /&gt;
These parameters are for the control algorithm :&lt;br /&gt;
* &amp;lt;tt&amp;gt;Kp&amp;lt;/tt&amp;gt; - Proportional gain factor for PID algorithm. The default value of 0.1 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Ki&amp;lt;/tt&amp;gt; - Integral and Derivative gain factors for PID algorithm. (Note: &amp;lt;tt&amp;gt;Kd = 0.25Ki&amp;lt;/tt&amp;gt;) The default value of 0.001 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;smooth&amp;lt;/tt&amp;gt; - Exponential smoothing parameter in (0,1). Controls how fast the dynamic relationship between distance and load is updated and also how much smoothing is done on the load values. The default value of 0.95 works well.&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
&lt;br /&gt;
This custom task tries to dynamically estimate the relationship between load and displacement of the rigid material using the following equation:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;math&amp;gt;K_t = \text{arg}\min_{K}  \left[ \alpha \frac{(L-Kx)^2}{0.5(L^2+(K_{t-1}x)^2)}+(1-\alpha)\frac{(K-K_{t-1})^2}{K_{t-1}^2}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;K_t&amp;lt;/math&amp;gt; is the  estimate the relationship between load and displacement at time ''t'', ''x'' is the displacement, ''L'' is the recorded load and &amp;lt;math&amp;gt;\alpha = smooth&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This gives:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;math&amp;gt;K_t =\frac{\lambda L x + \gamma K_{t-1}}{\lambda x^2 +\gamma}&amp;lt;/math&amp;gt;  where   &amp;lt;math&amp;gt;\lambda =\frac{2(1-\alpha)}{L^2+(K_{t-1}x)^2}&amp;lt;/math&amp;gt;  and  &amp;lt;math&amp;gt;\gamma =\frac{\alpha}{K_{t-1}^2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then the error between requested load ''L(t)'' and recorded load ''L'' is smoothed and converted to velocity as:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;math&amp;gt;e_t =(1-\alpha)\frac{L(t)-L}{K_t}+\alpha e_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrated error is calculated as:&lt;br /&gt;
 &amp;lt;math&amp;gt;Ie_t =\frac{L(t)-L}{K_t}+ Ie_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative error is calculated with Brown's double exponential smoothing as:&lt;br /&gt;
 &amp;lt;math&amp;gt;e2_t =(1-\alpha)e_t+ \alpha e2_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
 &amp;lt;math&amp;gt; De_t = \frac{1-\alpha}{\alpha}(e_t-e2_t) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then finally the velocity is set using the PID algorithm:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;math&amp;gt;V_t  = K_p e_t + K_i Ie_t + 0.25K_i De_t&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: If the velocity has a magnitude larger than &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; than it is given that magnitude and the integrated error for that time step is not accrued.&lt;br /&gt;
&lt;br /&gt;
== To be developed ==&lt;br /&gt;
Contact forces are corrupted with fat tail noise. A median filter would help reduce the effect of this noise.&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4670</id>
		<title>LoadControl Custom Task</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4670"/>
		<updated>2016-04-27T00:26:47Z</updated>

		<summary type="html">&lt;p&gt;Chadh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[MPM Input Files#Custom Tasks|custom task]] run a load control simulation based on calculations contact or reaction forces. .&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task needs either [[MPM Global Archiving Options|global contact]] or [[MPM Global Archiving Options|global reaction]] for the specified [[Rigid Material|Rigid material]] depending on if contact for that material is enabled.&lt;br /&gt;
&lt;br /&gt;
This CustomTask tries to achieve the load requested from the [[User Defined Functions|user defined function]] by adjusting the velocity of that material. It does that by dynamically estimating the relationship between the displacement and load and then uses a PID control algorithm to adjust the velocity.&lt;br /&gt;
&lt;br /&gt;
== Task Scheduling ==&lt;br /&gt;
&lt;br /&gt;
In scripted files, a &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task is scheduled with the following block:&lt;br /&gt;
&lt;br /&gt;
 CustomTask LoadControl&lt;br /&gt;
 Parameter velocity, (velocity)&lt;br /&gt;
 Parameter material, (int)&lt;br /&gt;
 Parameter direction, (int)&lt;br /&gt;
 Parameter MaxVelocity,(number)&lt;br /&gt;
 Parameter Load_Function (user-inputted function)&lt;br /&gt;
 Parameter Kp,(number)&lt;br /&gt;
 Parameter Ki,(number)&lt;br /&gt;
 Parameter smooth,(number)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, these task options are scheduled using &amp;lt;tt&amp;gt;&amp;lt;Schedule&amp;gt;&amp;lt;/tt&amp;gt; elements, which must be within the single &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Schedule name='LoadControl'&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='velocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='material'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='direction'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='MaxVelocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Load_Function (function)'/&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Kp'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Ki'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='smooth'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are the parameters that this custom task needs to operate:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;velocity&amp;lt;/tt&amp;gt; - This is the starting velocity of the simulation for the specified  [[Rigid Material|Rigid material]]. The sign of this parameter is probably more important than its value, as long as it is something reasonable. It is needed for initializing the load control.&lt;br /&gt;
* &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt; - The material number of the [[Rigid Material|Rigid material]] to be controlled.&lt;br /&gt;
* &amp;lt;tt&amp;gt;direction&amp;lt;/tt&amp;gt; - An integer [1,2,3] to choose the direction to consider for velocity and load.&lt;br /&gt;
* &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; - A positive number that limits the velocity of the controlled material - defaults to 5 m/s.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Load_Function&amp;lt;/tt&amp;gt; - A [[User Defined Functions|user defined function]] that gives the desired load. This task doesn't work well with discontinuous functions.&lt;br /&gt;
&lt;br /&gt;
These parameters are for the control algorithm :&lt;br /&gt;
* &amp;lt;tt&amp;gt;Kp&amp;lt;/tt&amp;gt; - Proportional gain factor for PID algorithm. The default value of 0.1 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Ki&amp;lt;/tt&amp;gt; - Integral and Derivative gain factors for PID algorithm. (Note: &amp;lt;tt&amp;gt;Kd = 0.25Ki&amp;lt;/tt&amp;gt;) The default value of 0.001 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;smooth&amp;lt;/tt&amp;gt; - Exponential smoothing parameter in (0,1). Controls how fast the dynamic relationship between distance and load is updated and also how much smoothing is done on the load values. The default value of 0.95 works well.&lt;br /&gt;
&lt;br /&gt;
== Control Theory ==&lt;br /&gt;
&lt;br /&gt;
This custom task tries to dynamically estimate the relationship between load and displacement of the rigid material using the following equation:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;math&amp;gt;K_t = \text{arg}\min_{K}  \left[ \alpha \frac{(L-Kx)^2}{0.5(L^2+(K_{t-1}x)^2)}+(1-\alpha)\frac{(K-K_{t-1})^2}{K_{t-1}^2}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;K_t&amp;lt;/math&amp;gt; is the  estimate the relationship between load and displacement at time ''t'', ''x'' is the displacement, ''L'' is the recorded load and &amp;lt;math&amp;gt;\alpha = smooth&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This gives:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;math&amp;gt;K_t =\frac{\lambda L x + \gamma K_{t-1}}{\lambda x^2 +\gamma}&amp;lt;/math&amp;gt;  where   &amp;lt;math&amp;gt;\lambda =\frac{2(1-\alpha)}{L^2+(K_{t-1}x)^2}&amp;lt;/math&amp;gt;  and  &amp;lt;math&amp;gt;\gamma =\frac{\alpha}{K_{t-1}^2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then the error between requested load ''L(t)'' and recorded load ''L'' is smoothed and converted to velocity as:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;math&amp;gt;e_t =(1-\alpha)\frac{L(t)-L}{K_t}+\alpha e_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrated error is calculated as:&lt;br /&gt;
 &amp;lt;math&amp;gt;Ie_t =\frac{L(t)-L}{K_t}+ Ie_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative error is calculated with Brown's double exponential smoothing as:&lt;br /&gt;
 &amp;lt;math&amp;gt;e2_t =(1-\alpha)e_t+ \alpha e2_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
 &amp;lt;math&amp;gt; De_t = \frac{1-\alpha}{\alpha}(e_t-e2_t) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then finally the velocity is set using the PID algorithm:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;math&amp;gt;V_t  = K_p e_t + K_i Ie_t + 0.25K_i De_t&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: If the velocity has a magnitude larger than &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; than it is given that magnitude and the integrated error for that time step is not accrued.&lt;br /&gt;
&lt;br /&gt;
== To be developed ==&lt;br /&gt;
Contact forces are corrupted with fat tail noise. A median filter would help reduce the effect of this noise.&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4669</id>
		<title>LoadControl Custom Task</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4669"/>
		<updated>2016-04-27T00:24:45Z</updated>

		<summary type="html">&lt;p&gt;Chadh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[MPM Input Files#Custom Tasks|custom task]] run a load control simulation based on calculations contact or reaction forces. .&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task needs either [[MPM Global Archiving Options|global contact]] or [[MPM Global Archiving Options|global reaction]] for the specified [[Rigid Material|Rigid material]] depending on if contact for that material is enabled.&lt;br /&gt;
&lt;br /&gt;
This CustomTask tries to achieve the load requested from the [[User Defined Functions|user defined function]] by adjusting the velocity of that material. It does that by dynamically estimating the relationship between the displacement and load and then uses a PID control algorithm to adjust the velocity.&lt;br /&gt;
&lt;br /&gt;
== Task Scheduling ==&lt;br /&gt;
&lt;br /&gt;
In scripted files, a &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task is scheduled with the following block:&lt;br /&gt;
&lt;br /&gt;
 CustomTask LoadControl&lt;br /&gt;
 Parameter velocity, (velocity)&lt;br /&gt;
 Parameter material, (int)&lt;br /&gt;
 Parameter direction, (int)&lt;br /&gt;
 Parameter MaxVelocity,(number)&lt;br /&gt;
 Parameter Load_Function (user-inputted function)&lt;br /&gt;
 Parameter Kp,(number)&lt;br /&gt;
 Parameter Ki,(number)&lt;br /&gt;
 Parameter smooth,(number)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, these task options are scheduled using &amp;lt;tt&amp;gt;&amp;lt;Schedule&amp;gt;&amp;lt;/tt&amp;gt; elements, which must be within the single &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Schedule name='LoadControl'&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='velocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='material'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='direction'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='MaxVelocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Load_Function (function)'/&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Kp'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Ki'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='smooth'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are the parameters that this custom task needs to operate:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;velocity&amp;lt;/tt&amp;gt; - This is the starting velocity of the simulation for the specified  [[Rigid Material|Rigid material]]. The sign of this parameter is probably more important than its value, as long as it is something reasonable. It is needed for initializing the load control.&lt;br /&gt;
* &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt; - The material number of the [[Rigid Material|Rigid material]] to be controlled.&lt;br /&gt;
* &amp;lt;tt&amp;gt;direction&amp;lt;/tt&amp;gt; - An integer [1,2,3] to choose the direction to consider for velocity and load.&lt;br /&gt;
* &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; - A positive number that limits the velocity of the controlled material - defaults to 5 m/s.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Load_Function&amp;lt;/tt&amp;gt; - A [[User Defined Functions|user defined function]] that gives the desired load. This task doesn't work well with discontinuous functions.&lt;br /&gt;
&lt;br /&gt;
These parameters are for the control algorithm :&lt;br /&gt;
* &amp;lt;tt&amp;gt;Kp&amp;lt;/tt&amp;gt; - Proportional gain factor for PID algorithm. The default value of 0.1 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Ki&amp;lt;/tt&amp;gt; - Integral and Derivative gain factors for PID algorithm. (Note: &amp;lt;tt&amp;gt;Kd = 0.25Ki&amp;lt;/tt&amp;gt;) The default value of 0.001 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;smooth&amp;lt;/tt&amp;gt; - Exponential smoothing parameter in (0,1). Controls how fast the dynamic relationship between distance and load is updated and also how much smoothing is done on the load values. The default value of 0.95 works well.&lt;br /&gt;
&lt;br /&gt;
=== Task Action ===&lt;br /&gt;
This custom task tries to dynamically estimate the relationship between load and displacement of the rigid material using the following equation:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;math&amp;gt;K_t = \text{arg}\min_{K}  \left[ \alpha \frac{(L-Kx)^2}{0.5(L^2+(K_{t-1}x)^2)}+(1-\alpha)\frac{(K-K_{t-1})^2}{K_{t-1}^2}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;K_t&amp;lt;/math&amp;gt; is the  estimate the relationship between load and displacement at time ''t'', ''x'' is the displacement, ''L'' is the recorded load and &amp;lt;math&amp;gt;\alpha = smooth&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This gives:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;math&amp;gt;K_t =\frac{\lambda L x + \gamma K_{t-1}}{\lambda x^2 +\gamma}&amp;lt;/math&amp;gt;  where   &amp;lt;math&amp;gt;\lambda =\frac{2(1-\alpha)}{L^2+(K_{t-1}x)^2}&amp;lt;/math&amp;gt;  and  &amp;lt;math&amp;gt;\gamma =\frac{\alpha}{K_{t-1}^2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then the error between requested load ''L(t)'' and recorded load ''L'' is smoothed and converted to velocity as:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;math&amp;gt;e_t =(1-\alpha)\frac{L(t)-L}{K_t}+\alpha e_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrated error is calculated as:&lt;br /&gt;
 &amp;lt;math&amp;gt;Ie_t =\frac{L(t)-L}{K_t}+ Ie_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative error is calculated with Brown's double exponential smoothing as:&lt;br /&gt;
 &amp;lt;math&amp;gt;e2_t =(1-\alpha)e_t+ \alpha e2_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
 &amp;lt;math&amp;gt; De_t = \frac{1-\alpha}{\alpha}(e_t-e2_t) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then finally the velocity is set using the PID algorithm:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;math&amp;gt;V_t  = K_p e_t + K_i Ie_t + 0.25K_i De_t&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: If the velocity has a magnitude larger than &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; than it is given that magnitude and the integrated error for that time step is not accrued.&lt;br /&gt;
&lt;br /&gt;
== To be developed ==&lt;br /&gt;
Contact forces are corrupted with fat tail noise. A median filter would help reduce the effect of this noise.&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4668</id>
		<title>LoadControl Custom Task</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4668"/>
		<updated>2016-04-27T00:22:34Z</updated>

		<summary type="html">&lt;p&gt;Chadh: /* Task Action */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[MPM Input Files#Custom Tasks|custom task]] run a load control simulation based on calculations contact or reaction forces. .&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task needs either [[MPM Global Archiving Options|global contact]] or [[MPM Global Archiving Options|global reaction]] for the specified [[Rigid Material|Rigid material]] depending on if contact for that material is enabled.&lt;br /&gt;
&lt;br /&gt;
This CustomTask tries to achieve the load requested from the [[User Defined Functions|user defined function]] by adjusting the velocity of that material. It does that by dynamically estimating the relationship between the displacement and load and then uses a PID control algorithm to adjust the velocity.&lt;br /&gt;
&lt;br /&gt;
== Task Scheduling ==&lt;br /&gt;
&lt;br /&gt;
In scripted files, a &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task is scheduled with the following block:&lt;br /&gt;
&lt;br /&gt;
 CustomTask LoadControl&lt;br /&gt;
 Parameter velocity, (velocity)&lt;br /&gt;
 Parameter material, (int)&lt;br /&gt;
 Parameter direction, (int)&lt;br /&gt;
 Parameter MaxVelocity,(number)&lt;br /&gt;
 Parameter Load_Function (user-inputted function)&lt;br /&gt;
 Parameter Kp,(number)&lt;br /&gt;
 Parameter Ki,(number)&lt;br /&gt;
 Parameter smooth,(number)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, these task options are scheduled using &amp;lt;tt&amp;gt;&amp;lt;Schedule&amp;gt;&amp;lt;/tt&amp;gt; elements, which must be within the single &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Schedule name='LoadControl'&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='velocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='material'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='direction'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='MaxVelocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Load_Function (function)'/&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Kp'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Ki'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='smooth'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are the parameters that this custom task needs to operate:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;velocity&amp;lt;/tt&amp;gt; - This is the starting velocity of the simulation for the specified  [[Rigid Material|Rigid material]]. The sign of this parameter is probably more important than its value, as long as it is something reasonable. It is needed for initializing the load control.&lt;br /&gt;
* &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt; - The material number of the [[Rigid Material|Rigid material]] to be controlled.&lt;br /&gt;
* &amp;lt;tt&amp;gt;direction&amp;lt;/tt&amp;gt; - An integer [1,2,3] to choose the direction to consider for velocity and load.&lt;br /&gt;
* &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; - A positive number that limits the velocity of the controlled material - defaults to 5 m/s.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Load_Function&amp;lt;/tt&amp;gt; - A [[User Defined Functions|user defined function]] that gives the desired load. This task doesn't work well with discontinuous functions.&lt;br /&gt;
&lt;br /&gt;
These parameters are for the control algorithm :&lt;br /&gt;
* &amp;lt;tt&amp;gt;Kp&amp;lt;/tt&amp;gt; - Proportional gain factor for PID algorithm. The default value of 0.1 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Ki&amp;lt;/tt&amp;gt; - Integral and Derivative gain factors for PID algorithm. (Note: &amp;lt;tt&amp;gt;Kd = 0.25Ki&amp;lt;/tt&amp;gt;) The default value of 0.001 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;smooth&amp;lt;/tt&amp;gt; - Exponential smoothing parameter in (0,1). Controls how fast the dynamic relationship between distance and load is updated and also how much smoothing is done on the load values. The default value of 0.95 works well.&lt;br /&gt;
&lt;br /&gt;
=== Task Action ===&lt;br /&gt;
This custom task tries to dynamically estimate the relationship between load and displacement of the rigid material using the following equation:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;math&amp;gt;K_t = \text{arg}\min_{K}  \left[ \alpha \frac{(L-Kx)^2}{0.5(L^2+(K_{t-1}x)^2)}+(1-\alpha)\frac{(K-K_{t-1})^2}{K_{t-1}^2}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;K_t&amp;lt;/math&amp;gt; is the  estimate the relationship between load and displacement at time ''t'', ''x'' is the displacement, ''L'' is the recorded load and &amp;lt;math&amp;gt;\alpha = smooth&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This gives:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;math&amp;gt;K_t =\frac{\lambda L x + \gamma K_{t-1}}{\lambda x^2 +\gamma}&amp;lt;/math&amp;gt;  where   &amp;lt;math&amp;gt;\lambda =\frac{2(1-\alpha)}{L^2+(K_{t-1}x)^2}&amp;lt;/math&amp;gt;  and  &amp;lt;math&amp;gt;\gamma =\frac{\alpha}{K_{t-1}^2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then the error between requested load ''L(t)'' and recorded load ''L'' is smoothed and converted to velocity as:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;math&amp;gt;e_t =(1-\alpha)\frac{L(t)-L}{K_t}+\alpha e_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrated error is calculated as:&lt;br /&gt;
 &amp;lt;math&amp;gt;Ie_t =\frac{L(t)-L}{K_t}+ Ie_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative error is calculated with Brown's double exponential smoothing as:&lt;br /&gt;
 &amp;lt;math&amp;gt;e2_t =(1-\alpha)e_t+ \alpha e2_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
 &amp;lt;math&amp;gt; De_t = \frac{1-\alpha}{\alpha}(e_t-e2_t) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then finally the velocity is set using the PID algorithm:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;math&amp;gt;V_t  = K_p e_t + K_i Ie_t + 0.25K_i De_t&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: If the velocity has a magnitude larger than &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;\tt&amp;gt; than it is given that magnitude and the integrated error for that time step is not accrued.&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4667</id>
		<title>LoadControl Custom Task</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4667"/>
		<updated>2016-04-27T00:17:35Z</updated>

		<summary type="html">&lt;p&gt;Chadh: /* Task Action */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[MPM Input Files#Custom Tasks|custom task]] run a load control simulation based on calculations contact or reaction forces. .&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task needs either [[MPM Global Archiving Options|global contact]] or [[MPM Global Archiving Options|global reaction]] for the specified [[Rigid Material|Rigid material]] depending on if contact for that material is enabled.&lt;br /&gt;
&lt;br /&gt;
This CustomTask tries to achieve the load requested from the [[User Defined Functions|user defined function]] by adjusting the velocity of that material. It does that by dynamically estimating the relationship between the displacement and load and then uses a PID control algorithm to adjust the velocity.&lt;br /&gt;
&lt;br /&gt;
== Task Scheduling ==&lt;br /&gt;
&lt;br /&gt;
In scripted files, a &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task is scheduled with the following block:&lt;br /&gt;
&lt;br /&gt;
 CustomTask LoadControl&lt;br /&gt;
 Parameter velocity, (velocity)&lt;br /&gt;
 Parameter material, (int)&lt;br /&gt;
 Parameter direction, (int)&lt;br /&gt;
 Parameter MaxVelocity,(number)&lt;br /&gt;
 Parameter Load_Function (user-inputted function)&lt;br /&gt;
 Parameter Kp,(number)&lt;br /&gt;
 Parameter Ki,(number)&lt;br /&gt;
 Parameter smooth,(number)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, these task options are scheduled using &amp;lt;tt&amp;gt;&amp;lt;Schedule&amp;gt;&amp;lt;/tt&amp;gt; elements, which must be within the single &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Schedule name='LoadControl'&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='velocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='material'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='direction'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='MaxVelocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Load_Function (function)'/&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Kp'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Ki'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='smooth'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are the parameters that this custom task needs to operate:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;velocity&amp;lt;/tt&amp;gt; - This is the starting velocity of the simulation for the specified  [[Rigid Material|Rigid material]]. The sign of this parameter is probably more important than its value, as long as it is something reasonable. It is needed for initializing the load control.&lt;br /&gt;
* &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt; - The material number of the [[Rigid Material|Rigid material]] to be controlled.&lt;br /&gt;
* &amp;lt;tt&amp;gt;direction&amp;lt;/tt&amp;gt; - An integer [1,2,3] to choose the direction to consider for velocity and load.&lt;br /&gt;
* &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; - A positive number that limits the velocity of the controlled material - defaults to 5 m/s.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Load_Function&amp;lt;/tt&amp;gt; - A [[User Defined Functions|user defined function]] that gives the desired load. This task doesn't work well with discontinuous functions.&lt;br /&gt;
&lt;br /&gt;
These parameters are for the control algorithm :&lt;br /&gt;
* &amp;lt;tt&amp;gt;Kp&amp;lt;/tt&amp;gt; - Proportional gain factor for PID algorithm. The default value of 0.1 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Ki&amp;lt;/tt&amp;gt; - Integral and Derivative gain factors for PID algorithm. (Note: &amp;lt;tt&amp;gt;Kd = 0.25Ki&amp;lt;/tt&amp;gt;) The default value of 0.001 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;smooth&amp;lt;/tt&amp;gt; - Exponential smoothing parameter in (0,1). Controls how fast the dynamic relationship between distance and load is updated and also how much smoothing is done on the load values. The default value of 0.95 works well.&lt;br /&gt;
&lt;br /&gt;
=== Task Action ===&lt;br /&gt;
This custom task tries to dynamically estimate the relationship between load and displacement of the rigid material using the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;K_t = \text{arg}\min_{K}  \left[ \alpha \frac{(L-Kx)^2}{0.5(L^2+(K_{t-1}x)^2)}+(1-\alpha)\frac{(K-K_{t-1})^2}{K_{t-1}^2}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;K_t&amp;lt;/math&amp;gt; is the  estimate the relationship between load and displacement at time ''t'', ''x'' is the displacement, ''L'' is the recorded load and &amp;lt;math&amp;gt;\alpha = smooth&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;K_t =\frac{\lambda L x + \gamma K_{t-1}}{\lambda x^2 +\gamma}&amp;lt;/math&amp;gt;  where   &amp;lt;math&amp;gt;\lambda =\frac{2(1-\alpha)}{L^2+(K_{t-1}x)^2}&amp;lt;/math&amp;gt;  and  &amp;lt;math&amp;gt;\gamma =\frac{\alpha}{K_{t-1}^2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then the error between requested load ''L(t)'' and recorded load ''L'' is smoothed and converted to velocity as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e_t =(1-\alpha)\frac{L(t)-L}{K_t}+\alpha e_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrated error is calculated as:&lt;br /&gt;
&amp;lt;math&amp;gt;Ie_t =\frac{L(t)-L}{K_t}+ Ie_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative error is calculated with Brown's double exponential smoothing as:&lt;br /&gt;
&amp;lt;math&amp;gt;e2_t =(1-\alpha)e_t+ \alpha e2_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &amp;lt;math&amp;gt; De_t = \frac{1-\alpha}{\alpha}(e_t-e2_t) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then the velocity is set using in the PID algorithm:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;math&amp;gt;V_t  = K_p e_t + K_i Ie_t + 0.25K_i De_t&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4666</id>
		<title>LoadControl Custom Task</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4666"/>
		<updated>2016-04-27T00:14:21Z</updated>

		<summary type="html">&lt;p&gt;Chadh: /* Task Action */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[MPM Input Files#Custom Tasks|custom task]] run a load control simulation based on calculations contact or reaction forces. .&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task needs either [[MPM Global Archiving Options|global contact]] or [[MPM Global Archiving Options|global reaction]] for the specified [[Rigid Material|Rigid material]] depending on if contact for that material is enabled.&lt;br /&gt;
&lt;br /&gt;
This CustomTask tries to achieve the load requested from the [[User Defined Functions|user defined function]] by adjusting the velocity of that material. It does that by dynamically estimating the relationship between the displacement and load and then uses a PID control algorithm to adjust the velocity.&lt;br /&gt;
&lt;br /&gt;
== Task Scheduling ==&lt;br /&gt;
&lt;br /&gt;
In scripted files, a &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task is scheduled with the following block:&lt;br /&gt;
&lt;br /&gt;
 CustomTask LoadControl&lt;br /&gt;
 Parameter velocity, (velocity)&lt;br /&gt;
 Parameter material, (int)&lt;br /&gt;
 Parameter direction, (int)&lt;br /&gt;
 Parameter MaxVelocity,(number)&lt;br /&gt;
 Parameter Load_Function (user-inputted function)&lt;br /&gt;
 Parameter Kp,(number)&lt;br /&gt;
 Parameter Ki,(number)&lt;br /&gt;
 Parameter smooth,(number)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, these task options are scheduled using &amp;lt;tt&amp;gt;&amp;lt;Schedule&amp;gt;&amp;lt;/tt&amp;gt; elements, which must be within the single &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Schedule name='LoadControl'&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='velocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='material'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='direction'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='MaxVelocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Load_Function (function)'/&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Kp'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Ki'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='smooth'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are the parameters that this custom task needs to operate:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;velocity&amp;lt;/tt&amp;gt; - This is the starting velocity of the simulation for the specified  [[Rigid Material|Rigid material]]. The sign of this parameter is probably more important than its value, as long as it is something reasonable. It is needed for initializing the load control.&lt;br /&gt;
* &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt; - The material number of the [[Rigid Material|Rigid material]] to be controlled.&lt;br /&gt;
* &amp;lt;tt&amp;gt;direction&amp;lt;/tt&amp;gt; - An integer [1,2,3] to choose the direction to consider for velocity and load.&lt;br /&gt;
* &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; - A positive number that limits the velocity of the controlled material - defaults to 5 m/s.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Load_Function&amp;lt;/tt&amp;gt; - A [[User Defined Functions|user defined function]] that gives the desired load. This task doesn't work well with discontinuous functions.&lt;br /&gt;
&lt;br /&gt;
These parameters are for the control algorithm :&lt;br /&gt;
* &amp;lt;tt&amp;gt;Kp&amp;lt;/tt&amp;gt; - Proportional gain factor for PID algorithm. The default value of 0.1 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Ki&amp;lt;/tt&amp;gt; - Integral and Derivative gain factors for PID algorithm. (Note: &amp;lt;tt&amp;gt;Kd = 0.25Ki&amp;lt;/tt&amp;gt;) The default value of 0.001 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;smooth&amp;lt;/tt&amp;gt; - Exponential smoothing parameter in (0,1). Controls how fast the dynamic relationship between distance and load is updated and also how much smoothing is done on the load values. The default value of 0.95 works well.&lt;br /&gt;
&lt;br /&gt;
=== Task Action ===&lt;br /&gt;
This custom task tries to dynamically estimate the relationship between load and displacement of the rigid material using the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;K_t = \text{arg}\min_{K}  \left[ \alpha \frac{(L-Kx)^2}{0.5(L^2+(K_{t-1}x)^2)}+(1-\alpha)\frac{(K-K_{t-1})^2}{K_{t-1}^2}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;K_t&amp;lt;/math&amp;gt; is the  estimate the relationship between load and displacement at time ''t'', ''x'' is the displacement, ''L'' is the recorded load and &amp;lt;math&amp;gt;\alpha = smooth&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;K_t =\frac{\lambda L x + \gamma K_{t-1}}{\lambda x^2 +\gamma}&amp;lt;/math&amp;gt;  where   &amp;lt;math&amp;gt;\lambda =\frac{2(1-\alpha)}{L^2+(K_{t-1}x)^2}&amp;lt;/math&amp;gt;  and  &amp;lt;math&amp;gt;\gamma =\frac{\alpha}{K_{t-1}^2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then the error between requested load ''L(t)'' and recorded load ''L'' is smoothed and converted to velocity as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e_t =(1-\alpha)\frac{L(t)-L}{K_t}+\alpha e_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrated error is calculated as:&lt;br /&gt;
&amp;lt;math&amp;gt;Ie_t =\frac{L(t)-L}{K_t}+ Ie_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative error is calculated with Brown's double exponential smoothing as:&lt;br /&gt;
&amp;lt;math&amp;gt;e2_t =(1-\alpha)e_t+ \alpha e2_{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &amp;lt;math&amp;gt; De_t = \frac{1-alpha}{alpha}(e_t-e2_t) &amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4665</id>
		<title>LoadControl Custom Task</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4665"/>
		<updated>2016-04-27T00:02:08Z</updated>

		<summary type="html">&lt;p&gt;Chadh: /* Task Action */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[MPM Input Files#Custom Tasks|custom task]] run a load control simulation based on calculations contact or reaction forces. .&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task needs either [[MPM Global Archiving Options|global contact]] or [[MPM Global Archiving Options|global reaction]] for the specified [[Rigid Material|Rigid material]] depending on if contact for that material is enabled.&lt;br /&gt;
&lt;br /&gt;
This CustomTask tries to achieve the load requested from the [[User Defined Functions|user defined function]] by adjusting the velocity of that material. It does that by dynamically estimating the relationship between the displacement and load and then uses a PID control algorithm to adjust the velocity.&lt;br /&gt;
&lt;br /&gt;
== Task Scheduling ==&lt;br /&gt;
&lt;br /&gt;
In scripted files, a &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task is scheduled with the following block:&lt;br /&gt;
&lt;br /&gt;
 CustomTask LoadControl&lt;br /&gt;
 Parameter velocity, (velocity)&lt;br /&gt;
 Parameter material, (int)&lt;br /&gt;
 Parameter direction, (int)&lt;br /&gt;
 Parameter MaxVelocity,(number)&lt;br /&gt;
 Parameter Load_Function (user-inputted function)&lt;br /&gt;
 Parameter Kp,(number)&lt;br /&gt;
 Parameter Ki,(number)&lt;br /&gt;
 Parameter smooth,(number)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, these task options are scheduled using &amp;lt;tt&amp;gt;&amp;lt;Schedule&amp;gt;&amp;lt;/tt&amp;gt; elements, which must be within the single &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Schedule name='LoadControl'&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='velocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='material'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='direction'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='MaxVelocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Load_Function (function)'/&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Kp'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Ki'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='smooth'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are the parameters that this custom task needs to operate:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;velocity&amp;lt;/tt&amp;gt; - This is the starting velocity of the simulation for the specified  [[Rigid Material|Rigid material]]. The sign of this parameter is probably more important than its value, as long as it is something reasonable. It is needed for initializing the load control.&lt;br /&gt;
* &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt; - The material number of the [[Rigid Material|Rigid material]] to be controlled.&lt;br /&gt;
* &amp;lt;tt&amp;gt;direction&amp;lt;/tt&amp;gt; - An integer [1,2,3] to choose the direction to consider for velocity and load.&lt;br /&gt;
* &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; - A positive number that limits the velocity of the controlled material - defaults to 5 m/s.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Load_Function&amp;lt;/tt&amp;gt; - A [[User Defined Functions|user defined function]] that gives the desired load. This task doesn't work well with discontinuous functions.&lt;br /&gt;
&lt;br /&gt;
These parameters are for the control algorithm :&lt;br /&gt;
* &amp;lt;tt&amp;gt;Kp&amp;lt;/tt&amp;gt; - Proportional gain factor for PID algorithm. The default value of 0.1 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Ki&amp;lt;/tt&amp;gt; - Integral and Derivative gain factors for PID algorithm. (Note: &amp;lt;tt&amp;gt;Kd = 0.25Ki&amp;lt;/tt&amp;gt;) The default value of 0.001 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;smooth&amp;lt;/tt&amp;gt; - Exponential smoothing parameter in (0,1). Controls how fast the dynamic relationship between distance and load is updated and also how much smoothing is done on the load values. The default value of 0.95 works well.&lt;br /&gt;
&lt;br /&gt;
=== Task Action ===&lt;br /&gt;
This custom task tries to dynamically estimate the relationship between load and displacement of the rigid material using the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;K_t = \text{arg}\min_{K}  \left[ \alpha \frac{(L-Kx)^2}{0.5(L^2+(K_{t-1}x)^2)}+(1-\alpha)\frac{(K-K_{t-1})^2}{K_{t-1}^2}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;K_t&amp;lt;/math&amp;gt; is the  estimate the relationship between load and displacement at time ''t'', ''x'' is the displacement, ''L'' is the recorded load and &amp;lt;math&amp;gt;\alpha = smooth&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;K_t =\frac{\lambda L x + \gamma K_{t-1}}{\lambda x^2 +\gamma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\lambda =\frac{2(1-\alpha)}{L^2+(K_{t-1}x)^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma =\frac{\alpha}{K_{t-1}^2}&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4664</id>
		<title>LoadControl Custom Task</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4664"/>
		<updated>2016-04-27T00:01:05Z</updated>

		<summary type="html">&lt;p&gt;Chadh: /* Task Action */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[MPM Input Files#Custom Tasks|custom task]] run a load control simulation based on calculations contact or reaction forces. .&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task needs either [[MPM Global Archiving Options|global contact]] or [[MPM Global Archiving Options|global reaction]] for the specified [[Rigid Material|Rigid material]] depending on if contact for that material is enabled.&lt;br /&gt;
&lt;br /&gt;
This CustomTask tries to achieve the load requested from the [[User Defined Functions|user defined function]] by adjusting the velocity of that material. It does that by dynamically estimating the relationship between the displacement and load and then uses a PID control algorithm to adjust the velocity.&lt;br /&gt;
&lt;br /&gt;
== Task Scheduling ==&lt;br /&gt;
&lt;br /&gt;
In scripted files, a &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task is scheduled with the following block:&lt;br /&gt;
&lt;br /&gt;
 CustomTask LoadControl&lt;br /&gt;
 Parameter velocity, (velocity)&lt;br /&gt;
 Parameter material, (int)&lt;br /&gt;
 Parameter direction, (int)&lt;br /&gt;
 Parameter MaxVelocity,(number)&lt;br /&gt;
 Parameter Load_Function (user-inputted function)&lt;br /&gt;
 Parameter Kp,(number)&lt;br /&gt;
 Parameter Ki,(number)&lt;br /&gt;
 Parameter smooth,(number)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, these task options are scheduled using &amp;lt;tt&amp;gt;&amp;lt;Schedule&amp;gt;&amp;lt;/tt&amp;gt; elements, which must be within the single &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Schedule name='LoadControl'&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='velocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='material'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='direction'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='MaxVelocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Load_Function (function)'/&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Kp'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Ki'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='smooth'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are the parameters that this custom task needs to operate:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;velocity&amp;lt;/tt&amp;gt; - This is the starting velocity of the simulation for the specified  [[Rigid Material|Rigid material]]. The sign of this parameter is probably more important than its value, as long as it is something reasonable. It is needed for initializing the load control.&lt;br /&gt;
* &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt; - The material number of the [[Rigid Material|Rigid material]] to be controlled.&lt;br /&gt;
* &amp;lt;tt&amp;gt;direction&amp;lt;/tt&amp;gt; - An integer [1,2,3] to choose the direction to consider for velocity and load.&lt;br /&gt;
* &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; - A positive number that limits the velocity of the controlled material - defaults to 5 m/s.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Load_Function&amp;lt;/tt&amp;gt; - A [[User Defined Functions|user defined function]] that gives the desired load. This task doesn't work well with discontinuous functions.&lt;br /&gt;
&lt;br /&gt;
These parameters are for the control algorithm :&lt;br /&gt;
* &amp;lt;tt&amp;gt;Kp&amp;lt;/tt&amp;gt; - Proportional gain factor for PID algorithm. The default value of 0.1 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Ki&amp;lt;/tt&amp;gt; - Integral and Derivative gain factors for PID algorithm. (Note: &amp;lt;tt&amp;gt;Kd = 0.25Ki&amp;lt;/tt&amp;gt;) The default value of 0.001 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;smooth&amp;lt;/tt&amp;gt; - Exponential smoothing parameter in (0,1). Controls how fast the dynamic relationship between distance and load is updated and also how much smoothing is done on the load values. The default value of 0.95 works well.&lt;br /&gt;
&lt;br /&gt;
=== Task Action ===&lt;br /&gt;
This custom task tries to dynamically estimate the relationship between load and displacement of the rigid material using the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;K_t = \text{arg}\min_{K}  \left[ \alpha \frac{(L-Kx)^2}{0.5(L^2+(K_{t-1}x)^2)}+(1-\alpha)\frac{(K-K_{t-1})^2}{K_{t-1}^2}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;K_t&amp;lt;/math&amp;gt; is the  estimate the relationship between load and displacement at time ''t'', ''x'' is the displacement, ''L'' is the recorded load and &amp;lt;math&amp;gt;\alpha = smooth&amp;lt;/math&amp;gt;.&lt;br /&gt;
This gives:&lt;br /&gt;
&amp;lt;math&amp;gt;K_t =\frac{\lambda L x + \gamma K_{t-1}}{\lambda x^2 +\gamma}&amp;lt;/math&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;math&amp;gt;\lambda =\frac{2(1-\alpha)}{L^2+(K_{t-1}x)^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
and &lt;br /&gt;
&amp;lt;math&amp;gt;\gamma =\frac{\alpha}{K_{t-1}^2}&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4663</id>
		<title>LoadControl Custom Task</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4663"/>
		<updated>2016-04-26T23:53:05Z</updated>

		<summary type="html">&lt;p&gt;Chadh: /* Task Action */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[MPM Input Files#Custom Tasks|custom task]] run a load control simulation based on calculations contact or reaction forces. .&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task needs either [[MPM Global Archiving Options|global contact]] or [[MPM Global Archiving Options|global reaction]] for the specified [[Rigid Material|Rigid material]] depending on if contact for that material is enabled.&lt;br /&gt;
&lt;br /&gt;
This CustomTask tries to achieve the load requested from the [[User Defined Functions|user defined function]] by adjusting the velocity of that material. It does that by dynamically estimating the relationship between the displacement and load and then uses a PID control algorithm to adjust the velocity.&lt;br /&gt;
&lt;br /&gt;
== Task Scheduling ==&lt;br /&gt;
&lt;br /&gt;
In scripted files, a &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task is scheduled with the following block:&lt;br /&gt;
&lt;br /&gt;
 CustomTask LoadControl&lt;br /&gt;
 Parameter velocity, (velocity)&lt;br /&gt;
 Parameter material, (int)&lt;br /&gt;
 Parameter direction, (int)&lt;br /&gt;
 Parameter MaxVelocity,(number)&lt;br /&gt;
 Parameter Load_Function (user-inputted function)&lt;br /&gt;
 Parameter Kp,(number)&lt;br /&gt;
 Parameter Ki,(number)&lt;br /&gt;
 Parameter smooth,(number)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, these task options are scheduled using &amp;lt;tt&amp;gt;&amp;lt;Schedule&amp;gt;&amp;lt;/tt&amp;gt; elements, which must be within the single &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Schedule name='LoadControl'&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='velocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='material'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='direction'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='MaxVelocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Load_Function (function)'/&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Kp'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Ki'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='smooth'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are the parameters that this custom task needs to operate:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;velocity&amp;lt;/tt&amp;gt; - This is the starting velocity of the simulation for the specified  [[Rigid Material|Rigid material]]. The sign of this parameter is probably more important than its value, as long as it is something reasonable. It is needed for initializing the load control.&lt;br /&gt;
* &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt; - The material number of the [[Rigid Material|Rigid material]] to be controlled.&lt;br /&gt;
* &amp;lt;tt&amp;gt;direction&amp;lt;/tt&amp;gt; - An integer [1,2,3] to choose the direction to consider for velocity and load.&lt;br /&gt;
* &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; - A positive number that limits the velocity of the controlled material - defaults to 5 m/s.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Load_Function&amp;lt;/tt&amp;gt; - A [[User Defined Functions|user defined function]] that gives the desired load. This task doesn't work well with discontinuous functions.&lt;br /&gt;
&lt;br /&gt;
These parameters are for the control algorithm :&lt;br /&gt;
* &amp;lt;tt&amp;gt;Kp&amp;lt;/tt&amp;gt; - Proportional gain factor for PID algorithm. The default value of 0.1 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Ki&amp;lt;/tt&amp;gt; - Integral and Derivative gain factors for PID algorithm. (Note: &amp;lt;tt&amp;gt;Kd = 0.25Ki&amp;lt;/tt&amp;gt;) The default value of 0.001 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;smooth&amp;lt;/tt&amp;gt; - Exponential smoothing parameter in (0,1). Controls how fast the dynamic relationship between distance and load is updated and also how much smoothing is done on the load values. The default value of 0.95 works well.&lt;br /&gt;
&lt;br /&gt;
=== Task Action ===&lt;br /&gt;
This custom task tries to dynamically estimate the relationship between load and displacement of the rigid material using the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;K_t = \text{arg}\min_{K}  \left[ \alpha \frac{(L-Kx)^2}{0.5*(L^2+(K_{t-1}x)^2)}+(1-\alpha)\frac{(K-K_{t-1})^2}{K_{t-1}^2}\right]&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4662</id>
		<title>LoadControl Custom Task</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4662"/>
		<updated>2016-04-26T23:52:45Z</updated>

		<summary type="html">&lt;p&gt;Chadh: /* Task Action */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[MPM Input Files#Custom Tasks|custom task]] run a load control simulation based on calculations contact or reaction forces. .&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task needs either [[MPM Global Archiving Options|global contact]] or [[MPM Global Archiving Options|global reaction]] for the specified [[Rigid Material|Rigid material]] depending on if contact for that material is enabled.&lt;br /&gt;
&lt;br /&gt;
This CustomTask tries to achieve the load requested from the [[User Defined Functions|user defined function]] by adjusting the velocity of that material. It does that by dynamically estimating the relationship between the displacement and load and then uses a PID control algorithm to adjust the velocity.&lt;br /&gt;
&lt;br /&gt;
== Task Scheduling ==&lt;br /&gt;
&lt;br /&gt;
In scripted files, a &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task is scheduled with the following block:&lt;br /&gt;
&lt;br /&gt;
 CustomTask LoadControl&lt;br /&gt;
 Parameter velocity, (velocity)&lt;br /&gt;
 Parameter material, (int)&lt;br /&gt;
 Parameter direction, (int)&lt;br /&gt;
 Parameter MaxVelocity,(number)&lt;br /&gt;
 Parameter Load_Function (user-inputted function)&lt;br /&gt;
 Parameter Kp,(number)&lt;br /&gt;
 Parameter Ki,(number)&lt;br /&gt;
 Parameter smooth,(number)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, these task options are scheduled using &amp;lt;tt&amp;gt;&amp;lt;Schedule&amp;gt;&amp;lt;/tt&amp;gt; elements, which must be within the single &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Schedule name='LoadControl'&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='velocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='material'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='direction'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='MaxVelocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Load_Function (function)'/&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Kp'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Ki'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='smooth'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are the parameters that this custom task needs to operate:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;velocity&amp;lt;/tt&amp;gt; - This is the starting velocity of the simulation for the specified  [[Rigid Material|Rigid material]]. The sign of this parameter is probably more important than its value, as long as it is something reasonable. It is needed for initializing the load control.&lt;br /&gt;
* &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt; - The material number of the [[Rigid Material|Rigid material]] to be controlled.&lt;br /&gt;
* &amp;lt;tt&amp;gt;direction&amp;lt;/tt&amp;gt; - An integer [1,2,3] to choose the direction to consider for velocity and load.&lt;br /&gt;
* &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; - A positive number that limits the velocity of the controlled material - defaults to 5 m/s.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Load_Function&amp;lt;/tt&amp;gt; - A [[User Defined Functions|user defined function]] that gives the desired load. This task doesn't work well with discontinuous functions.&lt;br /&gt;
&lt;br /&gt;
These parameters are for the control algorithm :&lt;br /&gt;
* &amp;lt;tt&amp;gt;Kp&amp;lt;/tt&amp;gt; - Proportional gain factor for PID algorithm. The default value of 0.1 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Ki&amp;lt;/tt&amp;gt; - Integral and Derivative gain factors for PID algorithm. (Note: &amp;lt;tt&amp;gt;Kd = 0.25Ki&amp;lt;/tt&amp;gt;) The default value of 0.001 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;smooth&amp;lt;/tt&amp;gt; - Exponential smoothing parameter in (0,1). Controls how fast the dynamic relationship between distance and load is updated and also how much smoothing is done on the load values. The default value of 0.95 works well.&lt;br /&gt;
&lt;br /&gt;
=== Task Action ===&lt;br /&gt;
This custom task tries to dynamically estimate the relationship between load and displacement of the rigid material using the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;K_t = \min_{K}  \left[ \alpha \frac{(L-Kx)^2}{0.5*(L^2+(K_{t-1}x)^2)}+(1-\alpha)\frac{(K-K_{t-1})^2}{K_{t-1}^2}\right]&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4661</id>
		<title>LoadControl Custom Task</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4661"/>
		<updated>2016-04-26T23:50:52Z</updated>

		<summary type="html">&lt;p&gt;Chadh: /* Task Action */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[MPM Input Files#Custom Tasks|custom task]] run a load control simulation based on calculations contact or reaction forces. .&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task needs either [[MPM Global Archiving Options|global contact]] or [[MPM Global Archiving Options|global reaction]] for the specified [[Rigid Material|Rigid material]] depending on if contact for that material is enabled.&lt;br /&gt;
&lt;br /&gt;
This CustomTask tries to achieve the load requested from the [[User Defined Functions|user defined function]] by adjusting the velocity of that material. It does that by dynamically estimating the relationship between the displacement and load and then uses a PID control algorithm to adjust the velocity.&lt;br /&gt;
&lt;br /&gt;
== Task Scheduling ==&lt;br /&gt;
&lt;br /&gt;
In scripted files, a &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task is scheduled with the following block:&lt;br /&gt;
&lt;br /&gt;
 CustomTask LoadControl&lt;br /&gt;
 Parameter velocity, (velocity)&lt;br /&gt;
 Parameter material, (int)&lt;br /&gt;
 Parameter direction, (int)&lt;br /&gt;
 Parameter MaxVelocity,(number)&lt;br /&gt;
 Parameter Load_Function (user-inputted function)&lt;br /&gt;
 Parameter Kp,(number)&lt;br /&gt;
 Parameter Ki,(number)&lt;br /&gt;
 Parameter smooth,(number)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, these task options are scheduled using &amp;lt;tt&amp;gt;&amp;lt;Schedule&amp;gt;&amp;lt;/tt&amp;gt; elements, which must be within the single &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Schedule name='LoadControl'&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='velocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='material'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='direction'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='MaxVelocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Load_Function (function)'/&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Kp'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Ki'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='smooth'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are the parameters that this custom task needs to operate:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;velocity&amp;lt;/tt&amp;gt; - This is the starting velocity of the simulation for the specified  [[Rigid Material|Rigid material]]. The sign of this parameter is probably more important than its value, as long as it is something reasonable. It is needed for initializing the load control.&lt;br /&gt;
* &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt; - The material number of the [[Rigid Material|Rigid material]] to be controlled.&lt;br /&gt;
* &amp;lt;tt&amp;gt;direction&amp;lt;/tt&amp;gt; - An integer [1,2,3] to choose the direction to consider for velocity and load.&lt;br /&gt;
* &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; - A positive number that limits the velocity of the controlled material - defaults to 5 m/s.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Load_Function&amp;lt;/tt&amp;gt; - A [[User Defined Functions|user defined function]] that gives the desired load. This task doesn't work well with discontinuous functions.&lt;br /&gt;
&lt;br /&gt;
These parameters are for the control algorithm :&lt;br /&gt;
* &amp;lt;tt&amp;gt;Kp&amp;lt;/tt&amp;gt; - Proportional gain factor for PID algorithm. The default value of 0.1 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Ki&amp;lt;/tt&amp;gt; - Integral and Derivative gain factors for PID algorithm. (Note: &amp;lt;tt&amp;gt;Kd = 0.25Ki&amp;lt;/tt&amp;gt;) The default value of 0.001 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;smooth&amp;lt;/tt&amp;gt; - Exponential smoothing parameter in (0,1). Controls how fast the dynamic relationship between distance and load is updated and also how much smoothing is done on the load values. The default value of 0.95 works well.&lt;br /&gt;
&lt;br /&gt;
=== Task Action ===&lt;br /&gt;
This custom task tries to dynamically estimate the relationship between load and displacement of the rigid material using the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;K_t = argmin\limits_K  \left[ \alpha \frac{(L-Kx)^2}{0.5*(L^2+(K_{t-1}x)^2)}+(1-\alpha)\frac{(K-K_{t-1})^2}{K_{t-1}^2}\right]&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4660</id>
		<title>LoadControl Custom Task</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4660"/>
		<updated>2016-04-26T23:50:29Z</updated>

		<summary type="html">&lt;p&gt;Chadh: /* Task Action */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[MPM Input Files#Custom Tasks|custom task]] run a load control simulation based on calculations contact or reaction forces. .&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task needs either [[MPM Global Archiving Options|global contact]] or [[MPM Global Archiving Options|global reaction]] for the specified [[Rigid Material|Rigid material]] depending on if contact for that material is enabled.&lt;br /&gt;
&lt;br /&gt;
This CustomTask tries to achieve the load requested from the [[User Defined Functions|user defined function]] by adjusting the velocity of that material. It does that by dynamically estimating the relationship between the displacement and load and then uses a PID control algorithm to adjust the velocity.&lt;br /&gt;
&lt;br /&gt;
== Task Scheduling ==&lt;br /&gt;
&lt;br /&gt;
In scripted files, a &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task is scheduled with the following block:&lt;br /&gt;
&lt;br /&gt;
 CustomTask LoadControl&lt;br /&gt;
 Parameter velocity, (velocity)&lt;br /&gt;
 Parameter material, (int)&lt;br /&gt;
 Parameter direction, (int)&lt;br /&gt;
 Parameter MaxVelocity,(number)&lt;br /&gt;
 Parameter Load_Function (user-inputted function)&lt;br /&gt;
 Parameter Kp,(number)&lt;br /&gt;
 Parameter Ki,(number)&lt;br /&gt;
 Parameter smooth,(number)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, these task options are scheduled using &amp;lt;tt&amp;gt;&amp;lt;Schedule&amp;gt;&amp;lt;/tt&amp;gt; elements, which must be within the single &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Schedule name='LoadControl'&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='velocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='material'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='direction'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='MaxVelocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Load_Function (function)'/&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Kp'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Ki'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='smooth'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are the parameters that this custom task needs to operate:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;velocity&amp;lt;/tt&amp;gt; - This is the starting velocity of the simulation for the specified  [[Rigid Material|Rigid material]]. The sign of this parameter is probably more important than its value, as long as it is something reasonable. It is needed for initializing the load control.&lt;br /&gt;
* &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt; - The material number of the [[Rigid Material|Rigid material]] to be controlled.&lt;br /&gt;
* &amp;lt;tt&amp;gt;direction&amp;lt;/tt&amp;gt; - An integer [1,2,3] to choose the direction to consider for velocity and load.&lt;br /&gt;
* &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; - A positive number that limits the velocity of the controlled material - defaults to 5 m/s.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Load_Function&amp;lt;/tt&amp;gt; - A [[User Defined Functions|user defined function]] that gives the desired load. This task doesn't work well with discontinuous functions.&lt;br /&gt;
&lt;br /&gt;
These parameters are for the control algorithm :&lt;br /&gt;
* &amp;lt;tt&amp;gt;Kp&amp;lt;/tt&amp;gt; - Proportional gain factor for PID algorithm. The default value of 0.1 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Ki&amp;lt;/tt&amp;gt; - Integral and Derivative gain factors for PID algorithm. (Note: &amp;lt;tt&amp;gt;Kd = 0.25Ki&amp;lt;/tt&amp;gt;) The default value of 0.001 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;smooth&amp;lt;/tt&amp;gt; - Exponential smoothing parameter in (0,1). Controls how fast the dynamic relationship between distance and load is updated and also how much smoothing is done on the load values. The default value of 0.95 works well.&lt;br /&gt;
&lt;br /&gt;
=== Task Action ===&lt;br /&gt;
This custom task tries to dynamically estimate the relationship between load and displacement of the rigid material using the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;K_t = argmin_K  \left[ \alpha \frac{(L-Kx)^2}{0.5*(L^2+(K_{t-1}x)^2)}+(1-\alpha)\frac{(K-K_{t-1})^2}{K_{t-1}^2}\right]&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4659</id>
		<title>LoadControl Custom Task</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4659"/>
		<updated>2016-04-26T23:49:43Z</updated>

		<summary type="html">&lt;p&gt;Chadh: /* Task Action */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[MPM Input Files#Custom Tasks|custom task]] run a load control simulation based on calculations contact or reaction forces. .&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task needs either [[MPM Global Archiving Options|global contact]] or [[MPM Global Archiving Options|global reaction]] for the specified [[Rigid Material|Rigid material]] depending on if contact for that material is enabled.&lt;br /&gt;
&lt;br /&gt;
This CustomTask tries to achieve the load requested from the [[User Defined Functions|user defined function]] by adjusting the velocity of that material. It does that by dynamically estimating the relationship between the displacement and load and then uses a PID control algorithm to adjust the velocity.&lt;br /&gt;
&lt;br /&gt;
== Task Scheduling ==&lt;br /&gt;
&lt;br /&gt;
In scripted files, a &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task is scheduled with the following block:&lt;br /&gt;
&lt;br /&gt;
 CustomTask LoadControl&lt;br /&gt;
 Parameter velocity, (velocity)&lt;br /&gt;
 Parameter material, (int)&lt;br /&gt;
 Parameter direction, (int)&lt;br /&gt;
 Parameter MaxVelocity,(number)&lt;br /&gt;
 Parameter Load_Function (user-inputted function)&lt;br /&gt;
 Parameter Kp,(number)&lt;br /&gt;
 Parameter Ki,(number)&lt;br /&gt;
 Parameter smooth,(number)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, these task options are scheduled using &amp;lt;tt&amp;gt;&amp;lt;Schedule&amp;gt;&amp;lt;/tt&amp;gt; elements, which must be within the single &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Schedule name='LoadControl'&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='velocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='material'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='direction'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='MaxVelocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Load_Function (function)'/&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Kp'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Ki'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='smooth'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are the parameters that this custom task needs to operate:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;velocity&amp;lt;/tt&amp;gt; - This is the starting velocity of the simulation for the specified  [[Rigid Material|Rigid material]]. The sign of this parameter is probably more important than its value, as long as it is something reasonable. It is needed for initializing the load control.&lt;br /&gt;
* &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt; - The material number of the [[Rigid Material|Rigid material]] to be controlled.&lt;br /&gt;
* &amp;lt;tt&amp;gt;direction&amp;lt;/tt&amp;gt; - An integer [1,2,3] to choose the direction to consider for velocity and load.&lt;br /&gt;
* &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; - A positive number that limits the velocity of the controlled material - defaults to 5 m/s.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Load_Function&amp;lt;/tt&amp;gt; - A [[User Defined Functions|user defined function]] that gives the desired load. This task doesn't work well with discontinuous functions.&lt;br /&gt;
&lt;br /&gt;
These parameters are for the control algorithm :&lt;br /&gt;
* &amp;lt;tt&amp;gt;Kp&amp;lt;/tt&amp;gt; - Proportional gain factor for PID algorithm. The default value of 0.1 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Ki&amp;lt;/tt&amp;gt; - Integral and Derivative gain factors for PID algorithm. (Note: &amp;lt;tt&amp;gt;Kd = 0.25Ki&amp;lt;/tt&amp;gt;) The default value of 0.001 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;smooth&amp;lt;/tt&amp;gt; - Exponential smoothing parameter in (0,1). Controls how fast the dynamic relationship between distance and load is updated and also how much smoothing is done on the load values. The default value of 0.95 works well.&lt;br /&gt;
&lt;br /&gt;
=== Task Action ===&lt;br /&gt;
This custom task tries to dynamically estimate the relationship between load and displacement of the rigid material using the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;K_t =  \left[ \alpha \frac{(L-Kx)^2}{0.5*(L^2+(K_{t-1}x)^2)}+(1-\alpha)\frac{(K-K_{t-1})^2}{K_{t-1}^2}\right]&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4658</id>
		<title>LoadControl Custom Task</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4658"/>
		<updated>2016-04-26T23:48:32Z</updated>

		<summary type="html">&lt;p&gt;Chadh: /* Task Action */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[MPM Input Files#Custom Tasks|custom task]] run a load control simulation based on calculations contact or reaction forces. .&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task needs either [[MPM Global Archiving Options|global contact]] or [[MPM Global Archiving Options|global reaction]] for the specified [[Rigid Material|Rigid material]] depending on if contact for that material is enabled.&lt;br /&gt;
&lt;br /&gt;
This CustomTask tries to achieve the load requested from the [[User Defined Functions|user defined function]] by adjusting the velocity of that material. It does that by dynamically estimating the relationship between the displacement and load and then uses a PID control algorithm to adjust the velocity.&lt;br /&gt;
&lt;br /&gt;
== Task Scheduling ==&lt;br /&gt;
&lt;br /&gt;
In scripted files, a &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task is scheduled with the following block:&lt;br /&gt;
&lt;br /&gt;
 CustomTask LoadControl&lt;br /&gt;
 Parameter velocity, (velocity)&lt;br /&gt;
 Parameter material, (int)&lt;br /&gt;
 Parameter direction, (int)&lt;br /&gt;
 Parameter MaxVelocity,(number)&lt;br /&gt;
 Parameter Load_Function (user-inputted function)&lt;br /&gt;
 Parameter Kp,(number)&lt;br /&gt;
 Parameter Ki,(number)&lt;br /&gt;
 Parameter smooth,(number)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, these task options are scheduled using &amp;lt;tt&amp;gt;&amp;lt;Schedule&amp;gt;&amp;lt;/tt&amp;gt; elements, which must be within the single &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Schedule name='LoadControl'&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='velocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='material'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='direction'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='MaxVelocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Load_Function (function)'/&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Kp'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Ki'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='smooth'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are the parameters that this custom task needs to operate:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;velocity&amp;lt;/tt&amp;gt; - This is the starting velocity of the simulation for the specified  [[Rigid Material|Rigid material]]. The sign of this parameter is probably more important than its value, as long as it is something reasonable. It is needed for initializing the load control.&lt;br /&gt;
* &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt; - The material number of the [[Rigid Material|Rigid material]] to be controlled.&lt;br /&gt;
* &amp;lt;tt&amp;gt;direction&amp;lt;/tt&amp;gt; - An integer [1,2,3] to choose the direction to consider for velocity and load.&lt;br /&gt;
* &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; - A positive number that limits the velocity of the controlled material - defaults to 5 m/s.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Load_Function&amp;lt;/tt&amp;gt; - A [[User Defined Functions|user defined function]] that gives the desired load. This task doesn't work well with discontinuous functions.&lt;br /&gt;
&lt;br /&gt;
These parameters are for the control algorithm :&lt;br /&gt;
* &amp;lt;tt&amp;gt;Kp&amp;lt;/tt&amp;gt; - Proportional gain factor for PID algorithm. The default value of 0.1 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Ki&amp;lt;/tt&amp;gt; - Integral and Derivative gain factors for PID algorithm. (Note: &amp;lt;tt&amp;gt;Kd = 0.25Ki&amp;lt;/tt&amp;gt;) The default value of 0.001 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;smooth&amp;lt;/tt&amp;gt; - Exponential smoothing parameter in (0,1). Controls how fast the dynamic relationship between distance and load is updated and also how much smoothing is done on the load values. The default value of 0.95 works well.&lt;br /&gt;
&lt;br /&gt;
=== Task Action ===&lt;br /&gt;
This custom task tries to dynamically estimate the relationship between load and displacement of the rigid material using the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;K_t = \arg\min_K \left[ \alpha \frac{(L-Kx)^2}{0.5*(L^2+(K_{t-1}x)^2}+(1-\alpha)\frac{(K-K_{t-1})^2}{K_{t-1}^2}&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4657</id>
		<title>LoadControl Custom Task</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4657"/>
		<updated>2016-04-26T23:44:08Z</updated>

		<summary type="html">&lt;p&gt;Chadh: /* Task Scheduling */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[MPM Input Files#Custom Tasks|custom task]] run a load control simulation based on calculations contact or reaction forces. .&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task needs either [[MPM Global Archiving Options|global contact]] or [[MPM Global Archiving Options|global reaction]] for the specified [[Rigid Material|Rigid material]] depending on if contact for that material is enabled.&lt;br /&gt;
&lt;br /&gt;
This CustomTask tries to achieve the load requested from the [[User Defined Functions|user defined function]] by adjusting the velocity of that material. It does that by dynamically estimating the relationship between the displacement and load and then uses a PID control algorithm to adjust the velocity.&lt;br /&gt;
&lt;br /&gt;
== Task Scheduling ==&lt;br /&gt;
&lt;br /&gt;
In scripted files, a &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task is scheduled with the following block:&lt;br /&gt;
&lt;br /&gt;
 CustomTask LoadControl&lt;br /&gt;
 Parameter velocity, (velocity)&lt;br /&gt;
 Parameter material, (int)&lt;br /&gt;
 Parameter direction, (int)&lt;br /&gt;
 Parameter MaxVelocity,(number)&lt;br /&gt;
 Parameter Load_Function (user-inputted function)&lt;br /&gt;
 Parameter Kp,(number)&lt;br /&gt;
 Parameter Ki,(number)&lt;br /&gt;
 Parameter smooth,(number)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, these task options are scheduled using &amp;lt;tt&amp;gt;&amp;lt;Schedule&amp;gt;&amp;lt;/tt&amp;gt; elements, which must be within the single &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Schedule name='LoadControl'&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='velocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='material'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='direction'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='MaxVelocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Load_Function (function)'/&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Kp'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Ki'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='smooth'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are the parameters that this custom task needs to operate:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;velocity&amp;lt;/tt&amp;gt; - This is the starting velocity of the simulation for the specified  [[Rigid Material|Rigid material]]. The sign of this parameter is probably more important than its value, as long as it is something reasonable. It is needed for initializing the load control.&lt;br /&gt;
* &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt; - The material number of the [[Rigid Material|Rigid material]] to be controlled.&lt;br /&gt;
* &amp;lt;tt&amp;gt;direction&amp;lt;/tt&amp;gt; - An integer [1,2,3] to choose the direction to consider for velocity and load.&lt;br /&gt;
* &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; - A positive number that limits the velocity of the controlled material - defaults to 5 m/s.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Load_Function&amp;lt;/tt&amp;gt; - A [[User Defined Functions|user defined function]] that gives the desired load. This task doesn't work well with discontinuous functions.&lt;br /&gt;
&lt;br /&gt;
These parameters are for the control algorithm :&lt;br /&gt;
* &amp;lt;tt&amp;gt;Kp&amp;lt;/tt&amp;gt; - Proportional gain factor for PID algorithm. The default value of 0.1 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Ki&amp;lt;/tt&amp;gt; - Integral and Derivative gain factors for PID algorithm. (Note: &amp;lt;tt&amp;gt;Kd = 0.25Ki&amp;lt;/tt&amp;gt;) The default value of 0.001 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;smooth&amp;lt;/tt&amp;gt; - Exponential smoothing parameter in (0,1). Controls how fast the dynamic relationship between distance and load is updated and also how much smoothing is done on the load values. The default value of 0.95 works well.&lt;br /&gt;
&lt;br /&gt;
=== Task Action ===&lt;br /&gt;
This custom task tries to dynamically estimate the relationship between load and displacement of the rigid material using the following equation:&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4656</id>
		<title>LoadControl Custom Task</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4656"/>
		<updated>2016-04-26T23:37:30Z</updated>

		<summary type="html">&lt;p&gt;Chadh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[MPM Input Files#Custom Tasks|custom task]] run a load control simulation based on calculations contact or reaction forces. .&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task needs either [[MPM Global Archiving Options|global contact]] or [[MPM Global Archiving Options|global reaction]] for the specified [[Rigid Material|Rigid material]] depending on if contact for that material is enabled.&lt;br /&gt;
&lt;br /&gt;
This CustomTask tries to achieve the load requested from the [[User Defined Functions|user defined function]] by adjusting the velocity of that material. It does that by dynamically estimating the relationship between the displacement and load and then uses a PID control algorithm to adjust the velocity.&lt;br /&gt;
&lt;br /&gt;
== Task Scheduling ==&lt;br /&gt;
&lt;br /&gt;
In scripted files, a &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task is scheduled with the following block:&lt;br /&gt;
&lt;br /&gt;
 CustomTask LoadControl&lt;br /&gt;
 Parameter velocity, (velocity)&lt;br /&gt;
 Parameter material, (int)&lt;br /&gt;
 Parameter direction, (int)&lt;br /&gt;
 Parameter MaxVelocity,(number)&lt;br /&gt;
 Parameter Load_Function (user-inputted function)&lt;br /&gt;
 Parameter Kp,(number)&lt;br /&gt;
 Parameter Ki,(number)&lt;br /&gt;
 Parameter smooth,(number)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, these task options are scheduled using &amp;lt;tt&amp;gt;&amp;lt;Schedule&amp;gt;&amp;lt;/tt&amp;gt; elements, which must be within the single &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Schedule name='LoadControl'&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='velocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='material'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='direction'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='MaxVelocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Load_Function (function)'/&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Kp'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Ki'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='smooth'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are the parameters that this custom task needs to operate:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;velocity&amp;lt;/tt&amp;gt; - This is the starting velocity of the simulation for the specified  [[Rigid Material|Rigid material]]. The sign of this parameter is probably more important than its value, as long as it is something reasonable. It is needed for initializing the load control.&lt;br /&gt;
* &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt; - The material number of the [[Rigid Material|Rigid material]] to be controlled.&lt;br /&gt;
* &amp;lt;tt&amp;gt;direction&amp;lt;/tt&amp;gt; - An integer [1,2,3] to choose the direction to consider for velocity and load.&lt;br /&gt;
* &amp;lt;tt&amp;gt;MaxVelocity&amp;lt;/tt&amp;gt; - A positive number that limits the velocity of the controlled material - defaults to 5 m/s.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Load_Function&amp;lt;/tt&amp;gt; - A [[User Defined Functions|user defined function]] that gives the desired load. This task doesn't do well with discontinious functions.&lt;br /&gt;
&lt;br /&gt;
These parameters are for the control algorithm :&lt;br /&gt;
* &amp;lt;tt&amp;gt;Kp&amp;lt;/tt&amp;gt; - Proportional gain factor for PID algorithm. The default value of 0.1 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Ki&amp;lt;/tt&amp;gt; - Integral and Derivative gain factor for PID algorithm. (Note: &amp;lt;tt&amp;gt;Ki = 0.25Kd&amp;lt;/tt&amp;gt;) The default value of 0.001 seems to work well.&lt;br /&gt;
* &amp;lt;tt&amp;gt;smooth&amp;lt;/tt&amp;gt; - Exponential smoothing parameter in (0,1). Controls how fast the dynamic relationship between distance and load is updated and also how much smoothing is done on the load values. The default value of 0.95 works well.&lt;br /&gt;
&lt;br /&gt;
=== Task Action ===&lt;br /&gt;
&lt;br /&gt;
Once the specified crack length is reached (and all crack propagation stops) or the critical [[MPM Global Archiving Options|global archive quantity]] is reached, the task performs various actions specified by the &amp;lt;tt&amp;gt;(style)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;(hold)&amp;lt;/tt&amp;gt; parameters. Scripted files can enter text for the style, but &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files must use the &amp;lt;tt&amp;gt;(styleNumber)&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; (or 0): Reverses all linearly increasing [[Setting Forces and Fluxes|loads or tractions]] (see [[Boundary Condition Styles|&amp;quot;linear&amp;quot; style]] in particle loads) and reverses direction of all [[Rigid Material|boundary-condition rigid particles]] moving at constant velocity (''i.e''., they have [[Rigid Material#Material Properties|set direction 1 to 7]] and do not use any [[Rigid Material#Material Properties|setting functions]]). This style will unload until the load or traction (on loaded particles) or displacement (on moving rigid particles) returns to zero at which point the analysis will stop (the analysis, however, may stop sooner if the [[MPM Methods and Simulation Timing#Input Commands|maximum time]] is reached before loading returns to zero).&lt;br /&gt;
* &amp;lt;tt&amp;gt;hold&amp;lt;/tt&amp;gt; (or 1): Stops all linearly increasing [[Setting Forces and Fluxes|loads or tractions]] (see [[Boundary Condition Styles|&amp;quot;linear&amp;quot; style]] in particle loads) at the current values and sets all [[Rigid Material|boundary-condition rigid particles]] moving at constant velocity (''i.e''., they have [[Rigid Material#Material Properties|set direction 1 to 7]] and do not use any [[Rigid Material#Material Properties|setting functions]]) to zero velocity. The analysis continues until [[MPM Methods and Simulation Timing#Input Commands|maximum time]] is reached.&lt;br /&gt;
&lt;br /&gt;
The default &amp;lt;tt&amp;gt;(style)&amp;lt;/tt&amp;gt; is to reverse loads, tractions, and particles to unload the specimen (as implied by the task name). Notice that &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;hold&amp;lt;/tt&amp;gt; affects only selected types of boundary conditions. The task has no affect on other types of [[MPM Input Files#Boundary Conditions|boundary conditions]].&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;tt&amp;gt;(holdTime)&amp;lt;/tt&amp;gt; is set to a positive number, it gives a time (in [[ConsistentUnits Command#Legacy and Consistent Units|alt time units]]) to hold at current conditions before applying the task's action. The &amp;lt;tt&amp;gt;(hold)&amp;lt;/tt&amp;gt; parameter only applies when &amp;lt;tt&amp;gt;(style)&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;abort&amp;lt;/tt&amp;gt;. The hold phase will only hold boundary conditions that can be reversed (see &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; optoins above). After the hold phase is done, the &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; style will unload to zero as described above and the &amp;lt;tt&amp;gt;abort&amp;lt;/tt&amp;gt; style will stop the analysis.  The default &amp;lt;tt&amp;gt;(holdTime)&amp;lt;/tt&amp;gt; is zero (or no hold phase).&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4655</id>
		<title>LoadControl Custom Task</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4655"/>
		<updated>2016-04-26T23:27:29Z</updated>

		<summary type="html">&lt;p&gt;Chadh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[MPM Input Files#Custom Tasks|custom task]] run a load control simulation based on calculations contact or reaction forces. .&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task needs either [[MPM Global Archiving Options|global contact]] or [[MPM Global Archiving Options|global reaction]] for the specified [[Rigid Material|Rigid material]] depending on if contact for that material is enabled.&lt;br /&gt;
&lt;br /&gt;
This CustomTask tries to achieve the load requested from the user-inputted function by adjusting the velocity of that material. It does that by dynamically estimating the relationship between the displacement and load and then uses a PID control algorithm to adjust the velocity.&lt;br /&gt;
&lt;br /&gt;
== Task Scheduling ==&lt;br /&gt;
&lt;br /&gt;
In scripted files, a &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task is scheduled with the following block:&lt;br /&gt;
&lt;br /&gt;
 CustomTask LoadControl&lt;br /&gt;
 Parameter velocity, (velocity)&lt;br /&gt;
 Parameter material, (int)&lt;br /&gt;
 Parameter direction, (int)&lt;br /&gt;
 Parameter MaxVelocity,(number)&lt;br /&gt;
 Parameter Load_Function (user-inputted function)&lt;br /&gt;
 Parameter Kp,(number)&lt;br /&gt;
 Parameter Ki,(number)&lt;br /&gt;
 Parameter smooth,(number)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, these task options are scheduled using &amp;lt;tt&amp;gt;&amp;lt;Schedule&amp;gt;&amp;lt;/tt&amp;gt; elements, which must be within the single &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Schedule name='LoadControl'&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='velocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='material'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='direction'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='MaxVelocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Load_Function (function)'/&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Kp'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Ki'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='smooth'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are the parameters that this custom task needs to operate:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;velocity&amp;lt;/tt&amp;gt; - This is the starting velocity of the simulation for the specified  [[Rigid Material|Rigid material]]. The sign of this parameter is probably more important than its value, as long as it is something reasonable. It is needed for initializing the load control.&lt;br /&gt;
* &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt; - The material number of the [[Rigid Material|Rigid material]] to be controlled.&lt;br /&gt;
* &amp;lt;tt&amp;gt;direction&amp;lt;/tt&amp;gt; - An integer [1,2,3] to choose the direction to consider for velocity and load.&lt;br /&gt;
* &amp;lt;tt&amp;gt;MaxVelocity/tt&amp;gt; - A positive number that limits the velocity of the controlled material - defaults to 5 m/s.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Load_Funtction/tt&amp;gt; - A [[user-inputted]] function for this CustomTask to match.&lt;br /&gt;
When the task triggers on a [[MPM Global Archiving Options|global archive quantity]], these parameters determine its trigger point&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;(quant)&amp;lt;/tt&amp;gt; - gives the name of the [[MPM Global Archiving Options|global archive quantity]] to use a trigger. In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, the quantiy name must be embedded in the parameter name, such as &amp;lt;tt&amp;gt;'global sxx'&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* &amp;lt;tt&amp;gt;(matOrBCID)&amp;lt;/tt&amp;gt; - if the desired [[MPM Global Archiving Options|global archive quantity]] is defined for a specific material or for a specific boundary condition, you must enter that [[Material Command Block|material ID]] &lt;br /&gt;
&lt;br /&gt;
=== Task Action ===&lt;br /&gt;
&lt;br /&gt;
Once the specified crack length is reached (and all crack propagation stops) or the critical [[MPM Global Archiving Options|global archive quantity]] is reached, the task performs various actions specified by the &amp;lt;tt&amp;gt;(style)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;(hold)&amp;lt;/tt&amp;gt; parameters. Scripted files can enter text for the style, but &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files must use the &amp;lt;tt&amp;gt;(styleNumber)&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; (or 0): Reverses all linearly increasing [[Setting Forces and Fluxes|loads or tractions]] (see [[Boundary Condition Styles|&amp;quot;linear&amp;quot; style]] in particle loads) and reverses direction of all [[Rigid Material|boundary-condition rigid particles]] moving at constant velocity (''i.e''., they have [[Rigid Material#Material Properties|set direction 1 to 7]] and do not use any [[Rigid Material#Material Properties|setting functions]]). This style will unload until the load or traction (on loaded particles) or displacement (on moving rigid particles) returns to zero at which point the analysis will stop (the analysis, however, may stop sooner if the [[MPM Methods and Simulation Timing#Input Commands|maximum time]] is reached before loading returns to zero).&lt;br /&gt;
* &amp;lt;tt&amp;gt;hold&amp;lt;/tt&amp;gt; (or 1): Stops all linearly increasing [[Setting Forces and Fluxes|loads or tractions]] (see [[Boundary Condition Styles|&amp;quot;linear&amp;quot; style]] in particle loads) at the current values and sets all [[Rigid Material|boundary-condition rigid particles]] moving at constant velocity (''i.e''., they have [[Rigid Material#Material Properties|set direction 1 to 7]] and do not use any [[Rigid Material#Material Properties|setting functions]]) to zero velocity. The analysis continues until [[MPM Methods and Simulation Timing#Input Commands|maximum time]] is reached.&lt;br /&gt;
&lt;br /&gt;
The default &amp;lt;tt&amp;gt;(style)&amp;lt;/tt&amp;gt; is to reverse loads, tractions, and particles to unload the specimen (as implied by the task name). Notice that &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;hold&amp;lt;/tt&amp;gt; affects only selected types of boundary conditions. The task has no affect on other types of [[MPM Input Files#Boundary Conditions|boundary conditions]].&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;tt&amp;gt;(holdTime)&amp;lt;/tt&amp;gt; is set to a positive number, it gives a time (in [[ConsistentUnits Command#Legacy and Consistent Units|alt time units]]) to hold at current conditions before applying the task's action. The &amp;lt;tt&amp;gt;(hold)&amp;lt;/tt&amp;gt; parameter only applies when &amp;lt;tt&amp;gt;(style)&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;abort&amp;lt;/tt&amp;gt;. The hold phase will only hold boundary conditions that can be reversed (see &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; optoins above). After the hold phase is done, the &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; style will unload to zero as described above and the &amp;lt;tt&amp;gt;abort&amp;lt;/tt&amp;gt; style will stop the analysis.  The default &amp;lt;tt&amp;gt;(holdTime)&amp;lt;/tt&amp;gt; is zero (or no hold phase).&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4654</id>
		<title>LoadControl Custom Task</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4654"/>
		<updated>2016-04-26T23:09:07Z</updated>

		<summary type="html">&lt;p&gt;Chadh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[MPM Input Files#Custom Tasks|custom task]] run a load control simulation based on calculations contact or reaction forces. .&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task needs either [[MPM Global Archiving Options|global contact]] or [[MPM Global Archiving Options|global reaction]] for the specified [[Rigid Material|Rigid material]] depending on if [[Contact|contact]] for that material is enabled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The possible task actions are to reverse various boundary conditions, hold at current boundary conditions, stop the analysis, or continue (with no change except crack propagation stops).&lt;br /&gt;
&lt;br /&gt;
== Task Scheduling ==&lt;br /&gt;
&lt;br /&gt;
In scripted files, a &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task based on crack lengths or on a [[MPM Global Archiving Options|global archive quantity]] are scheduled with one of the two following blocks:&lt;br /&gt;
&lt;br /&gt;
 CustomTask LoadControl&lt;br /&gt;
 Parameter velocity, (velocity)&lt;br /&gt;
 Parameter material, (int)&lt;br /&gt;
 Parameter direction, (int)&lt;br /&gt;
 Parameter MaxVelocity,(number)&lt;br /&gt;
 Parameter Load_Function (user-inputted function)&lt;br /&gt;
 Parameter Kp,(number)&lt;br /&gt;
 Parameter Ki,(number)&lt;br /&gt;
 Parameter smooth,(number)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, these two task options are scheduled using &amp;lt;tt&amp;gt;&amp;lt;Schedule&amp;gt;&amp;lt;/tt&amp;gt; elements, which must be within the single &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Schedule name='LoadControl'&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='velocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='material'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='direction'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='MaxVelocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Load_Function (function)'/&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Kp'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Ki'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='smooth'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When the task triggers on crack length, these two parameters determine its trigger point:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;(length)&amp;lt;/tt&amp;gt; - specifies the maximum crack length (in [[ConsistentUnits Command#Legacy and Consistent Units|length units]]). Once this length is reached, all crack propagation will stop.&lt;br /&gt;
&lt;br /&gt;
When the task triggers on a [[MPM Global Archiving Options|global archive quantity]], these parameters determine its trigger point&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;(quant)&amp;lt;/tt&amp;gt; - gives the name of the [[MPM Global Archiving Options|global archive quantity]] to use a trigger. In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, the quantiy name must be embedded in the parameter name, such as &amp;lt;tt&amp;gt;'global sxx'&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* &amp;lt;tt&amp;gt;(matOrBCID)&amp;lt;/tt&amp;gt; - if the desired [[MPM Global Archiving Options|global archive quantity]] is defined for a specific material or for a specific boundary condition, you must enter that [[Material Command Block|material ID]] &lt;br /&gt;
&lt;br /&gt;
=== Task Action ===&lt;br /&gt;
&lt;br /&gt;
Once the specified crack length is reached (and all crack propagation stops) or the critical [[MPM Global Archiving Options|global archive quantity]] is reached, the task performs various actions specified by the &amp;lt;tt&amp;gt;(style)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;(hold)&amp;lt;/tt&amp;gt; parameters. Scripted files can enter text for the style, but &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files must use the &amp;lt;tt&amp;gt;(styleNumber)&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; (or 0): Reverses all linearly increasing [[Setting Forces and Fluxes|loads or tractions]] (see [[Boundary Condition Styles|&amp;quot;linear&amp;quot; style]] in particle loads) and reverses direction of all [[Rigid Material|boundary-condition rigid particles]] moving at constant velocity (''i.e''., they have [[Rigid Material#Material Properties|set direction 1 to 7]] and do not use any [[Rigid Material#Material Properties|setting functions]]). This style will unload until the load or traction (on loaded particles) or displacement (on moving rigid particles) returns to zero at which point the analysis will stop (the analysis, however, may stop sooner if the [[MPM Methods and Simulation Timing#Input Commands|maximum time]] is reached before loading returns to zero).&lt;br /&gt;
* &amp;lt;tt&amp;gt;hold&amp;lt;/tt&amp;gt; (or 1): Stops all linearly increasing [[Setting Forces and Fluxes|loads or tractions]] (see [[Boundary Condition Styles|&amp;quot;linear&amp;quot; style]] in particle loads) at the current values and sets all [[Rigid Material|boundary-condition rigid particles]] moving at constant velocity (''i.e''., they have [[Rigid Material#Material Properties|set direction 1 to 7]] and do not use any [[Rigid Material#Material Properties|setting functions]]) to zero velocity. The analysis continues until [[MPM Methods and Simulation Timing#Input Commands|maximum time]] is reached.&lt;br /&gt;
&lt;br /&gt;
The default &amp;lt;tt&amp;gt;(style)&amp;lt;/tt&amp;gt; is to reverse loads, tractions, and particles to unload the specimen (as implied by the task name). Notice that &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;hold&amp;lt;/tt&amp;gt; affects only selected types of boundary conditions. The task has no affect on other types of [[MPM Input Files#Boundary Conditions|boundary conditions]].&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;tt&amp;gt;(holdTime)&amp;lt;/tt&amp;gt; is set to a positive number, it gives a time (in [[ConsistentUnits Command#Legacy and Consistent Units|alt time units]]) to hold at current conditions before applying the task's action. The &amp;lt;tt&amp;gt;(hold)&amp;lt;/tt&amp;gt; parameter only applies when &amp;lt;tt&amp;gt;(style)&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;abort&amp;lt;/tt&amp;gt;. The hold phase will only hold boundary conditions that can be reversed (see &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; optoins above). After the hold phase is done, the &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; style will unload to zero as described above and the &amp;lt;tt&amp;gt;abort&amp;lt;/tt&amp;gt; style will stop the analysis.  The default &amp;lt;tt&amp;gt;(holdTime)&amp;lt;/tt&amp;gt; is zero (or no hold phase).&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4653</id>
		<title>LoadControl Custom Task</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4653"/>
		<updated>2016-04-26T22:45:51Z</updated>

		<summary type="html">&lt;p&gt;Chadh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[MPM Input Files#Custom Tasks|custom task]] run a load control simulation based on calculations contact or reaction forces. .&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task can either monitor  [[MPM Global Archiving Options|global archive quantity]] and responds as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The possible task actions are to reverse various boundary conditions, hold at current boundary conditions, stop the analysis, or continue (with no change except crack propagation stops).&lt;br /&gt;
&lt;br /&gt;
== Task Scheduling ==&lt;br /&gt;
&lt;br /&gt;
In scripted files, a &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task based on crack lengths or on a [[MPM Global Archiving Options|global archive quantity]] are scheduled with one of the two following blocks:&lt;br /&gt;
&lt;br /&gt;
 CustomTask LoadControl&lt;br /&gt;
 Parameter velocity, (velocity)&lt;br /&gt;
 Parameter material, (int)&lt;br /&gt;
 Parameter direction, (int)&lt;br /&gt;
 Parameter MaxVelocity,(number)&lt;br /&gt;
 Parameter Load_Function (user-inputted function)&lt;br /&gt;
 Parameter Kp,(number)&lt;br /&gt;
 Parameter Ki,(number)&lt;br /&gt;
 Parameter smooth,(number)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, these two task options are scheduled using &amp;lt;tt&amp;gt;&amp;lt;Schedule&amp;gt;&amp;lt;/tt&amp;gt; elements, which must be within the single &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Schedule name='LoadControl'&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='velocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='material'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='direction'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='MaxVelocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Load_Function (function)'/&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Kp'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Ki'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='smooth'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When the task triggers on crack length, these two parameters determine its trigger point:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;(length)&amp;lt;/tt&amp;gt; - specifies the maximum crack length (in [[ConsistentUnits Command#Legacy and Consistent Units|length units]]). Once this length is reached, all crack propagation will stop.&lt;br /&gt;
&lt;br /&gt;
When the task triggers on a [[MPM Global Archiving Options|global archive quantity]], these parameters determine its trigger point&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;(quant)&amp;lt;/tt&amp;gt; - gives the name of the [[MPM Global Archiving Options|global archive quantity]] to use a trigger. In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, the quantiy name must be embedded in the parameter name, such as &amp;lt;tt&amp;gt;'global sxx'&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* &amp;lt;tt&amp;gt;(matOrBCID)&amp;lt;/tt&amp;gt; - if the desired [[MPM Global Archiving Options|global archive quantity]] is defined for a specific material or for a specific boundary condition, you must enter that [[Material Command Block|material ID]] &lt;br /&gt;
&lt;br /&gt;
=== Task Action ===&lt;br /&gt;
&lt;br /&gt;
Once the specified crack length is reached (and all crack propagation stops) or the critical [[MPM Global Archiving Options|global archive quantity]] is reached, the task performs various actions specified by the &amp;lt;tt&amp;gt;(style)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;(hold)&amp;lt;/tt&amp;gt; parameters. Scripted files can enter text for the style, but &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files must use the &amp;lt;tt&amp;gt;(styleNumber)&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; (or 0): Reverses all linearly increasing [[Setting Forces and Fluxes|loads or tractions]] (see [[Boundary Condition Styles|&amp;quot;linear&amp;quot; style]] in particle loads) and reverses direction of all [[Rigid Material|boundary-condition rigid particles]] moving at constant velocity (''i.e''., they have [[Rigid Material#Material Properties|set direction 1 to 7]] and do not use any [[Rigid Material#Material Properties|setting functions]]). This style will unload until the load or traction (on loaded particles) or displacement (on moving rigid particles) returns to zero at which point the analysis will stop (the analysis, however, may stop sooner if the [[MPM Methods and Simulation Timing#Input Commands|maximum time]] is reached before loading returns to zero).&lt;br /&gt;
* &amp;lt;tt&amp;gt;hold&amp;lt;/tt&amp;gt; (or 1): Stops all linearly increasing [[Setting Forces and Fluxes|loads or tractions]] (see [[Boundary Condition Styles|&amp;quot;linear&amp;quot; style]] in particle loads) at the current values and sets all [[Rigid Material|boundary-condition rigid particles]] moving at constant velocity (''i.e''., they have [[Rigid Material#Material Properties|set direction 1 to 7]] and do not use any [[Rigid Material#Material Properties|setting functions]]) to zero velocity. The analysis continues until [[MPM Methods and Simulation Timing#Input Commands|maximum time]] is reached.&lt;br /&gt;
&lt;br /&gt;
The default &amp;lt;tt&amp;gt;(style)&amp;lt;/tt&amp;gt; is to reverse loads, tractions, and particles to unload the specimen (as implied by the task name). Notice that &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;hold&amp;lt;/tt&amp;gt; affects only selected types of boundary conditions. The task has no affect on other types of [[MPM Input Files#Boundary Conditions|boundary conditions]].&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;tt&amp;gt;(holdTime)&amp;lt;/tt&amp;gt; is set to a positive number, it gives a time (in [[ConsistentUnits Command#Legacy and Consistent Units|alt time units]]) to hold at current conditions before applying the task's action. The &amp;lt;tt&amp;gt;(hold)&amp;lt;/tt&amp;gt; parameter only applies when &amp;lt;tt&amp;gt;(style)&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;abort&amp;lt;/tt&amp;gt;. The hold phase will only hold boundary conditions that can be reversed (see &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; optoins above). After the hold phase is done, the &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; style will unload to zero as described above and the &amp;lt;tt&amp;gt;abort&amp;lt;/tt&amp;gt; style will stop the analysis.  The default &amp;lt;tt&amp;gt;(holdTime)&amp;lt;/tt&amp;gt; is zero (or no hold phase).&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4652</id>
		<title>LoadControl Custom Task</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4652"/>
		<updated>2016-04-26T22:40:45Z</updated>

		<summary type="html">&lt;p&gt;Chadh: /* Task Scheduling */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[MPM Input Files#Custom Tasks|custom task]] to adjust velocity of Rigid particles to achieve a load put on them. .&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task can either monitor  [[MPM Global Archiving Options|global archive quantity]] and responds as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The possible task actions are to reverse various boundary conditions, hold at current boundary conditions, stop the analysis, or continue (with no change except crack propagation stops).&lt;br /&gt;
&lt;br /&gt;
== Task Scheduling ==&lt;br /&gt;
&lt;br /&gt;
In scripted files, a &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task based on crack lengths or on a [[MPM Global Archiving Options|global archive quantity]] are scheduled with one of the two following blocks:&lt;br /&gt;
&lt;br /&gt;
 CustomTask LoadControl&lt;br /&gt;
 Parameter velocity, (velocity)&lt;br /&gt;
 Parameter material, (int)&lt;br /&gt;
 Parameter direction, (int)&lt;br /&gt;
 Parameter MaxVelocity,(number)&lt;br /&gt;
 Parameter Load_Function (user-inputted function)&lt;br /&gt;
 Parameter Kp,(number)&lt;br /&gt;
 Parameter Ki,(number)&lt;br /&gt;
 Parameter smooth,(number)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, these two task options are scheduled using &amp;lt;tt&amp;gt;&amp;lt;Schedule&amp;gt;&amp;lt;/tt&amp;gt; elements, which must be within the single &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Schedule name='LoadControl'&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='velocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='material'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='direction'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='MaxVelocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Load_Function (function)'/&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Kp'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Ki'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='smooth'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When the task triggers on crack length, these two parameters determine its trigger point:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;(length)&amp;lt;/tt&amp;gt; - specifies the maximum crack length (in [[ConsistentUnits Command#Legacy and Consistent Units|length units]]). Once this length is reached, all crack propagation will stop.&lt;br /&gt;
&lt;br /&gt;
When the task triggers on a [[MPM Global Archiving Options|global archive quantity]], these parameters determine its trigger point&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;(quant)&amp;lt;/tt&amp;gt; - gives the name of the [[MPM Global Archiving Options|global archive quantity]] to use a trigger. In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, the quantiy name must be embedded in the parameter name, such as &amp;lt;tt&amp;gt;'global sxx'&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* &amp;lt;tt&amp;gt;(matOrBCID)&amp;lt;/tt&amp;gt; - if the desired [[MPM Global Archiving Options|global archive quantity]] is defined for a specific material or for a specific boundary condition, you must enter that [[Material Command Block|material ID]] &lt;br /&gt;
&lt;br /&gt;
=== Task Action ===&lt;br /&gt;
&lt;br /&gt;
Once the specified crack length is reached (and all crack propagation stops) or the critical [[MPM Global Archiving Options|global archive quantity]] is reached, the task performs various actions specified by the &amp;lt;tt&amp;gt;(style)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;(hold)&amp;lt;/tt&amp;gt; parameters. Scripted files can enter text for the style, but &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files must use the &amp;lt;tt&amp;gt;(styleNumber)&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; (or 0): Reverses all linearly increasing [[Setting Forces and Fluxes|loads or tractions]] (see [[Boundary Condition Styles|&amp;quot;linear&amp;quot; style]] in particle loads) and reverses direction of all [[Rigid Material|boundary-condition rigid particles]] moving at constant velocity (''i.e''., they have [[Rigid Material#Material Properties|set direction 1 to 7]] and do not use any [[Rigid Material#Material Properties|setting functions]]). This style will unload until the load or traction (on loaded particles) or displacement (on moving rigid particles) returns to zero at which point the analysis will stop (the analysis, however, may stop sooner if the [[MPM Methods and Simulation Timing#Input Commands|maximum time]] is reached before loading returns to zero).&lt;br /&gt;
* &amp;lt;tt&amp;gt;hold&amp;lt;/tt&amp;gt; (or 1): Stops all linearly increasing [[Setting Forces and Fluxes|loads or tractions]] (see [[Boundary Condition Styles|&amp;quot;linear&amp;quot; style]] in particle loads) at the current values and sets all [[Rigid Material|boundary-condition rigid particles]] moving at constant velocity (''i.e''., they have [[Rigid Material#Material Properties|set direction 1 to 7]] and do not use any [[Rigid Material#Material Properties|setting functions]]) to zero velocity. The analysis continues until [[MPM Methods and Simulation Timing#Input Commands|maximum time]] is reached.&lt;br /&gt;
&lt;br /&gt;
The default &amp;lt;tt&amp;gt;(style)&amp;lt;/tt&amp;gt; is to reverse loads, tractions, and particles to unload the specimen (as implied by the task name). Notice that &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;hold&amp;lt;/tt&amp;gt; affects only selected types of boundary conditions. The task has no affect on other types of [[MPM Input Files#Boundary Conditions|boundary conditions]].&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;tt&amp;gt;(holdTime)&amp;lt;/tt&amp;gt; is set to a positive number, it gives a time (in [[ConsistentUnits Command#Legacy and Consistent Units|alt time units]]) to hold at current conditions before applying the task's action. The &amp;lt;tt&amp;gt;(hold)&amp;lt;/tt&amp;gt; parameter only applies when &amp;lt;tt&amp;gt;(style)&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;abort&amp;lt;/tt&amp;gt;. The hold phase will only hold boundary conditions that can be reversed (see &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; optoins above). After the hold phase is done, the &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; style will unload to zero as described above and the &amp;lt;tt&amp;gt;abort&amp;lt;/tt&amp;gt; style will stop the analysis.  The default &amp;lt;tt&amp;gt;(holdTime)&amp;lt;/tt&amp;gt; is zero (or no hold phase).&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4651</id>
		<title>LoadControl Custom Task</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4651"/>
		<updated>2016-04-26T22:38:48Z</updated>

		<summary type="html">&lt;p&gt;Chadh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[MPM Input Files#Custom Tasks|custom task]] to adjust velocity of Rigid particles to achieve a load put on them. .&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task can either monitor  [[MPM Global Archiving Options|global archive quantity]] and responds as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The possible task actions are to reverse various boundary conditions, hold at current boundary conditions, stop the analysis, or continue (with no change except crack propagation stops).&lt;br /&gt;
&lt;br /&gt;
== Task Scheduling ==&lt;br /&gt;
&lt;br /&gt;
In scripted files, a &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task based on crack lengths or on a [[MPM Global Archiving Options|global archive quantity]] are scheduled with one of the two following blocks:&lt;br /&gt;
&lt;br /&gt;
 CustomTask LoadControl&lt;br /&gt;
 Parameter velocity, (velocity)&lt;br /&gt;
 Parameter material, (int)&lt;br /&gt;
 Parameter direction, (int)&lt;br /&gt;
 Parameter MaxVelocity,(number)&lt;br /&gt;
 Parameter Load_Function (user-inputted function)&lt;br /&gt;
 Parameter Kp,(number)&lt;br /&gt;
 Parameter Ki,(number)&lt;br /&gt;
 Parameter smooth,(number)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, these two task options are scheduled using &amp;lt;tt&amp;gt;&amp;lt;Schedule&amp;gt;&amp;lt;/tt&amp;gt; elements, which must be within the single &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Schedule name='LoadControl'&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='velocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='material'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='direction'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='MaxVelocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Load_Function (function)'/&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Kp'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Ki'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='smooth'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When the task triggers on crack length, these two parameters determine its trigger point:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;(length)&amp;lt;/tt&amp;gt; - specifies the maximum crack length (in [[ConsistentUnits Command#Legacy and Consistent Units|length units]]). Once this length is reached, all crack propagation will stop.&lt;br /&gt;
* &amp;lt;tt&amp;gt;(number)&amp;lt;/tt&amp;gt; - gives the crack number to watch. When that crack reaches the specified maximum length, the task will take effect. Alternatively, &amp;lt;tt&amp;gt;(number)&amp;lt;/tt&amp;gt; can be zero which causes the task to take effect when any crack reaches the specified maximum length. The default value is 0 or to watch all cracks.&lt;br /&gt;
&lt;br /&gt;
When the task triggers on a [[MPM Global Archiving Options|global archive quantity]], these parameters determine its trigger point&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;(quant)&amp;lt;/tt&amp;gt; - gives the name of the [[MPM Global Archiving Options|global archive quantity]] to use a trigger. In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, the quantiy name must be embedded in the parameter name, such as &amp;lt;tt&amp;gt;'global sxx'&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* &amp;lt;tt&amp;gt;(matOrBCID)&amp;lt;/tt&amp;gt; - if the desired [[MPM Global Archiving Options|global archive quantity]] is defined for a specific material or for a specific boundary condition, you must enter that [[Material Command Block|material ID]] or [[Setting Velocity, Temperature, and Concentration#Boundary Condition ID|boundary condition ID]] in this parameter (otherwise the entered quantity will not match the [[MPM Global Archiving Options|global archive quantity]]).&lt;br /&gt;
* &amp;lt;tt&amp;gt;(matOrBCNum)&amp;lt;/tt&amp;gt; - in &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, the specific material or boundary condition ID must be specified by number (in cannot use a [[Material Command Block|material ID]]).&lt;br /&gt;
* &amp;lt;tt&amp;gt;(value)&amp;lt;/tt&amp;gt; - specifies the critical value for the [[MPM Global Archiving Options|global archive quantity]] to trigger the task action. If the number is positive, the action is triggered when the quantity reaches the value; if it is negative, the action is triggered when the quantity become more negative than the value.&lt;br /&gt;
&lt;br /&gt;
=== Task Action ===&lt;br /&gt;
&lt;br /&gt;
Once the specified crack length is reached (and all crack propagation stops) or the critical [[MPM Global Archiving Options|global archive quantity]] is reached, the task performs various actions specified by the &amp;lt;tt&amp;gt;(style)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;(hold)&amp;lt;/tt&amp;gt; parameters. Scripted files can enter text for the style, but &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files must use the &amp;lt;tt&amp;gt;(styleNumber)&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; (or 0): Reverses all linearly increasing [[Setting Forces and Fluxes|loads or tractions]] (see [[Boundary Condition Styles|&amp;quot;linear&amp;quot; style]] in particle loads) and reverses direction of all [[Rigid Material|boundary-condition rigid particles]] moving at constant velocity (''i.e''., they have [[Rigid Material#Material Properties|set direction 1 to 7]] and do not use any [[Rigid Material#Material Properties|setting functions]]). This style will unload until the load or traction (on loaded particles) or displacement (on moving rigid particles) returns to zero at which point the analysis will stop (the analysis, however, may stop sooner if the [[MPM Methods and Simulation Timing#Input Commands|maximum time]] is reached before loading returns to zero).&lt;br /&gt;
* &amp;lt;tt&amp;gt;hold&amp;lt;/tt&amp;gt; (or 1): Stops all linearly increasing [[Setting Forces and Fluxes|loads or tractions]] (see [[Boundary Condition Styles|&amp;quot;linear&amp;quot; style]] in particle loads) at the current values and sets all [[Rigid Material|boundary-condition rigid particles]] moving at constant velocity (''i.e''., they have [[Rigid Material#Material Properties|set direction 1 to 7]] and do not use any [[Rigid Material#Material Properties|setting functions]]) to zero velocity. The analysis continues until [[MPM Methods and Simulation Timing#Input Commands|maximum time]] is reached.&lt;br /&gt;
* &amp;lt;tt&amp;gt;continue&amp;lt;/tt&amp;gt; (or 2): All loads, tractions, and rigid particles continue unchanged. Only the crack propagation stops. Because this action only stops crack propagation, it is meaningless when the tasks is triggered on a [[MPM Global Archiving Options|global archive quantity]], and is therefore not allowed for such tasks.&lt;br /&gt;
* &amp;lt;tt&amp;gt;abort&amp;lt;/tt&amp;gt; (or 3): The analysis terminates.&lt;br /&gt;
&lt;br /&gt;
The default &amp;lt;tt&amp;gt;(style)&amp;lt;/tt&amp;gt; is to reverse loads, tractions, and particles to unload the specimen (as implied by the task name). Notice that &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;hold&amp;lt;/tt&amp;gt; affects only selected types of boundary conditions. The task has no affect on other types of [[MPM Input Files#Boundary Conditions|boundary conditions]].&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;tt&amp;gt;(holdTime)&amp;lt;/tt&amp;gt; is set to a positive number, it gives a time (in [[ConsistentUnits Command#Legacy and Consistent Units|alt time units]]) to hold at current conditions before applying the task's action. The &amp;lt;tt&amp;gt;(hold)&amp;lt;/tt&amp;gt; parameter only applies when &amp;lt;tt&amp;gt;(style)&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;abort&amp;lt;/tt&amp;gt;. The hold phase will only hold boundary conditions that can be reversed (see &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; optoins above). After the hold phase is done, the &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; style will unload to zero as described above and the &amp;lt;tt&amp;gt;abort&amp;lt;/tt&amp;gt; style will stop the analysis.  The default &amp;lt;tt&amp;gt;(holdTime)&amp;lt;/tt&amp;gt; is zero (or no hold phase).&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4650</id>
		<title>LoadControl Custom Task</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4650"/>
		<updated>2016-04-26T22:37:01Z</updated>

		<summary type="html">&lt;p&gt;Chadh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[MPM Input Files#Custom Tasks|custom task]] to adjust velocity of Rigid particles to achieve a load put on them. .&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task can either monitor  [[MPM Global Archiving Options|global archive quantity]] and responds as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The possible task actions are to reverse various boundary conditions, hold at current boundary conditions, stop the analysis, or continue (with no change except crack propagation stops).&lt;br /&gt;
&lt;br /&gt;
== Task Scheduling ==&lt;br /&gt;
&lt;br /&gt;
In scripted files, a &amp;lt;tt&amp;gt;ReverseLoad&amp;lt;/tt&amp;gt; custom task based on crack lengths or on a [[MPM Global Archiving Options|global archive quantity]] are scheduled with one of the two following blocks:&lt;br /&gt;
&lt;br /&gt;
 CustomTask LoadControl&lt;br /&gt;
 Parameter velocity, (velocity)&lt;br /&gt;
 Parameter material, (int)&lt;br /&gt;
 Parameter direction, (int)&lt;br /&gt;
 Parameter MaxVelocity,(number)&lt;br /&gt;
 Parameter Load_Function (user-inputted function)&lt;br /&gt;
 Parameter Kp,(number)&lt;br /&gt;
 Parameter Ki,(number)&lt;br /&gt;
 Parameter smooth,(number)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, these two task options are scheduled using &amp;lt;tt&amp;gt;&amp;lt;Schedule&amp;gt;&amp;lt;/tt&amp;gt; elements, which must be within the single &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Schedule name='LoadControl'&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;Parameter name='velocity'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='material'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='direction'&amp;gt;(int)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Load_Function (function)'/&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Kp'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='Ki'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='smooth'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When the task triggers on crack length, these two parameters determine its trigger point:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;(length)&amp;lt;/tt&amp;gt; - specifies the maximum crack length (in [[ConsistentUnits Command#Legacy and Consistent Units|length units]]). Once this length is reached, all crack propagation will stop.&lt;br /&gt;
* &amp;lt;tt&amp;gt;(number)&amp;lt;/tt&amp;gt; - gives the crack number to watch. When that crack reaches the specified maximum length, the task will take effect. Alternatively, &amp;lt;tt&amp;gt;(number)&amp;lt;/tt&amp;gt; can be zero which causes the task to take effect when any crack reaches the specified maximum length. The default value is 0 or to watch all cracks.&lt;br /&gt;
&lt;br /&gt;
When the task triggers on a [[MPM Global Archiving Options|global archive quantity]], these parameters determine its trigger point&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;(quant)&amp;lt;/tt&amp;gt; - gives the name of the [[MPM Global Archiving Options|global archive quantity]] to use a trigger. In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, the quantiy name must be embedded in the parameter name, such as &amp;lt;tt&amp;gt;'global sxx'&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* &amp;lt;tt&amp;gt;(matOrBCID)&amp;lt;/tt&amp;gt; - if the desired [[MPM Global Archiving Options|global archive quantity]] is defined for a specific material or for a specific boundary condition, you must enter that [[Material Command Block|material ID]] or [[Setting Velocity, Temperature, and Concentration#Boundary Condition ID|boundary condition ID]] in this parameter (otherwise the entered quantity will not match the [[MPM Global Archiving Options|global archive quantity]]).&lt;br /&gt;
* &amp;lt;tt&amp;gt;(matOrBCNum)&amp;lt;/tt&amp;gt; - in &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, the specific material or boundary condition ID must be specified by number (in cannot use a [[Material Command Block|material ID]]).&lt;br /&gt;
* &amp;lt;tt&amp;gt;(value)&amp;lt;/tt&amp;gt; - specifies the critical value for the [[MPM Global Archiving Options|global archive quantity]] to trigger the task action. If the number is positive, the action is triggered when the quantity reaches the value; if it is negative, the action is triggered when the quantity become more negative than the value.&lt;br /&gt;
&lt;br /&gt;
=== Task Action ===&lt;br /&gt;
&lt;br /&gt;
Once the specified crack length is reached (and all crack propagation stops) or the critical [[MPM Global Archiving Options|global archive quantity]] is reached, the task performs various actions specified by the &amp;lt;tt&amp;gt;(style)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;(hold)&amp;lt;/tt&amp;gt; parameters. Scripted files can enter text for the style, but &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files must use the &amp;lt;tt&amp;gt;(styleNumber)&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; (or 0): Reverses all linearly increasing [[Setting Forces and Fluxes|loads or tractions]] (see [[Boundary Condition Styles|&amp;quot;linear&amp;quot; style]] in particle loads) and reverses direction of all [[Rigid Material|boundary-condition rigid particles]] moving at constant velocity (''i.e''., they have [[Rigid Material#Material Properties|set direction 1 to 7]] and do not use any [[Rigid Material#Material Properties|setting functions]]). This style will unload until the load or traction (on loaded particles) or displacement (on moving rigid particles) returns to zero at which point the analysis will stop (the analysis, however, may stop sooner if the [[MPM Methods and Simulation Timing#Input Commands|maximum time]] is reached before loading returns to zero).&lt;br /&gt;
* &amp;lt;tt&amp;gt;hold&amp;lt;/tt&amp;gt; (or 1): Stops all linearly increasing [[Setting Forces and Fluxes|loads or tractions]] (see [[Boundary Condition Styles|&amp;quot;linear&amp;quot; style]] in particle loads) at the current values and sets all [[Rigid Material|boundary-condition rigid particles]] moving at constant velocity (''i.e''., they have [[Rigid Material#Material Properties|set direction 1 to 7]] and do not use any [[Rigid Material#Material Properties|setting functions]]) to zero velocity. The analysis continues until [[MPM Methods and Simulation Timing#Input Commands|maximum time]] is reached.&lt;br /&gt;
* &amp;lt;tt&amp;gt;continue&amp;lt;/tt&amp;gt; (or 2): All loads, tractions, and rigid particles continue unchanged. Only the crack propagation stops. Because this action only stops crack propagation, it is meaningless when the tasks is triggered on a [[MPM Global Archiving Options|global archive quantity]], and is therefore not allowed for such tasks.&lt;br /&gt;
* &amp;lt;tt&amp;gt;abort&amp;lt;/tt&amp;gt; (or 3): The analysis terminates.&lt;br /&gt;
&lt;br /&gt;
The default &amp;lt;tt&amp;gt;(style)&amp;lt;/tt&amp;gt; is to reverse loads, tractions, and particles to unload the specimen (as implied by the task name). Notice that &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;hold&amp;lt;/tt&amp;gt; affects only selected types of boundary conditions. The task has no affect on other types of [[MPM Input Files#Boundary Conditions|boundary conditions]].&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;tt&amp;gt;(holdTime)&amp;lt;/tt&amp;gt; is set to a positive number, it gives a time (in [[ConsistentUnits Command#Legacy and Consistent Units|alt time units]]) to hold at current conditions before applying the task's action. The &amp;lt;tt&amp;gt;(hold)&amp;lt;/tt&amp;gt; parameter only applies when &amp;lt;tt&amp;gt;(style)&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;abort&amp;lt;/tt&amp;gt;. The hold phase will only hold boundary conditions that can be reversed (see &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; optoins above). After the hold phase is done, the &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; style will unload to zero as described above and the &amp;lt;tt&amp;gt;abort&amp;lt;/tt&amp;gt; style will stop the analysis.  The default &amp;lt;tt&amp;gt;(holdTime)&amp;lt;/tt&amp;gt; is zero (or no hold phase).&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
	<entry>
		<id>http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4649</id>
		<title>LoadControl Custom Task</title>
		<link rel="alternate" type="text/html" href="http://osupdocs.forestry.oregonstate.edu/index.php?title=LoadControl_Custom_Task&amp;diff=4649"/>
		<updated>2016-04-26T22:24:05Z</updated>

		<summary type="html">&lt;p&gt;Chadh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[MPM Input Files#Custom Tasks|custom task]] to adjust velocity of Rigid particles to match an inputted function.&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;LoadControl&amp;lt;/tt&amp;gt; custom task can either monitor  [[MPM Global Archiving Options|global archive quantity]] and responds as follows:&lt;br /&gt;
&lt;br /&gt;
# Crack length monitoring: Once any crack or a specified crack reaches a specified crack length, all [[Crack Propagation Commands|crack propagation]] stops and the task's action is triggered&lt;br /&gt;
# Global quantity monitoring: Once the specified global quantity passes a critical value, the task's action is triggered.&lt;br /&gt;
&lt;br /&gt;
The possible task actions are to reverse various boundary conditions, hold at current boundary conditions, stop the analysis, or continue (with no change except crack propagation stops).&lt;br /&gt;
&lt;br /&gt;
== Task Scheduling ==&lt;br /&gt;
&lt;br /&gt;
In scripted files, a &amp;lt;tt&amp;gt;ReverseLoad&amp;lt;/tt&amp;gt; custom task based on crack lengths or on a [[MPM Global Archiving Options|global archive quantity]] are scheduled with one of the two following blocks:&lt;br /&gt;
&lt;br /&gt;
 CustomTask LoadControl&lt;br /&gt;
 Parameter maxLength,(length)&lt;br /&gt;
 Parameter crackNumber,(number)&lt;br /&gt;
 Parameter style,(style)&lt;br /&gt;
 Parameter hold,(holdTIme)&lt;br /&gt;
 &lt;br /&gt;
 CustomTask ReverseLoad&lt;br /&gt;
 Parameter quantity,(quant)&lt;br /&gt;
 Parameter material,(matOrBCID)&lt;br /&gt;
 Parameter maxValue,(value)&lt;br /&gt;
 Parameter style,(style)&lt;br /&gt;
 Parameter hold,(holdTIme)&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, these two task options are scheduled using &amp;lt;tt&amp;gt;&amp;lt;Schedule&amp;gt;&amp;lt;/tt&amp;gt; elements, which must be within the single &amp;lt;tt&amp;gt;&amp;lt;CustomTasks&amp;gt;&amp;lt;/tt&amp;gt; block:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Schedule name='ReverseLoad'&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='maxLength'&amp;gt;(length)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='crackNumber'&amp;gt;(number)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='style'&amp;gt;(styleNumber)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='hold'&amp;gt;(holdTime)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;Schedule name='ReverseLoad'&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='global (quant)'/&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='mat'&amp;gt;(matOrBCNum)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='maxValue'&amp;gt;(value)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='style'&amp;gt;(styleNumber)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
    &amp;lt;Parameter name='hold'&amp;gt;(holdTime)&amp;lt;/Parameter&amp;gt;&lt;br /&gt;
 &amp;lt;/Schedule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the task triggers on crack length, these two parameters determine its trigger point:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;(length)&amp;lt;/tt&amp;gt; - specifies the maximum crack length (in [[ConsistentUnits Command#Legacy and Consistent Units|length units]]). Once this length is reached, all crack propagation will stop.&lt;br /&gt;
* &amp;lt;tt&amp;gt;(number)&amp;lt;/tt&amp;gt; - gives the crack number to watch. When that crack reaches the specified maximum length, the task will take effect. Alternatively, &amp;lt;tt&amp;gt;(number)&amp;lt;/tt&amp;gt; can be zero which causes the task to take effect when any crack reaches the specified maximum length. The default value is 0 or to watch all cracks.&lt;br /&gt;
&lt;br /&gt;
When the task triggers on a [[MPM Global Archiving Options|global archive quantity]], these parameters determine its trigger point&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;(quant)&amp;lt;/tt&amp;gt; - gives the name of the [[MPM Global Archiving Options|global archive quantity]] to use a trigger. In &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, the quantiy name must be embedded in the parameter name, such as &amp;lt;tt&amp;gt;'global sxx'&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* &amp;lt;tt&amp;gt;(matOrBCID)&amp;lt;/tt&amp;gt; - if the desired [[MPM Global Archiving Options|global archive quantity]] is defined for a specific material or for a specific boundary condition, you must enter that [[Material Command Block|material ID]] or [[Setting Velocity, Temperature, and Concentration#Boundary Condition ID|boundary condition ID]] in this parameter (otherwise the entered quantity will not match the [[MPM Global Archiving Options|global archive quantity]]).&lt;br /&gt;
* &amp;lt;tt&amp;gt;(matOrBCNum)&amp;lt;/tt&amp;gt; - in &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files, the specific material or boundary condition ID must be specified by number (in cannot use a [[Material Command Block|material ID]]).&lt;br /&gt;
* &amp;lt;tt&amp;gt;(value)&amp;lt;/tt&amp;gt; - specifies the critical value for the [[MPM Global Archiving Options|global archive quantity]] to trigger the task action. If the number is positive, the action is triggered when the quantity reaches the value; if it is negative, the action is triggered when the quantity become more negative than the value.&lt;br /&gt;
&lt;br /&gt;
=== Task Action ===&lt;br /&gt;
&lt;br /&gt;
Once the specified crack length is reached (and all crack propagation stops) or the critical [[MPM Global Archiving Options|global archive quantity]] is reached, the task performs various actions specified by the &amp;lt;tt&amp;gt;(style)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;(hold)&amp;lt;/tt&amp;gt; parameters. Scripted files can enter text for the style, but &amp;lt;tt&amp;gt;XML&amp;lt;/tt&amp;gt; files must use the &amp;lt;tt&amp;gt;(styleNumber)&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; (or 0): Reverses all linearly increasing [[Setting Forces and Fluxes|loads or tractions]] (see [[Boundary Condition Styles|&amp;quot;linear&amp;quot; style]] in particle loads) and reverses direction of all [[Rigid Material|boundary-condition rigid particles]] moving at constant velocity (''i.e''., they have [[Rigid Material#Material Properties|set direction 1 to 7]] and do not use any [[Rigid Material#Material Properties|setting functions]]). This style will unload until the load or traction (on loaded particles) or displacement (on moving rigid particles) returns to zero at which point the analysis will stop (the analysis, however, may stop sooner if the [[MPM Methods and Simulation Timing#Input Commands|maximum time]] is reached before loading returns to zero).&lt;br /&gt;
* &amp;lt;tt&amp;gt;hold&amp;lt;/tt&amp;gt; (or 1): Stops all linearly increasing [[Setting Forces and Fluxes|loads or tractions]] (see [[Boundary Condition Styles|&amp;quot;linear&amp;quot; style]] in particle loads) at the current values and sets all [[Rigid Material|boundary-condition rigid particles]] moving at constant velocity (''i.e''., they have [[Rigid Material#Material Properties|set direction 1 to 7]] and do not use any [[Rigid Material#Material Properties|setting functions]]) to zero velocity. The analysis continues until [[MPM Methods and Simulation Timing#Input Commands|maximum time]] is reached.&lt;br /&gt;
* &amp;lt;tt&amp;gt;continue&amp;lt;/tt&amp;gt; (or 2): All loads, tractions, and rigid particles continue unchanged. Only the crack propagation stops. Because this action only stops crack propagation, it is meaningless when the tasks is triggered on a [[MPM Global Archiving Options|global archive quantity]], and is therefore not allowed for such tasks.&lt;br /&gt;
* &amp;lt;tt&amp;gt;abort&amp;lt;/tt&amp;gt; (or 3): The analysis terminates.&lt;br /&gt;
&lt;br /&gt;
The default &amp;lt;tt&amp;gt;(style)&amp;lt;/tt&amp;gt; is to reverse loads, tractions, and particles to unload the specimen (as implied by the task name). Notice that &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;hold&amp;lt;/tt&amp;gt; affects only selected types of boundary conditions. The task has no affect on other types of [[MPM Input Files#Boundary Conditions|boundary conditions]].&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;tt&amp;gt;(holdTime)&amp;lt;/tt&amp;gt; is set to a positive number, it gives a time (in [[ConsistentUnits Command#Legacy and Consistent Units|alt time units]]) to hold at current conditions before applying the task's action. The &amp;lt;tt&amp;gt;(hold)&amp;lt;/tt&amp;gt; parameter only applies when &amp;lt;tt&amp;gt;(style)&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;abort&amp;lt;/tt&amp;gt;. The hold phase will only hold boundary conditions that can be reversed (see &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; optoins above). After the hold phase is done, the &amp;lt;tt&amp;gt;reverse&amp;lt;/tt&amp;gt; style will unload to zero as described above and the &amp;lt;tt&amp;gt;abort&amp;lt;/tt&amp;gt; style will stop the analysis.  The default &amp;lt;tt&amp;gt;(holdTime)&amp;lt;/tt&amp;gt; is zero (or no hold phase).&lt;/div&gt;</summary>
		<author><name>Chadh</name></author>
	</entry>
</feed>