Message Boards Message Boards

0
|
3120 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Calculate a piecewise function?

Hey, This is my first post in the Wolfram Community, and I must say, I have been looking up multiple discussions before, but I could not find an answer to the problem I'm having right now. I have made a function (S_d), which consists out of multiple functions for certain x-values, I have used a piecewise for this. When I call the function with a certain x-value (T-value in this case), I get the y-value from it. However, when I tried it again with a different T-value, I did not get my y-value, but the following: Wrong Output

The following is what happens earlier in the notebook, which is what I expected and what I need in order to continue with the calculations: Function Definition

Values of T to be called

Function Values for the T-values

I would really appreciate if you could take a look at this and tell me where I made a mistake or what I can do to repair this and prevent this for future use. Thanks a lot in advance!

Best regards, Hidde Lansink

Attachments:
POSTED BY: Hidde Lansink
2 Replies

That solved the trick indeed, thanks a lot!

POSTED BY: Hidde Lansink
Posted 4 years ago

Cause of the problem is that symbols Sd1 and Sd2 are both defined twice. First in In[9]. Then later on in In[75] and In[76], where they are assigned a numerical value. In the attached I have used different symbols in the first and last parts.

Attachments:
POSTED BY: Hans Milton
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