got stuck in equation

Dave Angel d at davea.name
Tue Jan 1 11:39:09 EST 2013


On 01/01/2013 10:40 AM, usamazohad at gmail.com wrote:
> hi . . my name is usama khan 
> i am the student of civil engeering  and we got assignment to make a project program on flexible pavement design using python.
>  
> i know very litle about programing. still learning from tutorials. u can call me a beginner.
> now i need to solve this equation so that i can put this in python but the formula of design is very complex 
>  
> Formula is :
>  
> log(W18) = (Z)(S)+9.36log(SN+1) -2.0+(log(dpsi/(4.5-1.5))(/(.40+1094/(SN+1)^2.5)+2.32log(Mr-)-8.07
>  
> every thing is constant except this SN. . i want to seperate SN like SN= rest of the stuff. how can i seprate it because manualy its impossible to take SN out.
> so plz help me out

Tk Solver is (or was) a program for getting numerical results from
equations where you couldn't (or didn't want to) express the equation
with the independent variable isolated on its own side of the equals
sign.  I don't know where it's available for purchase or download now; 
I do see references to it on the web, plus books still available about
it.  Apparently it's up to version 5.

Anyway, since everything else is a constant, use some program like Tk
Solver to get the value for SN, then the Python program becomes simply:

   SN =  4.7732

or whatever.

On the other hand, perhaps you didn't mean the other values were
constant, but rather known.  For example, perhaps your program is
supposed to ask the user for values to W18, to dpsi, etc., then it is to
calculate one or more values for SN that make the equation work.


SN might be "structural number" as indicated on this web page:
   
http://classes.engr.oregonstate.edu/cce/winter2012/ce492/Modules/06_structural_design/06-3_body.htm

The big equation on that page looks kinda like the one you present,
though I didn't study every term.


1)
Is there a finite range of values that SN might fall into?  I know
nothing about pavement design, other than what I just read there, but
there might well be a specific range that's reasonable to expect.

2)
Take the present equation, and subtract log(w18) from both sides.  Now,
you want a value for SN that produces zero, or something close for the
left hand side.  Call that side "error".  Is the value "error"
relatively predictable for changes in SN ?  For example, in the simplest
case, any increase in SN will result in an increase of error.  The worst
case would be where any tiny change in SN might result in enormous
changes in a random direction to error.

3)
Figure an acceptable value for error, so you'll know when you're close
enough.

4)
if the first three questions have good answers, then you could write a
function that transforms FN into error.  Then write a controlling loop
that calls that function repeatedly, picking values for FN that will
converge the error into ever-smaller value.  The first iteration might
go over the entire range, dividing it into maybe ten steps.  Then pick
the two smallest values for error, and treat those particular two FN
values as your new range.

Repeat until the error value is below the threshold figured in #3, or
until you've iterated an unreasonable number of times.

There are ways to improve on that, but they generally require you know
the approximate behavior of the function.  For example, Newton's method
is a method of calculating square roots, starting with end points of 1
and N, and it converges more rapidly because it effectively calculates
the slope of the curve over each range.





-- 

DaveA




More information about the Python-list mailing list