Chapter 4 Software Tools
4.1 Parameter Inference and Analysis of Parameters Using Mathematica
Each model discussed in this thesis has either two or three fundamental parameters that com- pletely determine the final shape of the curve. The parameters are chosen from G1, G2, η1,
orη2. For a given model, it is expected that each parameter may have a strong effect on the
shape of the curve (that is, changing the value of this parameter by small amounts causes larger changes to the shape) or may have only a weak affect on the shape of the curve (the curve will look similar across a wide range of values for this parameter). Knowing which parameters have strong and weak affects may help in analyzing the parameter fittings of experimental data. For example, it may influence the decision of when to hold a known value constant versus when to let it iterate.
To get an idea of how each parameter affects the shape of a given model, Mathematica can be used to create dynamic plots of each model. The function ‘Manipulate’ is used in conjunction with ‘Plot’ to create a graph of the model along with slider bars for each parameter in the model. The graph changes as the sliders are altered. The code for this is only two lines. The first defines the equation and the second calls ‘Manipulate’ and defines ranges for each
slider.
F u n c t i o n N a m e [ param1 , . . . ] : = e q u a t i o n
M a n i p u l a t e [ P l o t [ F u n c t i o n N a m e [ p a r a m e t e r s ] ,{t , 0 , 2 0}, P l o t R a n g e
−>{0 ,5}] ,{Param1 , min , max} , . . . ]
For example, to generate a dynamic plot of the compliance for the Two Parameter Voigt model, the following can be used:
CRVoigt2 [ G , n ] : = ( 1 / G)∗( U n i t S t e p [ t ]∗( 1 − Exp [−( t∗G) / n ] ) −
U n i t S t e p [ t − t e n d ]∗( 1 − Exp [−(( t − t e n d )∗G) / n ] ) )
M a n i p u l a t e [ P l o t [ CRVoigt2 [G, e t a ] , {t , 0 , 2 0}, P l o t R a n g e −> {0 , 1 . 5}] , {G, 0 , 5}, {e t a , 0 , 5}]
After adjusting the parameter values, the output will look similar to Figure 4.1 below.
Figure 4.1: A screen shot of the Manipulate function in Mathematica applied to plotting the Two Parameter Voigt model with dynamic parameters.
Parameter sensitivity is affected by values of other parameters
Through observation, it is found that the effects of a parameter on the graph depend on several factors. First, characterizing the effects of a parameter depends on whether the parameter is in a high or low regime as well as whether the remaining parameters are at high or low values. Consider the Three Parameter Voigt model,
γ(t) = 1 G2H(t−t0) · G1+G2 G1 − G2 G1e −(t−t0)G1 η ¸ − 1 G2H(t−t1) · G1+G2 G1 − G2 G1e −(t−t1)G1 η ¸
We observe thatη, which is seen in the denominator of the exponential, affects the sharpness of the curve - smaller values of ηcause a larger exponent and generate a steeper curve. The parameterG1is also related to the exponent, as well as the magnitude of the entire curve. Thus,
whenηis very small (leading toward a sharp curvature), small values ofG1 counteractηand
lead to a more gradual curvature. In this realm, small changes in G1 can cause the curve to
look very different. Forη=2 andG2=2, compare the curves in Figure 4.2 whenG1changes
from 0.5 to 1.5, a step of one unit.
On the other hand, whenG1is larger thanη, it amplifies the effect thatηalready has on the
graph and produces a very steep initial rise followed by a sudden flattening out. In this realm (smallη, largeG1), the ratio Gη1 is already so large that even large changes inG1 have a very
small effect on the overall shape of the curve. Forη=2 and G2=2, compare the curves in
Figure 4.3 whenG1changes from 20 to 30, a step of 10 units.
This interaction between parameters can be explained by realizing that, in each model, the pieces that really affect the shape of the graph are functions of the basic parametersG1,G2,η1
orη2. As a simple example, consider the equation of a line, y=mx+b. Here, mdefines the
slope andbdefines the y-intercept. However, if you are concerned with two different parame- ters, sayhandg, wherey= hgx+h, then the slope is no longer defined by a single parameter. The linear viscoelastic models considered here are for the most part more complicated than a
Figure 4.2: The Three Parameter Voigt model changes noticeably for small changes inG1when
G1is small compared toη.
Figure 4.3: The Three Parameter Voigt model changes very little for changes inG1whenG1is
simple line, and thus the interactions between parameters are even more intricate. Parameter analysis is affected by which graphical features are important
Parameter sensitivity also depends on what features of the graph are important for analyzing the data. For instance, in fluid models often the slope of the compliance curve after a long time step stress or the value to which the fluid recovers after stress is removed are important indicators of the viscosity of the fluid. If this is all that needs to be observed from the data, then any parameters not directly affecting the long time slope may be unimportant. It could be said that these parameters are not sensitive to the prediction of the viscosity. However, any parameters affecting the end behavior will need to be considered more closely.
The Maxwell-Jeffrey model is a linear viscoelastic fluid model which exhibits a constant slope in long times while constant stress is applied, and recovers to a positive steady state after the removal of stress. It can easily be observed using Mathematica that out of the three parameters creating the Maxwell-Jeffrey model, G,η1 andη2, onlyη2 changes the long time
end behavior. This is verified by looking at the equation,
γ(t) = 1 G[H(t−t0)−H(t−t1)] + 1 η2[(t−t0)H(t−t0)−(t−t1)H(t−t1)] −1 G · H(t−t0)e− (t−t0)G η1 −H(t−t 1)e− (t−t1)G η1 ¸
and noticing thatη2is the only parameter affecting the second term, which is the only term that
does not go to zero ast increases. The largerη2 is, the smaller the slope and/or steady state
value of the end behavior. Thus, if you are trying to model this end behavior, you will need to estimateη2to high accuracy while the other parameters could be allowed to vary greatly.
Figure 4.4: Forη2=14 (left figure), the slope of the end behavior (as well as the steady state
value) are much higher than for η2=40 (right figure). G affects the overall magnitude of
the stress-on part of the graph, andη1 affects the curvature, but neither Gnor η1 affects end
behavior.
Parameter inference is influenced by the fitting region
During the fitting process, parameter sensitivity is also influenced by the size of the region you are fitting to, and which particular features are captured in this region. The region must be large enough to capture some defining features of the data, but must be small enough to prevent the fitting algorithm from crashing. That is, you cannot always simply fit over the entire domain of the data. It is important to consider these two things (length and position of fitting interval) because parameters do not affect all regions of a graph in the same way.
Reconsider the Maxwell-Jeffrey model. In the table below, large error bars were introduced to the Maxwell-Jeffrey model having the true parametersG=1,η1=2, andη2=12 to try to
determine how much random error could be present while still predicting accurate parameter values. Data was generated for 10%, 30% and 50% random error, and the parameter fitting gui from (Xu2009) was used to recover the parameters in the intervalt= (0,5).
Figure 4.5: Even at 50% random error,Gandη1 remain close to their true values of 1 and 2,
respectively. However,η2deviates, likely due to the early fitting window.
in the previous section. We have demonstrated that η2 is responsible for changing the end
behavior. However, the fitting interval(0,5)does not include information on the end behavior. That is, a good fit can be made in(0,5)for a range of values of η2because changes inη2do
not affect this part of the graph. Figure 4.6 demonstrates how values ofη2from 8 to 15 do not
change the fitting region very greatly.
Related to this issue is the usage of fitting intervals which are too small. The same Maxwell- Jeffrey model with parametersG=1,η1=2, andη2=12 was fit in the small intervalt= (7,8).
This returned parameter estimates of G∗=0.012, η∗1=−0.678, and η∗2=0.558. Figure 4.7 shows how the the two models align very closely on the interval (7,8); however, the model generated byG∗,η∗
1andη∗2is vastly different from the original data, as Figure 4.8 shows.