Group Abstract Group Abstract

Message Boards Message Boards

0
|
2.8K Views
|
3 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Error: Tag Piecewise is protected

When I Enter the following code, Mathematica returns "Tag piecewise in (piecewise function) [x_] is protected, and when I plot this, the mid piece does not appears, someone can tell me where is the error of my code?

POSTED BY: Rubens Quirino
3 Replies
Posted 4 years ago

Hi Rubens,

Most likely you have a conflicting definition for Subscript[\[Psi], 1][x_]. Try

Remove[\[Psi]]

And use SetDelayed in the definition, :=, not =.

POSTED BY: Rohit Namjoshi

Hi Rohit, thank you. The error has been fixed but the mid piece dont appears on my graph, do you know tell me why?

POSTED BY: Rubens Quirino
Posted 4 years ago

Add PlotRange -> All or reduce the x range

Plot[Piecewise[
         {{5.66048 E^(0.76` x), x < -5}, 
          {0.398447 Cos[0.25 x], -5 <= x <= 5}, 
          {5.66048 E^(-0.76` x), x > 5}}, 0],
   {x, -10, 10}]

enter image description here

LogPlot[Piecewise[
         {{5.66048 E^(0.76` x), x < -5}, 
          {0.398447 Cos[0.25 x], -5 <= x <= 5}, 
          {5.66048 E^(-0.76` x), x > 5}}, 0],
   {x, -10, 10}]

enter image description here

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard