# FindMaximum failing

**URL:** <https://community.wolfram.com/t/findmaximum-failing/4371>\
**Category:** Questions\
**Tags:** optimization, numerical-computation\
**Created:** [December 19, 2014, 5:11pm UTC](https://community.wolfram.com/t/findmaximum-failing/4371 "2014-12-19T17:11:18Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![bpreeti2002](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@bpreeti2002](https://community.wolfram.com/u/bpreeti2002)\
**Post date:** [December 19, 2014, 5:11pm UTC](https://community.wolfram.com/t/findmaximum-failing/4371/1 "2014-12-19T17:11:18Z")

</div>

Hi all..

I am trying to find the maximum point for the following graph.. it is visually clear that it is around 1300..

I was wondering whats the command for it…

Is it FindMaximum [{Cp[[Delta]]}, {[Delta], 0, 1}]]? i tried this and it dint work ..

Any help would help..

Thanks in advance..

[Untitled.bmp](https://community.wolfram.com/uploads/short-url/9Zel4I4mG7mzvHi4w1QngHgNmlO.bmp) (171 KB)

---

<div class="post-metadata">

**Author:** ![sblinder](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/sblinder/32/17861_2.png) [@sblinder](https://community.wolfram.com/u/sblinder)\
**Post date:** [December 19, 2014, 5:56pm UTC](https://community.wolfram.com/t/findmaximum-failing/4371/2 "2014-12-19T17:56:04Z")

</div>

Find derivative

```
D[Cp[\[Delta]], \[Delta]]

```

Then solve

Solve[D[Cp[[Delta]], [Delta]]==0, [Delta]]

This will give value of delta at maximum.

---

<div class="post-metadata">

**Author:** ![bpreeti2002](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@bpreeti2002](https://community.wolfram.com/u/bpreeti2002)\
**Post date:** [December 19, 2014, 6:25pm UTC](https://community.wolfram.com/t/findmaximum-failing/4371/3 "2014-12-19T18:25:10Z")

</div>

Sorry…I get an error when i tried that command… Is it something like what i have attached in the file..?

---

<div class="post-metadata">

**Author:** ![bpreeti2002](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@bpreeti2002](https://community.wolfram.com/u/bpreeti2002)\
**Post date:** [December 19, 2014, 6:26pm UTC](https://community.wolfram.com/t/findmaximum-failing/4371/4 "2014-12-19T18:26:38Z")

</div>

actually no output displays..

---

<div class="post-metadata">

**Author:** ![danl](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/danl/32/41267_2.png) [@danl](https://community.wolfram.com/u/danl)\
**Post date:** [December 19, 2014, 8:00pm UTC](https://community.wolfram.com/t/findmaximum-failing/4371/5 "2014-12-19T20:00:28Z")

</div>

(1) Post actual code with the question. A picture of code is not a usable substitute.

(2) From the notebook I can see there is an undefined `\[Mu]m` (as well as an unused `\[Mu]p`).

(3) The `Solve` syntax is incorrect. While this is not a forum for issues of basic Mathematica syntax,  
I will remark that you get no output because the input never reaches the stage of evaluation.

(4) You define `Cp` as a function of a dummy variable delta. Also it has `Np`which uses a delta in its definition.  
But these are not the same because it is not that dummy variable: you have a scoping problem. Here is what I mean.

```
Cp[t]

(* Out[21]= -((
 13.2 (-1 + t) (56250. \[Delta]^2 + 24496. \[Delta] \[Mu]m - 
    18723. \[Delta]^2 \[Mu]m - 480. \[Mu]m^2 + 
    540. \[Delta] \[Mu]m^2 - 
    135. \[Delta]^2 \[Mu]m^2))/(\[Delta] (168. \[Delta] - 
    9. \[Delta]^2 + 160. \[Mu]m - 180. \[Delta] \[Mu]m + 
    45. \[Delta]^2 \[Mu]m))) *)

```

---

<div class="post-metadata">

**Author:** ![ccarter](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/ccarter/32/36312_2.png) [@ccarter](https://community.wolfram.com/u/ccarter)\
**Post date:** [December 19, 2014, 8:38pm UTC](https://community.wolfram.com/t/findmaximum-failing/4371/6 "2014-12-19T20:38:18Z")

</div>

Hello,  
While at risk of encouraging those who do not **read the posting guidelines** or the **documentation** …

```
Pn = 40;
\[Mu]p = 0.2;
cp = -Pn (
  0.066 (56250.` \[Delta]^2 + 24496.` \[Delta] \[Mu]m - 
     18723.` \[Delta]^2 \[Mu]m - 480.` \[Mu]m^2 + 
     540.` \[Delta] \[Mu]m^2 - 
     135.` \[Delta]^2 \[Mu]m^2))/(\[Delta] (168.` \[Delta] - 
     9.` \[Delta]^2 + 160.` \[Mu]m - 180.` \[Delta] \[Mu]m + 
     45.` \[Delta]^2 \[Mu]m)) (\[Delta] - 1)/\[Mu]p
temp = cp /. \[Mu]m -> 1
Plot[temp, {\[Delta], 0, 1}]
FindMaximum[temp, \[Delta]]

```

with hopes that I can get someone to look at my CUDA questions on community… sigh.  
WCC

---

<div class="post-metadata">

**Author:** ![bpreeti2002](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@bpreeti2002](https://community.wolfram.com/u/bpreeti2002)\
**Post date:** [December 20, 2014, 8:11am UTC](https://community.wolfram.com/t/findmaximum-failing/4371/7 "2014-12-20T08:11:42Z")

</div>

Sorry in the first hand. yes! i missed to paste the [Mu]m , i was only not sure with the command to be used.  
may be i should read the posting guidelines.. i am only learning mathematica. is there a rule that i cannot ask basic or east questions in this forum?

---

<div class="post-metadata">

**Author:** ![bpreeti2002](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@bpreeti2002](https://community.wolfram.com/u/bpreeti2002)\
**Post date:** [December 20, 2014, 12:53pm UTC](https://community.wolfram.com/t/findmaximum-failing/4371/8 "2014-12-20T12:53:38Z")

</div>

I pasted the picture, only to show what i really want to ask. in this case the syntax to be used..

1. is there even a rule that i cannot ask basic or easy questions in this forum?? in that case, it is a pity for beginners .

---

<div class="post-metadata">

**Author:** ![bpreeti2002](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@bpreeti2002](https://community.wolfram.com/u/bpreeti2002)\
**Post date:** [December 20, 2014, 12:56pm UTC](https://community.wolfram.com/t/findmaximum-failing/4371/9 "2014-12-20T12:56:31Z")

</div>

but thanks it helped. i was only asking if FindMaximum would work.. it worked when i wrote it after plot syntax.

---

<div class="post-metadata">

**Author:** ![ccarter](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/ccarter/32/36312_2.png) [@ccarter](https://community.wolfram.com/u/ccarter)\
**Post date:** [December 20, 2014, 5:04pm UTC](https://community.wolfram.com/t/findmaximum-failing/4371/10 "2014-12-20T17:04:57Z")

</div>

Hello Ash Ash,

I am sorry if my response appeared to be rude to you. It was not my intention. Danny is correct that the probability of getting a response is increased if code can be cut-and-pasted from the post.

I believe that basic questions should be encouraged. However, if the poster makes an effort (to fix syntax, look for a working example in the documentation, and make sure that all variables which be defined are defined), that effort will be rewarded by learning.

---

<div class="post-metadata">

**Author:** ![bpreeti2002](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@bpreeti2002](https://community.wolfram.com/u/bpreeti2002)\
**Post date:** [December 22, 2014, 10:03am UTC](https://community.wolfram.com/t/findmaximum-failing/4371/11 "2014-12-22T10:03:23Z")

</div>

Thanks..

I just have a follow up question..

What would be the command in case if delta is known..  
for example, delta = 0.3 and I need to get the corresponding y axis value..

---

<div class="post-metadata">

**Author:** ![ccarter](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/ccarter/32/36312_2.png) [@ccarter](https://community.wolfram.com/u/ccarter)\
**Post date:** [December 22, 2014, 1:33pm UTC](https://community.wolfram.com/t/findmaximum-failing/4371/12 "2014-12-22T13:33:20Z")

</div>

Hello Ash Ash,  
Perhaps I misunderstand your question. I am assuming that you are no longer interested in a maxima.

To find the value of an expression for a particular value of a parameter, you can use slash-dot with a rule:

```
 expr = a Cos[b x]
   
 expr /. a -> 2
   
 expr /. {a -> 2, x -> 3}
   
 expr /. {a -> 2, b -> 3, x -> Pi}

```

More information can be found here: tutorial/ApplyingTransformationRules

---

<div class="post-metadata">

**Author:** ![bpreeti2002](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@bpreeti2002](https://community.wolfram.com/u/bpreeti2002)\
**Post date:** [December 22, 2014, 7:09pm UTC](https://community.wolfram.com/t/findmaximum-failing/4371/13 "2014-12-22T19:09:02Z")

</div>

thanks! that was clarifying! 🙂
