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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

How to create a matrix from a defined function

jpeck
3-Visitor

How to create a matrix from a defined function

I have defined a function to find the slope of a circular plate with a hole as a function of the radius.  I want to find the minimum slope which occurs somewhere between the inside and outside radius.  I can only use the max() function if the results are in a matrix.  The defined function is not considered a matrix in Prime.  I was going to use the WRITEPRN function (and read the values back in) but when I do that, only the last value is printed in the PRN file.  Attached is the worksheet.  Any ideas on what I'm doing wrong?  

Thanks in advance. 

1 ACCEPTED SOLUTION

Accepted Solutions
Werner_E
24-Ruby V
(To:jpeck)

I would suggest that you use the zero of the derivative to get the desired value. You can use a solve block with find or the "root" function:

Werner_E_0-1599151820532.png

The problem in your sheet was that r is defined as a range and not as a vector. That way theta(r) IS NOT a vector (but rather some kind of iteration.

Here is a way to achieve what you tried to accomplish:

Werner_E_1-1599151913648.png

Prime 6 worksheet attached

 

 

View solution in original post

2 REPLIES 2
Werner_E
24-Ruby V
(To:jpeck)

I would suggest that you use the zero of the derivative to get the desired value. You can use a solve block with find or the "root" function:

Werner_E_0-1599151820532.png

The problem in your sheet was that r is defined as a range and not as a vector. That way theta(r) IS NOT a vector (but rather some kind of iteration.

Here is a way to achieve what you tried to accomplish:

Werner_E_1-1599151913648.png

Prime 6 worksheet attached

 

 

jpeck
3-Visitor
(To:Werner_E)

Big thanks Werner, that helps a bunch. 😁

Top Tags