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

Solving for Intersections within a For Loop.

abissett
1-Visitor

Solving for Intersections within a For Loop.

Hi MathCAD Community,

To start I will try and give some background to the problem:

I have imported some data points that represent two edge curves of a surface in Creo. Using Matricies I can rotate these data points by a given angle made up of Yaw and Pitch. I then project these rotated data points to the zero plane using a projection Matrix. Next I fit a function through the two sets of transformed data and using integrals I calculate the area between these curves.

Now that I have worked out how to do this by specifying the rotation angle I want to iterate through 180 degrees of rotation in Yaw and Pitch to find the orientation that provides the smallest area between the curves.

My problem is when I go to find the potential intersection points of the two curves (for defining integral limits) I use a solve block, which cannot be implemented within a for loop for iterating through angles...

If anyone could help me find a solution to this ASAP it would be greatly appreciated. I have attached my methodology for completing this without iterating through a For loop.

Dion

Andrew Bissett wrote:

I have imported some data points that represent two edge curves of a surface in Creo. Using Matricies I can rotate these data points by a given angle made up of Yaw and Pitch. I then project these rotated data points to the zero plane using a projection Matrix. Next I fit a function through the two sets of transformed data and using integrals I calculate the area between these curves.

Now that I have worked out how to do this by specifying the rotation angle I want to iterate through 180 degrees of rotation in Yaw and Pitch to find the orientation that provides the smallest area between the curves.

My problem is when I go to find the potential intersection points of the two curves (for defining integral limits) I use a solve block, which cannot be implemented within a for loop for iterating through angles...

The general approach to this kind of problem is to make the solve block a function of the variables you want to vary.  Please see the attached worksheet.  Unfortunately, it means propagating those function arguments back through the worksheet.

Sorry about the layout of your worksheet ...

Stuart

This document was generated from the following discussion: Solving for Intersections within a For Loop.

1 REPLY 1

Sorry I'm not sure I follow completely. I understand what you have done but then how do I iterate through the whole process if the solve block still cant be used within a for loop?

StuartBruff

Announcements

Top Tags