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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Curvature of a surface MCAD 15 M050

john_clark
5-Regular Member

Curvature of a surface MCAD 15 M050

This sheet first plots a series of x,y,z data points for a floor elevation survey. surface is plotted as raw data

 

Then it does a surface regression analysis and generates a polynomial the poly surface is plotted.

 

I need to determine the curvature and then radius of curvature for any and all points.  I will use an overlay of distress to determine the radius of curvature that causes distress, I currently have a slice method of raw date and of the surface  but this is cumbersome. 

 

A math prof colleague provided a solution  that runs OK on his old version  of Maple.

I'm attempting to get this solution using MCAD 15 but getting errors.  I think it may be  a simple deal but don't know. 

 

Can anyone help?

 

I've placed a number of markers in this sheet in Bold large font red text.. 

 

Solution  starts on page 9.  There's  hand written solution  at top right of page 1 and repeated lower.

 

BTW this is a problem I've been work on for a number of years trying various strategies.  I think this is the best one.

 

Thanks in advance of any help or suggestions

 

jmc

 

 

 

 

 

 

 

 

16 REPLIES 16
StuartBruff
23-Emerald III
(To:john_clark)

Hi, John.

 

I've just had a quick skim through your worksheet.  Wow, that's a lot of work, and it would take me a long time to get to grips with it.

 

However, I think I might have spotted the cause of your unexpected nested vector of 49x1 vectors:

 

2024 09 20 D.png

 

Vectorization only applies to the vectors it sees in the variables/explicity defined matrices.  It does not apply to the results of an expression that uses those vectorized variables.  Hence, the behaviour you see in the clip above.

 

Stuart

 

PS.  Edited to add that I used Mathcad Prime 10 to view your M15 worksheet.

 

john_clark
5-Regular Member
(To:StuartBruff)

Here’s a prime 11 copy that works. I tried to recreate it to of no avail.

The key is correctly calculating the unit vector. n

Can you help with this?

My math prof colleague provided hand written text which I attempted but there’s still something correct

On Sep 22, 2024, at 9:09 AM, John Clark <jc@clark-engineers.com> wrote:

Thanks for your response.

I found some errors since posting. But it’s still not working.

See pdf below.

I’ll also send mcad ts response with comments.

Werner_E
25-Diamond I
(To:john_clark)

Are you sure that L.xx(1,2) should be a vector but g.xy(1,2) is just  a scalar?

I guess L.xx(1,2) should be a scalar, too. Otherwise it would be wrong to call an expression which contains L.xx using vectorization.

Werner_E_0-1726860181887.png

Its a good idea to test functions which expect scalar arguments if the result is as expected before you call them vectorized with vector arguments.

 

According the cross product I am a little bit confused what it should denote. As far as I know a cross product of two vectors is only defined for 3 and for 7 dimensions!

 

john_clark
5-Regular Member
(To:john_clark)

Thanks for all the help

 

I found some errors and I responded to emails and am replying here.

 

My latest edits are in the attached file along with my questions. 

 

The issue is computing the unit vector n correctly.

I've included a section  of the  derivation from my math colleague. 

 

I made an attempt but its still incorrect.

 

Thanks in advance for any help

 

jmc

 

 

 

 

 

 

 

Werner_E
25-Diamond I
(To:john_clark)

Can't comment on the vector n

You promised a working Prime 11 worksheet which you did not attach - guess you meant Mathcad 11 as Prime 11 does not yet exist in public use 😉

And if its a Mathcad 11 sheet, you should be able to open it in Mathcad 15 (or 14) and use it !?

 

Just a comment on the polynomial fit of your data. I don't understand why the data is rounded down to 0 decimals before doing the polynomial fit.

Furthermore the coefficients for the polynomial fit could also be calculated by using polyfitc, the function defined via polyfit.

There seems to be no need for the spline interpolation.

But then, I have not looked in full detail in your sheet, so I may be wrong, indeed.

Werner_E_0-1727021708477.png

 

john_clark
5-Regular Member
(To:Werner_E)

Apologies for the confusion

Mcad ts supplier an off done in 11. I was I was surprised as well.

I’ll post the pdf.

Still looking for resolution of unit vector n


jmc
Werner_E
25-Diamond I
(To:john_clark)


Mcad ts supplier an off done in 11.

Sorry, I don't understand.

 


I’ll post the pdf.

I understood that you have a working Mathcad or Prime worksheet which would be more valuable than a pdf.

 

Still waiting for an explanation what this vector n should denote.

As already written, a cross product is only defined for vectors in exactly three or seven dimensions.

 

It would make sense if n should be a normal vector of the surface, but then it would not be constant but rather depends on x and y

Werner_E_1-1727031513815.png

 

 

 

john_clark
5-Regular Member
(To:Werner_E)

Never know when autocorrect will strike 🤪😵💫😠

PTC TS supplied a pdf file done in prime 11.

I attempted to replicate in prime 10 but did not work.

I’ve asked TS for a live file.




jmc
Werner_E
25-Diamond I
(To:john_clark)


@john_clark wrote:
Never know when autocorrect will strike 🤪😵💫😠
 
PTC TS supplied a pdf file done in prime 11.
 
