[OT] Re: Programming Puzzle for you Experts out There

Ype Kingma ykingma at accessforall.nl
Tue Mar 26 15:59:37 EST 2002


Joe,

you wrote:
> 
> First a little background:
> 
> I'm in the process of writing a fatigue and damage tolerance analysis
> program using python.  One of the things the math engine can do is
> compute the remaining strength of the material after it has sustained
> damage.  However, there are two problems:
> 
> 1)  Redisual strength is influenced by two competing physical
> properties of the metal.  So far, nobody has developed a method for
> evaluating the transition between these properties so the conventional
> wisdom is to "eyeball" a curve between them.
> 
> 2)  Sometimes, the damage or fatigue involves a "ligament break", this
> will suddenly change the stress field and, not surprisingly, cause a
> step change in the residual strength curve.
> 
> So here is the problem......
> 
> I have two vectors that, when plotted against each other are mostly
> smooth with occasional inflection points and step changes.  I want to
> keep the step changes but inscribe a smooth arc below the inflection
> points that will eventually be tangent to the intersecting curves.
> 
> Now, here is the hard part......
> 
> To get the boundary conditions, I must sample the vectors "as is".
> Re-iterating the numbers to get better data will require me to go back
> into the math engine which will suck up processor time.
> 
> I've tried 4th order polynomial fits and hyperbolic fits but neither
> have been robust enough to track all of the fracture scenarios I've
> thrown at it without Gibb's overshoots or other issues.  I have not
> tried Fourier or other series fits as of yet.  Probably try that next.
>

It's been quite a while that I did numerics, but this sounds like good fun.

Some questions on finding the fractures:
- how much noise is there in your data?
- do you need those higher order techniques?
- would the abs of the raw second time derivative provide enough information?
- or even the abs of the first time derivative?

A simple iteration might work like this:
- fit the data to some smooth function,
- stop when the fit is good enough, otherwise:
- split the data on the few the most distant outliers,
- recurse on the split off parts.
With some heuristics you might even make the total amount of work
close to linear in the number of points, eg. by always having a limited
number of fractures in the data you are working on.

Regards,
Ype



More information about the Python-list mailing list