I asked this question Mark Minimum Value in DensityPlot. Another question has come up, or better said, a task: Find the minimum of a function.
I haven't been able to write the needed code for that, because
I want to find the minimum of the function ueislexpl[epsilon, h, n1, n2]
with respect to n1
and n2
. But ueislexpl
calls the function eislminx2[epsilon_?NumericQ, n2_?NumericQ]
, which needs a value for n2
. For tests one may use epsilon = 0.1
. Is there a way of finding the minimum of ueislexpl[epsilon, h, n1, n2]
with respect to n1
and n2
?
eislexpl[gamma_,epsilon_, n2_, x_] :=
28 (epsilon)^2 - 1 + ((-2 Log[E^(1/2) x])/x^2 + (27/10(gamma - epsilon))/x +
(10 epsilon^2 n2^(3/2))/x^(3/2))
eislminx2[gamma_,epsilon_?NumericQ, n2_?NumericQ] :=
(
minx = FindArgMin[{eislexpl[gamma,epsilon, n2, x], 0 < x}, x];
eislexpl[gamma,epsilon, n2, minx]
)
ueislexpl[gamma_,epsilon_, h_, n1_, n2_] :=
n1 (40 epsilon^2 - 1) + (1 -127/100 ) (1 + (n1 - 1) HeavisideTheta[1 - n1] -
(-1 + Exp[-(n1 - 1)]) HeavisideTheta[n1 - 1]) + n2 eislminx2[gamma,epsilon, n2] +
(h - n1 - n2) (28 epsilon^2 - 1)
The function ueislexpl[gamma,epsilon, h, n1, n2]
describes the energy of a specific type of crystal morphology. It is used to predict specific growth modes. h
is the total amount of deposited material h=n1 + n2 + n3
. There are 3 different types of structures that can appear. A so called wetting layer, 3d-structures of kind 1 (3ds1) and 3d-structures of kind 2 (3ds2). n1
is the amount of material comprising the wetting layer, n2
is the amount of material comprising 3ds1, and whats left of h
, h-n1-n2=n3
is the material comprising 3ds2. In my simulations i usually use values of h within [0,8], meaning that values for n1 and n2 are too within [0,8]. I saw, that i oversimplified my functions, so i edited them, now there is one variable more, gamma
, the surface energy per unit area, epsilon is the strain.
My goal is to plot 2 different phase diagrams, one that shows the energy as a function of h
and epsilon
and the second one showing the energy as a function of h
and gamma
.
The function eislminx2[gamma,epsilon, n2]
determines the energetic minimum for a given set of gamma
,epsilon
and n2
- so i can't give constant values for them, they need to be variables. And the function that determines the energetic minimum of the system (minimum of ueislexpl[gamma,epsilon, h, n1, n2]) needs to be able to deal with that, is that possible? Determining the formal minimum of ueislexpl[gamma,epsilon, h, n1, n2], leaving some variables blank for the moment, as if i took the derivative of y=a x^2 + x
, dy/dx=2 a x + 1=0
- even though i dont know the value of a i can formally take the derivative and later on plug in values for a and determine the minimum. Or is there another way?