Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: plot command

  • To: mathgroup at
  • Subject: [mg58151] Re: plot command
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at>
  • Date: Mon, 20 Jun 2005 05:21:25 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, England
  • References: <d90spv$8va$>
  • Sender: owner-wri-mathgroup at

Bosch, Darrell wrote:
> Dear Group:  I am trying to solve an equation, take the derivative and 
> plot the derivative as shown below.  I get a message below the Plot 
> request stating
> "Syntax::sntxi: "Incomplete expression; more input is needed."  Any help 
> would be greatly appreciated.  Darrell Bosch
> sol = Log[v]=A9100*Log(s)
> sol2 = Solve[sol,v]
> sol3 = D[sol2,s]
> Plot[Evaluate[sol3],{s,0,100}]
Hi Darrell,

Using correct syntax would help greatly! I have not gotten the error 
message you mentioned in your post but definitely many others. Starting 
from the first line, we get

sol = Log[v] = A9100 Log(s)

Set::write : Tag Log in Log[v] is Protected.


Here you are using the symbol "=" (simple equal), which is equivalent to 
the command *Set*, which tries to assign a new value/definition to the 
built-in command *Log*. So, either you *Unprotect* the *Log* function 
(very bad idea in this case :-) or most likely you use the *Equal* 
(double =, that is "==") to check for equality between LHS and RHS.

Of course you still use the simple "=" to assign the equation to the 
symbol "sol".

Moreover, as you can see above, Log(s) is translated as Log*s, that is 
Log TIMES s, surely not what you wanted. Here too, using the correct 
syntax would help. What you want is Log[s] (square brackets).

You may have a look at

Therefore, what is the correct syntax for the first line (assuming that 
"A9100" is the symbol A9100 and not a misspelling for A*9100 or whatever 

sol = Log[v] == A9100*Log[s]

Logs[v] == A9100*Log[s]

Now the second line gives

sol2 = Solve[sol, v]

{{v -> s^A9100}}

a replacement rule rather than the error message "Solve::eqf : 
A9100\Log\s is not a well-formed equation."

Now, if you derive directly this replacement rule, you get

sol3 = D[sol2, s]

{{0 -> A9100*s^(-1 + A9100)}}

which is not what you want: LHS and RHS are both derived and since "v" 
does not depend explicitly on "s" its derivative is zero. One of the 
possible solutions among many variations is

sol3 = D[v /. sol2[[1]], s]

A9100*s^(-1 + A9100)

Finally, the last command yields an error message

Plot[Evaluate[sol3], {s, 0, 100}]

\!\(Plot::"plnr" : "\!\(A9100  \\\\
     s\^\(\(-1\) + A9100\)\) is not a machine-size real number at s = \

telling us that A9100 is not a number, which is true. We can circumvent 
this "problem" by assigning a value to A9100 before plotting the function:

Plot[Evaluate[sol3 /. A9100 -> 1], {s, 0, 100}];

And the magic operates: we get a superb graph (of a straight line in 
this case :-)

Best regards,

  • Prev by Date: Re: Intersection @ Complement
  • Next by Date: Re: lists of variables
  • Previous by thread: Re: plot command
  • Next by thread: Did something change?