0
$\begingroup$

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

$\endgroup$

closed as off-topic by Daniel Lichtblau, m_goldberg, MarcoB, Henrik Schumacher, eyorble Apr 8 at 17:20

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question cannot be answered without additional information. Questions on problems in code must describe the specific problem and include valid code to reproduce it. Any data used for programming examples should be embedded in the question or code to generate the (fake) data must be included." – Daniel Lichtblau, m_goldberg, MarcoB, Henrik Schumacher, eyorble
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 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 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 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 at 0:56
  • $\begingroup$ You may find this meta Q&A helpful for formatting code. $\endgroup$ – Michael E2 Apr 7 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 at 3:06
3
$\begingroup$
K11=30;K12=20;K22=10;m1=8;m2=20;δ1=1;δ2=0.5;θ1=1;θ2=0.4;
a=0.5;b=0.5;λ=0.05;α=10;β=3;P=500;d=300;CR=4;S=100;r=0.2;
H=5;CA=30;Q=131;σ1=Sqrt[a];σ2=Sqrt[b];

NMinimize[{(d/Q(K11(a+(μ1-m1)^2)+K22(b(μ2-m2)^2)+K12((μ1-m1)*
(μ2-m2)))Q/P+(K11 a+K22 b)((Q/P)^2/2-(Q/P)/λ+(1-Exp[-λ Q/P])/
λ^2)+((K11(2(μ1-m1)δ1)+K22(2(μ2-m2)δ2)+K12((μ1-m1)δ2+(μ2-m2)δ1))+
(K11 δ1^2+K22 δ2^2+K12 δ1 δ2))(Q/P-(1-Exp[-λ Q/P])/λ)+
((K11(2(μ1-m1)θ1)+K22(2(μ2-m2)θ2)+K12((μ1-m1)θ2+(μ2-m2)θ1))+
(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}}

EDIT

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.

$\endgroup$
  • $\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 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 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 at 3:14

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