Message Boards Message Boards

6 Replies
2 Total Likes
View groups...
Share this post:

Why is the Output is the same as my Input !!

Posted 11 years ago
 Minimize[{(c/2 - OverBar[c]/2)^2 + (c*Csc[a + b]*Sin[a]*Sin[b] -
       Csc[OverBar[a] + OverBar[b]]*OverBar[c]*Sin[a]*
        Sin[b])^2, -((b - OverBar[b])/OverBar[b]) >= -h,
      (b - OverBar[b])/OverBar[b] <=
    h, -((a - OverBar[a])/OverBar[a]) >= -h, (a - OverBar[a])/
     OverBar[a] <= h, h - (c - OverBar[c])/OverBar[c] >= -h,
      (c - OverBar[c])/OverBar[c] <= h, c >= 0, a > 0, b > 0,
   OverBar[c] >= 0, OverBar[a] > 0, OverBar[b] > 0, a + b < Pi,
   h > 0}, {c, OverBar[c], a, b, OverBar[a], OverBar[b]}][/b][/b][/b][/b][/b][/b][/b][/b][/b]
6 Replies
Posted 11 years ago
It is interesting that "sin(3x)" does something meaningful in Mma's other input methods.

In so-called free-form input, sin(3x) is recognized and converted into the syntactically correct form (i.e. Sin[3x]). Use "plot sin(3x)", which Mma would not understand at all, emits the correct syntax (i.e. Plot[Sin[4x], {x, -2,2}] as well a nice plot and some other good info.

In "Wolfram | Alpha query" mode, the same syntax is recognized and it emits several nice plots, although it does not supply the Mma syntax (that makes the plots).

Of course, submitting the minimize command above does not get anything meaningful except the various forms the Minimize[] function takes.

BTW, the free-form input can be reached by starting with a single equal-sign. And W|a query mode can be reached by starting with 2 equal-signs.


Congruent Light
POSTED BY: Congruent Light
Posted 11 years ago
Hi Itay,

Yes -- it is sometimes frustrating. But Mathematica is at its heart a symbolic algebra system. In programming in Mathematica there are many instances in which it is useful to work with a symbol which will only be assigned a value later. If Mathematica insisted that every time it evaluated something it obtained a numerical result then most of the true value of the tool would be lost. And there is no good way for it to understand what kind of result an evaluation should achieve in a particular circumstance.

In developing notebooks myself, I often see an evaluation return the input, instead of what I thought I would get. Now it just says to me that Mathematica did not understand the input the way I though it should. Often it means I got the spelling wrong. (The syntax coloring helps here.) But more generally it means that, although I thought I had defined the function, Mathematica does not see it that way. With my own functions, this often means I used an incorrect number of arguments. It means I need to look carefully at the input I provided.

Kind regards,
POSTED BY: David Keith
Posted 11 years ago
This is perhaps pedantic, but . . .

Mathematica is a rules engine. When it evaluates an input, it applies all the rules it has, until it reaches an expression to which no further rules apply. Then it returns that result.  These rules are the total of those built in and those you have added during the session by making assignments. For example Sin(x) is defined, where x is a number, by a built in rule. If you ask for Sin(3), you will get a numerical answer. But if you ask for Sin(x), where x is not defined, then it will return Sin(x). It can't evaluate this further because it does not have a numerical value for x. So it returns the fully evaluated answer, which is still Sin(x). However, if you had earlier made the assignment x=3, then it would also have a transformation rule for x. Applying that to Sin(X) gives Sin(3), and then it's built in rule is applied to give a numerical value.

In the case of Sin(3,2), there is no rule which applies. Mathematicas rules understand which arguments types are proper, and it has no rule called Sin which accepts two arguments, so it returns Sin(3,2). There is no rule to tranform the input. You will at times see this in functions you define. If you define foo(x_):=x, and then input foo(2,3), it will return foo(2,3).


Best regards,
POSTED BY: David Keith
Posted 11 years ago
thanks for your replies,

why not simply to replay  an error message , and give me an hint , what am I doing wrong.

it's just a big waste of time for me !
Posted 11 years ago
When the Mathematica kernel cannot find an answer to what you want to evaluate, it will simply return the input.
This can also occur when the function you are using is undefined:
 In[1]:= MyUndefinedFunction[3]
 Out[1]= MyUndefinedFunction[3]
 In[2]:= Sin[3, 2]
 During evaluation of In[2]:= Sin::argx: Sin called with 2 arguments; 1 argument is expected. >>
 Out[2]= Sin[3, 2]
For your case I'd guess that Minimize does not have any algorithm to solve your system for general h.
For given values of h NMinimize might work.
POSTED BY: Peter Fleck
Posted 11 years ago
why when ever mathematica wants to do it , it want say what is the reason for that !!
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract