Message Boards Message Boards

0
|
3736 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Custom function with integrate generating Plot[ ] errors

Posted 3 years ago

I am creating a user defined function f[t_] := where I am evaluating an integral in the body of the function without any issues. I can subsequently evaluate the user function f[t] and obtain the correct answer. However, when I plot the expression using the Plot[ ] function, I get a number of errors - see attached notebook. For simplicity, I have omitted the constant from the indefinite integral.

My best guess is that there is some extra data being created in the integrate function that creating problems in the plot function. However, I do not know what it is, how to identify it and how to remove it. Again this problem is most likely because I don't understand the functions so please point me in the correct direction.

Thanks,

Mitch Sandlin

POSTED BY: Mitchell Sandlin

Hi Mitch

Just use Evaluate in Plot to make sure the integration being evaluated first

Plot[Evaluate@f[t], {t, -5, 5}]
POSTED BY: Ahmed Elbanna
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract