cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Maximum Value of a Piecewise Function

Callum1995
6-Contributor

Maximum Value of a Piecewise Function

Hello,

 

I am working on a simply supported beam calculator. I have everything up and working but I am having trouble when it comes to determining the maximum of the displacement and it's corresponding x value. 

 

In the collapsible area under the loads you can see I have the various displacement equations and to find the total displacement I sum them up. I then need to find where this value is a maximum but I don't know how to do it other than reading it off the graph. 

 

Is there a more elegant way to determine the maximum so I can define a function for maximum displacement and corresponding x-location. I have attached the sheet for reference.

 

Thanks,

Callum 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi Callum,

 

There is a difference between a range variable and a vector.

Capture.JPG defines a range variable.  It does not create a vector.

I like to define a vector "x" and a matching indexed range variable "ix"

This following code creates a vector "xp" and a matching range variable "ix"

Capture2.JPG

The subtle change is that you can create a vector of deflections at points on the beam and find a maximum of that vector

Capture6.JPG

The solution comes  with a drawback in that you need to use the index variable "ix" in the plots

Capture3.JPG

Capture4.jpg

Capture5.JPG

Cheers

Terry

View solution in original post

2 REPLIES 2

Hi Callum,

 

There is a difference between a range variable and a vector.

Capture.JPG defines a range variable.  It does not create a vector.

I like to define a vector "x" and a matching indexed range variable "ix"

This following code creates a vector "xp" and a matching range variable "ix"

Capture2.JPG

The subtle change is that you can create a vector of deflections at points on the beam and find a maximum of that vector

Capture6.JPG

The solution comes  with a drawback in that you need to use the index variable "ix" in the plots

Capture3.JPG

Capture4.jpg

Capture5.JPG

Cheers

Terry

Hi terry,

 

Thanks for you response! I have got it up and working now. 

 

Best Regards,

Callum 

Top Tags