Skip to main content
1-Visitor
May 24, 2018
Question

Integration

  • May 24, 2018
  • 2 replies
  • 5004 views

Hi to all,

 

I am further experimenting with my Naval Architecture calculations in MC. 

 

In the attached MCP3 file, can anyone tell me why the integral returns what seems to be an infinite number of answers when the answer I expect to get is 50m^2?

 

Thanks,

 

Andy.

2 replies

16-Pearl
May 24, 2018

Your integral goes to WL(y,T,phi).  y is defined as a range variable of 100 points, so it returns 100 results.  

Replace y with a single value (5 m or similar) and you get one answer (50 m^2)

awibroe1-VisitorAuthor
1-Visitor
May 24, 2018

Any ideas how I can set this up to integrate area under WL?

 

As per attached where phi is not 0.

23-Emerald I
May 24, 2018

@awibroe wrote:

Any ideas how I can set this up to integrate area under WL?


I don't like your setup, but

Capture.PNG

25-Diamond I
May 24, 2018

One rule you should consider is NOT TO USE range varaibles for calculations!!

Use ranges for plotting, use ranges for indexing vectors and matrices and uses ranges for loops in a program. But please don't use ranges for anything else unless you really want to run into troubles!!!

awibroe1-VisitorAuthor
1-Visitor
May 24, 2018
Top advice Werner. I defined range variables to allow visualisation of the problem.

I’m still not quite there with a solution though. Ultimately I want to integrate the space inside function St(z) i.e. to the left of the vertical blue line. And up to a height of the function WL(z) ie the black line which may not be horizontal.
25-Diamond I
May 25, 2018

@Fred_Kohlhepp wrote:

You were correct, I had the wrong limit of integration.  The attached MP3 file does what you want (I think).



Hmmm, MP3 !? Voice or music? šŸ˜‰

Oh, its just MC-Prime 3 šŸ˜ž

And yes, they fixed it! Direct attachments of Mathcad files are now possible. It didn't even take a full year to give us back part of what we lost. Great !?