Skip to main content
1-Visitor
May 17, 2019
Solved

help with plotting piecewise function

  • May 17, 2019
  • 2 replies
  • 3215 views

Hi, can someone help me, I cannot figure out what I am doing wrong in this.  The error I get is that the value must be a scalar.

Capture.PNG

Best answer by terryhendicott

Hi,

Here is chart using the Chart Component of Prime5

 

Capture.PNG

2 replies

21-Topaz II
May 17, 2019

Hi,

Because you have not included the Prime sheet I have expressed the function in terms of all the input values.

Not sure if you are using Prime 15 or 14?

In your sheet T is a range variable so the comparison with a single variable T0 cannot be done.

 

Capture.PNG

 

Cheers

Terry

rb31-VisitorAuthor
1-Visitor
May 17, 2019

Hi Terry,  I'm using Prime 5 and I'm ultimately trying to plot the piecewise function that I was attempting to define with the code posted.  I made those changes, but it still is not working.  T0 is a single value, where T is an array, I tried a while loop to populate Sa but I could not get that to work either.  I'm just trying to populate Sa with values and then plot Sa and T. 

21-Topaz II
May 17, 2019

Hi

 

Here is the plot with some values assigned to the variables.  T is a vector of values.

 

Capture.PNG

21-Topaz II
May 17, 2019

Hi,

 

Forgot you also need to include what happens when T is equal to the comparison boundary limits.

Here is one way.

 

Capture.PNG

 

Cheers