Skip to main content
1-Visitor
November 30, 2014
Solved

Is there method fastly to solve about "condition" ?

  • November 30, 2014
  • 13 replies
  • 5284 views

I used "if" to my work because I need to constraint.

i.x) I have some data(CL, CD) each section "r=2.8667, 5.6....61.6333"

These data are 8.(CL1,CD1.....CL8,CD8)

when r are 2.8667,5.6 , CL1,CD1 is used.

when r is 61.6333, CL8,CD8 is used.

I used "if" to constraint so that data used each section.

But It made my work slowly.

So I want to change or improve so that it is fast.

I attaced my files. Please help me. it spend long time....

And I also want to review my work whether it is efficient about my work.

Best answer by Werner_E

jinsuk Lee wrote:

if r=7m, I don't have a data(CL, CD)

I just have data in my excel file.

Yes, but you could use interploation here, too.

I am not sure if you need it, but her is a way how it could be done:

1.png

2.png

I also noticed that you redefined the function CL and CD inmidst of your sheet - confusing and bad behaviour.

I am not sure abou your calculation of ar and ar' via the solve blocks. In a prior post you wrote that you want to solve for both at once but this is not what you do now. Now you solve for a and hold a' constant to zero and then the other way round. i guess this is not what you inteded.

According the slowness of the sheet: Thats the integrations you are evaluating. The function th() takes a long time to calculate and is called many time by the itegral. Not sure but I don't think the if conditions are the cause for this. I can not be bothered to trace all of your function all the way back to their origin but this sure is something you should do yourself. Look how many calculation and which (interpolation, ...) Mathcad has to do to just calculate a single value of th().

Why not calcuate the integral by simple trapezoid approximation? After all you just have a bunch of points an not a continous function anyway.

13 replies

Werner_E
25-Diamond I
November 30, 2014

jinsuk Lee wrote:

I used "if" to my work because I need to constraint.

i.x) I have some data(CL, CD) each section "r=2.8667, 5.6....61.6333"

These data are 8.(CL1,CD1.....CL8,CD8)

when r are 2.8667,5.6 , CL1,CD1 is used.

when r is 61.6333, CL8,CD8 is used.

And what if r=7m ??

BTW, the Mathcad sheet you posted does not use the Excel sheet you posted but two other Excel files.

jlee-21-VisitorAuthor
1-Visitor
November 30, 2014

if r=7m, I don't have a data(CL, CD)

I just have data in my excel file.

ah.. I had a mistaken to post

I attached starnge file. i am sorry

I again attached

13.PNG

AND I have airfoil data along RNodes.

I need to read eah node to airfoil data.

it make me crazy..... I couldn't solve this problem for a long time.

Werner_E
Werner_E25-Diamond IAnswer
25-Diamond I
December 1, 2014

jinsuk Lee wrote:

if r=7m, I don't have a data(CL, CD)

I just have data in my excel file.

Yes, but you could use interploation here, too.

I am not sure if you need it, but her is a way how it could be done:

1.png

2.png

I also noticed that you redefined the function CL and CD inmidst of your sheet - confusing and bad behaviour.

I am not sure abou your calculation of ar and ar' via the solve blocks. In a prior post you wrote that you want to solve for both at once but this is not what you do now. Now you solve for a and hold a' constant to zero and then the other way round. i guess this is not what you inteded.

According the slowness of the sheet: Thats the integrations you are evaluating. The function th() takes a long time to calculate and is called many time by the itegral. Not sure but I don't think the if conditions are the cause for this. I can not be bothered to trace all of your function all the way back to their origin but this sure is something you should do yourself. Look how many calculation and which (interpolation, ...) Mathcad has to do to just calculate a single value of th().

Why not calcuate the integral by simple trapezoid approximation? After all you just have a bunch of points an not a continous function anyway.