I don't know how to write the code to find Mu1 and Mu2. Can you help me Please?.

This is what I tried.

enter image description here

enter image description hereenter image description here

  • 2
    $\begingroup$ Please do not post images of your work. Please post your actual Mathematica code in the form of text that can be copied and pasted into a Mathematica notebook. Without such, it will be difficult to reproduce your problem and to experiment with possible solutions. $\endgroup$ – m_goldberg Apr 6 '19 at 23:39
  • $\begingroup$ I'm sorry, i can't post the Mathematical code because I don't know to make easier posted here. I'm newbie :( But maybe you can download this file here : [link] (drive.google.com/file/d/1BtDzvN8FA190BFKj5pjd1C58BGUQlujm/…) @m_goldberg $\endgroup$ – Habib Asnan Apr 7 '19 at 0:06
  • 1
    $\begingroup$ Maybe you should start with a simple Minimization problem, get that working, and then slowly make it more complex. For example, you are missing a comma after the {mu1, mu2} term. $\endgroup$ – bill s Apr 7 '19 at 0:56
  • $\begingroup$ You may find this meta Q&A helpful for formatting code. $\endgroup$ – Michael E2 Apr 7 '19 at 2:01
  • $\begingroup$ The error message {Method mu1, Method mu2} -> NelderMead is not a valid variable is showing you that it is multiplying {mu1, mu2} and Method -> "NelderMead" together. Make sure to add a comma after the } and before Method. I don't know if that will make the code work, but it's one problem that I see. $\endgroup$ – MassDefect Apr 7 '19 at 3:06

(μ2-m2)))Q/P+(K11 a+K22 b)((Q/P)^2/2-(Q/P)/λ+(1-Exp[-λ Q/P])/
(K11 δ1^2+K22 δ2^2+K12 δ1 δ2))(Q/P-(1-Exp[-λ Q/P])/λ)+
(K11(2 δ1 θ1)+K22(2 δ2 θ2)+K22(δ1 θ2+δ2 θ1)))(0.5(Q/P)^2-
(Q/P)/λ+(1-Exp[-λ Q/P])/λ^2)+(K11 θ1^2+K22 θ2^2+K12 θ1 θ2)*
((Q/P)^3/3-(Q/P)^2/λ+2(Q/P)/λ^2+2(1-Exp[-λ Q/P])/λ^3))+(d/Q*
CR((μ1+δ1)Q/P-δ1(1-Exp[-λ Q/P])/λ+θ1(0.5(Q/P)^2-(Q/P)/λ+
(1-Exp[-λ Q/P])/λ^2))+CR((μ2+δ2)Q/P-δ2(1-Exp[-λ Q/P])/λ+θ2*
(0.5(Q/P)^2-(Q/P)/λ+(1-Exp[-λ Q/P])/λ^2)))+(S d/Q)+(r*CR*
((μ1+δ1)Q/P-δ1(1-Exp[-λ Q/P])/λ+δ1(0.5(Q/P)^2-(Q/P)/λ+
(1-Exp[-λ Q/P])/λ^2))+CR((μ2+δ2)Q/P-δ2(1-Exp[-λ Q/P])/λ+θ2*
(0.5(Q/P)^2-(Q/P)/λ+(1-Exp[-λ Q/P])/λ^2))d/Q)+(d/Q CA)+
(d/Q(α Q/P+0.5 β(Q/P)^2)),
m1-4 σ1<μ1<m1+4 σ1&&m2-4 σ2<μ2<m2+4 σ2},{μ1,μ2},Method->"NelderMead"]

almost instantly returns

{16893.179829995734, {μ1 -> 8.355626751067383, μ2 -> 18.704839508932128}}


Several errors in my translation found and fixed. The result is much closer, but still not exactly the same, as what the author found.

Please check all this very carefully, character by character, to try to understand why I made each change and to make certain that I have made no mistakes. I expect that additional errors remain.

| improve this answer | |
  • $\begingroup$ Thank you so much @Bill that's helpful. But in the paper that I review show the result Mu1 = 8 and Mu2 = 19.34 $\endgroup$ – Habib Asnan Apr 7 '19 at 13:00
  • $\begingroup$ Woww, Thank you so much @Bill it works when I tried again with your code. And sorry for my slow respond because I can't open my PC since 3 days before. Once again thank you very much $\endgroup$ – Habib Asnan Apr 10 '19 at 15:04
  • $\begingroup$ I'm sorry @Bill, maybe I need your help again with the same question about this function. There is some revision with the function, but I tried again with your answer it doesn't work well. Maybe you can see my newest quoestion about the revision of my function. Thanks $\endgroup$ – Habib Asnan Apr 30 '19 at 3:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.