Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Maclaurin's_series_sinh-1(x)

Name: Fouad Teniou 2010-09-28 13:48

C. Maclaurin. A Scottish mathematician gained his master degree at age 17, and his major mathematics' work arise from his special knowledge in Newton's ideas and the formulation of Newton's methods.

However, C. Maclaurin also contributed to the astronomy science and helped to improve maps and invented some mechanical devices .

My mathematics python's programs is a set of Maclaurin's series to compute some of the most important functions in calculus.

Though, the computation of an infinite sum which give the value of a function in terms of the derivatives evaluated at a special case where x0 = 0,in contrast with Taylor's series.

Natural logarithms are used to compute inverse hyperbolic functions.

#On the name of ALLAH and may the blessing and peace of Allah
#be upon the Messenger of Allah Mohamed Salla Allahu Aliahi Wassalam.
#Author : Fouad Teniou
#Date : 21/09/10
#version :2.6

"""
maclaurin_sinh-1 is a function to compute sinh-1(x) using maclaurin series
and the interval of convergence is -1 < x < +1 and -inf < y < +inf
sinh-1(y) = ln(y + sqrt(y**2 +1)=  and y = ln(1+x/1-x) =
sinh-1(y) = 2(x + x^3/3 + x^5/5 + x^7/7 ...........)
"""

from math import *

def maclaurin_sinh_inverse(value, k):
    """
    Compute maclaurin's series approximation for sinh-1(value).
    """
 
    global first_value   
    first_value = 0.0
   
    #attempt to Approximate sinh-1(x) for a given value   
    try:
        value_y = value + sqrt(value**2+1)
        value_x = (value_y -1)/float(value_y + 1)
        for item in xrange(1,k,2):
            next_value = value_x **item/item
            first_value += next_value

        return 2*(first_value)
   
    #Raise TypeError if input is not a number  
    except TypeError:
        print 'Please enter an integer or a float value'

if __name__ == "__main__":
   
    maclaurin_sinh_inverse1 = maclaurin_sinh_inverse(1,100)
    print maclaurin_sinh_inverse1
    maclaurin_sinh_inverse2 = maclaurin_sinh_inverse(2,100)
    print maclaurin_sinh_inverse2
    maclaurin_sinh_inverse3 = maclaurin_sinh_inverse(3,100)
    print maclaurin_sinh_inverse3  

######################################################################FT python "C:
#0.88137358702
#1.44363547518
#1.81844645923



My profile,poems, photos,and design's links

https://acrobat.com/#d=aEjxtq78QkGKUxa*UprkZQ

Name: Anonymous 2010-09-29 14:47

Coh-pee-pay.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List