Student Support Forum: 'Constrained global maxima of a piece-wise integ...' topicStudent Support Forum > General > "Constrained global maxima of a piece-wise integ..."

 Help | Reply To Topic
 Author Comment/Response Sune Gaulshoj 10/10/07 05:01am Hi, I have an issue I have piece-wise function f(y) from which I want to maximize the integral according to the weights xs, xc and xp. I use NIntegrate[f[y], {y, -.5, .5}] to find the integral, but after that I want to find the global constrained maxima of this intrgral according to the variables xs, xc and xp under the constraints that {xs, xc, xp} >= 0 and (xs+xp+xc) < 1. I tried using NMaximize, but I cannot make it work. Any suggestions? f[y_] := Piecewise[{{a[y], y < \[Tau]}, {b[y], \[Tau] <= y <= \[Lambda]}, {c[y], y > \[Lambda]}}] where a[xx_] := (\[Pi]*\[Gamma])^(-1)*(xp*((Subscript[K, P] - st*Exp[252*xx])/Subscript[BS, P])^(1/252) + xs*Exp[xx] + (1 - xs - xp - xc)*Exp[r/252])^\[Gamma]*nig[xx] b[xx_] := (\[Pi]*\[Gamma])^(-1)*(xs*Exp[xx] + (1 - xs - xp - xc)* Exp[r/252])^\[Gamma]*nig[xx] c[xx_] := (\[Pi]*\[Gamma])^(-1)*(xc*((st*Exp[252*xx] - Subscript[K, C])/Subscript[BS, C])^(1/252) + xs*Exp[xx] + (1 - xs - xp - xc)*Exp[r/252])^\[Gamma]*nig[xx] Attachment: Model optimization-mathematica forum.nb, URL: Gaulshoj@gmail.com,
 Help | Reply To Topic