Hi there,
I would like to find the variables V0 and sv that can solve the 2 given equations (eq1 and eq2) but I keep on getting error result with the Erfc function or ‘False’ in all my attempts.
My constraints and my equations are:
se = 0.5
K = 5
r = 0.02
E0 = 3
d1 = 1/se (Log [V0/K] + (r + 0.5 sv^2))
d2 = d1 - sv
eq1 = V0 CDF[NormalDistribution[0, 1], d1] -
K Exp[-r] CDF[NormalDistribution[0, 1], d2] - E0 == 0
eq2 = sv == (se E0)/(V0 CDF[NormalDistribution[0, 1], d1])
FindRoot {{eq1, eq2}, {{V0, 12}, {sv, 0.1}}
I apologize if the question is too trivial but i literally just started using Mathematica and definitely a lot to learn
vaungureanu
(Valeriu Ungureanu)
July 10, 2016, 9:39am
2
In[1]:= se = 0.5
K = 5
r = 0.02
E0 = 3
d1 = 1/se (Log[V0/K] + (r + 0.5 sv^2))
d2 = d1 - sv
eq1 = V0 CDF[NormalDistribution[0, 1], d1] - K Exp[-r] CDF[NormalDistribution[0, 1], d2] - E0 == 0
eq2 = sv == (se E0)/(V0 CDF[NormalDistribution[0, 1], d1])
FindRoot[{eq1, eq2}, {{V0, 12}, {sv, 0.1}}]
Out[1]= 0.5
Out[2]= 5
Out[3]= 0.02
Out[4]= 3
Out[5]= 2. (0.02 + 0.5 sv^2 + Log[V0/5])
Out[6]= -sv + 2. (0.02 + 0.5 sv^2 + Log[V0/5])
Out[7]= -3 + 1/2 V0 Erfc[-1.41421 (0.02 + 0.5 sv^2 + Log[V0/5])] - 2.4505 Erfc[(sv - 2. (0.02 + 0.5 sv^2 + Log[V0/5]))/Sqrt[2]] == 0
Out[8]= sv == 3./(V0 Erfc[-1.41421 (0.02 + 0.5 sv^2 + Log[V0/5])])
Out[9]= {V0 -> 8.09739, sv -> 0.217056}
Thanks!
Follow-up question: FindRoot [{eq1, eq2}, {{V0, 12}, {sv, 0.1}}] shouldn’t indicate that V0 has to be more than 12?
I am looking for a solution close to V0 = 12.45 and sv=0.17.
vaungureanu
(Valeriu Ungureanu)
July 10, 2016, 10:13am
4
{{V0, 12}, {sv, 0.1}} are initial values for variables V0 and sv, used by iterative numerical method .
Even you put as initial {{V0, 12.45}, {sv, 0.17}} in FindRoot[] function, the solution remains {V0 → 8.09739, sv → 0.217056}
So, you must consider once again parameters of you system if your intuition suggest other solution.