| Author |
Comment/Response |
samaneh
|
01/08/13 02:41am
hi,
I have minimization objective function wich consists of two related function. please see attachement.
I write codes in Mathematica. however it dose not work well.I think the result of first function dose not use correctly in calculating second function.
could you please help me to modify it.
Clear[x, s1, s2]; Remove[c1, c2]
h1 = 0.5; b1 = 10; \[Mu] = 10; \[Sigma] = 5; l1 = 5; l2 = 5; h2 = 0.5;
\[Mu]1 = (l1 + 1)*\[Mu];
\[Sigma]1 = Sqrt[l1 + 1]*\[Sigma];
\[Mu]2 = (l2)*\[Mu];
\[Sigma]2 = Sqrt[l2]*\[Sigma];
c1 = Integrate[
h1*(s1 - x)*PDF[NormalDistribution[\[Mu]1, \[Sigma]1], x], {x, 0,
s1}] +
Integrate[(b1 + h1 + h2)*(x - s1)*
PDF[NormalDistribution[\[Mu]1, \[Sigma]1], x], {x, s1, Infinity}]
NMinimize[c1, s1];
w = NArgMin[c1, s1]
cost1 = NMinValue[c1, s1]
c2 = h2*(s2 - \[Mu]2) -
NIntegrate[
cost1*PDF[NormalDistribution[\[Mu]2, \[Sigma]2], u], {u, s2 - w,
Infinity}] +
h1*NIntegrate[(s2 - u - x)*
PDF[NormalDistribution[\[Mu]1, \[Sigma]1], x]*
PDF[NormalDistribution[\[Mu]3, \[Sigma]3], u], {x, 0, w} {u,
s2 - w, Infinity}] +
(b1 + h1 + h2)*
Integrate[(x - s2 - u)*
PDF[NormalDistribution[\[Mu]1, \[Sigma]1], x]*
PDF[NormalDistribution[\[Mu]2, \[Sigma]2], u], {x, w,
Infinity} {u, s2 - w, Infinity}]
cost2 = NMinimize[c2, s2]
Attachment: question.pdf, URL: , |
|