Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

As a Civil Engineering major, this was the way in which we solved for the area under any curve, if we didn't have a way to take the integral. I think the class was called 'Numerical Analysis' or 'Numerical Methods' or something like that. And of course, we used Fortran for all of it.

Anyway, from $min to $max, given function F() and $number_of_steps, assuming it never goes negative, the integral (area, assuming it stays positive) will always be:

$step_size = ($max - $min) / $number_of_steps; my $total = ( F($min) + F($max) ) / 2; foreach ( 1 .. $number_of_steps-1 ) { $total += F( $min + ($step_size * $_) ); } my $area = $total * $step_size;

You would then repeat the process, each time increasing $number_of_steps until $area varies by less than whatever your required precision is.

The only problem with fitting this to your problem is to come up with the correct F() that describes the curve that you're trying to solve for. (Of course, solving for the overlapping area of two normal curves was handled in LRFD (Least Resistance Failure Design, where you assume that the final strength of a structure is represented by a normal distribution, and the final loading is also a normal distribution, and you attempt to get the chance of failure to a particular chance... we used a series of tables for all of that, though))


In reply to Re: Empirically solving complex problems by jhourcle
in thread Empirically solving complex problems by oakbox

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-25 05:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found