Message Boards Message Boards

0
|
3011 Views
|
4 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Avoid issue when differentiating Green's function

Posted 4 years ago
POSTED BY: Omer G
4 Replies

If[] is a programming construct. It is not designed to play well with symbolic mathematics. Use Piecewise instead.

POSTED BY: Gianluca Gorni
Posted 4 years ago

The problem is caused by using SetDelayed in the definition of DG. The derivative is not evaluated until it is used, and when it is, it is a derivative with respect to a constant x. So, either use Set in the definition of DG or force evaluation prior to use.

Plot[Evaluate@DG[x, 0.3], {x, 0, 1}, Exclusions -> None]

enter image description here

POSTED BY: Rohit Namjoshi
Posted 4 years ago

n can be any real number greater than 2, forgot to initialize it.

POSTED BY: Omer G
Posted 4 years ago
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

Group Abstract Group Abstract