I attempted to replicate in prime 10 but did not work.
 
I’ve asked TS for a live file.
 
 
 

jmc

OK ....?

I can imagine that tech support converted your Mathcad 15 sheet (which you posted here) into Prime format and I also can image that they already use a beta version of Prime 11 (which would mean that we would not be able to open it with Prime 10).

But I hardly can imagine that they fixed the problem with the incorrect results you complain about - did they really?

If so, even the pdf could be interesting.

 

Not sure if you have noticed it - in your reply to Stuart here 

Re: Curvature of a surface MCAD 15 M050 - PTC Community

you wrote "Here’s a prime 11 copy that works" but probably you forgot to attach the file!

 

john_clark
5-Regular Member
(To:Werner_E)

I sent a prime 10 file to them since they will no longer support 15

I’m hoping to get 15 to work since it has a much better plotting routine

I was hoping g Prime 11 would be fully compatible but was recently informed by DP of TS that that would not happen.

Still need help with unit vector if anyone has any ideas.

Thanks, in advance.

jmc

Werner_E
25-Diamond I
(To:john_clark)

Still confused and wondering why you don't post the pdf file !??

 

As I already had written here Re: Curvature of a surface MCAD 15 M050 - PTC Community, your normal vector should be  a function in x and y and not a constant as you tried it to define.

So you should use what you have written here

Werner_E_0-1727042232377.png

but without the equal sign at the end and with n'(x0',y0):= at the left hand side. Its a function, not a constant.

I also wonder why you call the first function argument x.0' and the second only y.0.

Looks quite strange to me, but then the name of the formal arguments of a function do not matter at all.

Being lazy I would simply use

Werner_E_1-1727042644681.png

Keep in mind that x and y here have nothing to do with the vectors defined earlier - they are just the formal function arguments.

You may equally use a and b or any other names here.

The same applies to the other functions like

Werner_E_2-1727043155718.png

I would define them without vectorization and apply vectorization only when  you call the function with vectors as arguments.

 

BTW, is there any reason why you named the first partial derivative of  f wrt x  x'.0 and not simply f.x ? I found the sheet much harder to read with names like that.

 

Furthermore I am confused about what L.xx etc, should be

You write as an explanation

Werner_E_0-1727044450900.png

which would mean that L.xx is a scalar, but when you define L.xx you additionally multiply it with vector n, which of course makes L.xx a 3x1 vector, which I guess it should not be. Especially as you later define a matrix L(x,y) with L.xx etc. as its arguments. What you define in Mathcad as L(x,y) seems to have nothng to do with the determinant of the expression shown to the left of it, nor with what is shown in the picture to the right of it as your definition uses the first derivatives and not the second ones.

I guess you misinterpreted this handwritten formula

Werner_E_0-1727046256607.png

Here X is a vector (x,y,f(x,y)^T and a second derivate (no matter wrt which variable) means you get (0, 0, f.xi,xj)). Scalar multiplication by unit vector n simply results in f.xi,xj / sqrt(....).

So it should be that way:

Werner_E_1-1727046524663.png

 

Similar

Werner_E_2-1727047588157.png

 

and then

Werner_E_3-1727047621250.png

 

Enjoy simple, not nested result vectors and real result for the quadratic equation

Werner_E_4-1727047673772.png

 

Conclusion: Once you have your function f(x,y) forget about the data vectors X, Y or x' and y' and set up your calculations as functions in simple scalar arguments x and y. Only when you need the results for your vectors call those function (vectorized) with the data vectors as their arguments.

 

Hope this helps!

 

john_clark
5-Regular Member
(To:john_clark)

Thank you for your detailed response.

 

I confess I'm out of my depth.

 

My math prof colleague provided the handwritten derivation. Ann transcription errors are my own. 

 

The use of primes was me being lazy from previous versions. This is a problem I've been dabbling with for years. Finally concluded that the curvature of a surface was the way to go. Had no idea it was this complex. 

 

I plan to rewrite the sheet to clean it up.  I'm like the guy who can drive a car attempting to fly a jet plane with little experience but willing to try anything once.  

 

Anyway, since I'm just parroting what the prof directed, I probably don't fully understand your detailed comments. 

 

I'll attempt to decipher your comments.  Can you post the file that has your solution?

 

Thanks again

 

jmc

 

 

 

 

Werner_E
25-Diamond I
(To:john_clark)


Can you post the file that has your solution?

The file was attached to my previous answer from the very start and still is 😉

Its named WE_20240923_Surface Curvature

 

ttokoro
20-Turquoise
(To:john_clark)

Convert to Prime 10 from Werner_E's sheet.

image.pngimage.png

Hi @john_clark,

 

I wanted to see if you got the help you needed.

If so, please mark the appropriate reply as the Accepted Solution. It will help other members who may have the same question.
Please note that industry experts also review the replies and may eventually accept one of them as solution on your behalf.
Of course, if you have more to share on your issue, please pursue the conversation. 

 

Thanks,
Anurag 

john_clark
5-Regular Member
(To:anursingh)

Thank you

I have a solution but it appears to be an order of magnitude off on results.

Working on checks by other methods.
Announcements

Top Tags