Torricelli's equation: Difference between revisions
en>Maschen remove merge to Equation of motion (declined by a few editors), see talk anyway |
en>Addbot m Bot: Migrating 6 interwiki links, now provided by Wikidata on d:q2670060 (Report Errors) |
||
Line 1: | Line 1: | ||
In [[mathematics]], the '''Lanczos approximation''' is a method for computing the [[Gamma function]] numerically, published by [[Cornelius Lanczos]] in 1964. It is a practical alternative to the more popular [[Stirling's approximation]] for calculating the Gamma function with fixed precision. | |||
==Introduction== | |||
The Lanczos approximation consists of the formula | |||
= | :<math>\Gamma(z+1) = \sqrt{2\pi} {\left( z + g + \frac{1}{2} \right)}^{z + \frac{1}{2} } e^{-\left(z+g+\frac{1}{2}\right)} A_g(z)</math> | ||
for the Gamma function, with | |||
= | :<math>A_g(z) = \frac{1}{2}p_0(g) + p_1(g) \frac{z}{z+1} + p_2(g) \frac{z(z-1)}{(z+1)(z+2)} + \cdots.</math> | ||
Here ''g'' is a [[Constant (mathematics)|constant]] that may be chosen arbitrarily subject to the restriction that Re(''z''+''g''+1/2) > 0. The coefficients ''p'', which depend on ''g'', are slightly more difficult to calculate (see below). Although the formula as stated here is only valid for arguments in the right complex [[half-plane]], it can be extended to the entire [[complex plane]] by the [[reflection formula]], | |||
= | :<math>\Gamma(1-z) \; \Gamma(z) = {\pi \over \sin \pi z}.</math> | ||
The series ''A'' is [[convergent series|convergent]], and may be truncated to obtain an approximation with the desired precision. By choosing an appropriate ''g'' (typically a small integer), only some 5-10 terms of the series are needed to compute the Gamma function with typical [[single precision|single]] or [[double precision|double]] [[floating point|floating-point]] precision. If a fixed ''g'' is chosen, the coefficients can be calculated in advance and the sum is recast into the following form: | |||
:<math>A_g(z) = c_0 + \sum_{k=1}^{N} \frac{c_k}{z+k}</math> | |||
Thus computing the Gamma function becomes a matter of evaluating only a small number of [[elementary function]]s and multiplying by stored constants. The Lanczos approximation was popularized by ''[[Numerical Recipes]]'', according to which computing the Gamma function becomes "not much more difficult than other built-in functions that we take for granted, such as sin ''x'' or ''e''<sup>''x''</sup>". The method is also implemented in the [[GNU Scientific Library]]. | |||
==Coefficients== | |||
The coefficients are given by | |||
:<math>p_k(g) = \sum_{a=0}^k C(2k+1, 2a+1) \frac{\sqrt{2}}{\pi} \left(a - \begin{matrix} \frac{1}{2} \end{matrix} \right)! | |||
{\left(a + g + \begin{matrix} \frac{1}{2} \end{matrix} \right)}^{- \left( a + \frac{1}{2} \right) } e^{a + g + \frac{1}{2} }</math> | |||
with <math>C(i,j)</math> denoting the (''i'', ''j'')th element of the [[Chebyshev polynomial]] coefficient [[matrix (mathematics)|matrix]] which can be calculated [[recursion|recursively]] from the identities | |||
:{| | |||
|<math>C(1,1) = 1\,</math> || | |||
|- | |||
|<math>C(2,2) = 1\,</math> || | |||
|- | |||
|<math>C(i,1) = -C(i-2, 1)\,</math> || <math>i = 3, 4, \dots\,</math> | |||
|- | |||
|<math>C(i,j) = 2 C(i-1, j-1)\,</math> || <math>i = j = 3, 4, \dots\,</math> | |||
|- | |||
|<math>C(i,j) = 2 C(i-1, j-1) - C(i-2, j)\,</math> || <math>i > j = 2, 3, \dots .</math> | |||
|} | |||
Paul Godfrey describes how to obtain the coefficients and also the value of the truncated series ''A'' as a [[matrix multiplication|matrix product]]. | |||
==Derivation== | |||
Lanczos derived the formula from [[Leonhard Euler]]'s [[integral]] | |||
:<math>\Gamma(z+1) = \int_0^\infty t^{z}\,e^{-t}\,dt,</math> | |||
performing a sequence of basic manipulations to obtain | |||
:<math>\Gamma(z+1) = (z+g+1)^{z+1} e^{-(z+g+1)} \int_0^e [v(1-\log v)]^{z-\frac{1}{2}} v^g\,dv,</math> | |||
and deriving a series for the integral. | |||
==Simple implementation== | |||
The following implementation in the [[Python (programming language)|Python programming language]] works for complex arguments and typically gives 15 correct decimal places: | |||
<source lang="python"> | |||
from cmath import * | |||
# Coefficients used by the GNU Scientific Library | |||
g = 7 | |||
p = [0.99999999999980993, 676.5203681218851, -1259.1392167224028, | |||
771.32342877765313, -176.61502916214059, 12.507343278686905, | |||
-0.13857109526572012, 9.9843695780195716e-6, 1.5056327351493116e-7] | |||
def gamma(z): | |||
z = complex(z) | |||
# Reflection formula | |||
if z.real < 0.5: | |||
return pi / (sin(pi*z) * gamma(1-z)) | |||
else: | |||
z -= 1 | |||
x = p[0] | |||
for i in range(1, g+2): | |||
x += p[i]/(z+i) | |||
t = z + g + 0.5 | |||
return sqrt(2*pi) * t**(z+0.5) * exp(-t) * x | |||
</source> | |||
==See also== | |||
* [[Stirling's approximation]] | |||
* [[Spouge's approximation]] | |||
==References== | |||
* {{cite web | |||
|first1=Paul | |||
|last1=Godfrey | |||
|year=2001 | |||
|url=http://www.numericana.com/answer/info/godfrey.htm | |||
|title=Lanczos Implementation of the Gamma Function | |||
}} | |||
* {{cite journal | |||
| last = Lanczos | |||
| first = Cornelius | |||
| authorlink = Cornelius Lanczos | |||
| title = A Precision Approximation of the Gamma Function | |||
| jstor = 2949767 | |||
| journal = [http://www.siam.org/journals/sinum.php SIAM Journal on Numerical Analysis series B] | |||
| volume = 1 | |||
| pages = 86–96 | |||
| year = 1964 | |||
| publisher = Society for Industrial and Applied Mathematics | |||
| id = ISSN: 0887459X | |||
| doi= 10.2307/2949767 | |||
}} | |||
* {{Citation | last1=Press | first1=W. H. | last2=Teukolsky | first2=S. A. | last3=Vetterling | first3=W. T. | last4=Flannery | first4=B. P. | year=2007 | title=Numerical Recipes: The Art of Scientific Computing | edition=3rd | publisher=Cambridge University Press | publication-place=New York | isbn=978-0-521-88068-8 | chapter=Section 6.1. Gamma Function | chapter-url=http://apps.nrbook.com/empanel/index.html?pg=256}} | |||
* {{cite thesis | |||
|last=Pugh | |||
|first=Glendon | |||
|year=2004 | |||
|degree=PhD | |||
|url=http://web.mala.bc.ca/pughg/phdThesis/phdThesis.pdf | |||
|title=An analysis of the Lanczos Gamma approximation | |||
}} | |||
* {{cite web | |||
|last1=Toth | |||
|first1=Viktor | |||
|year=2005 | |||
|url=http://www.rskey.org/lanczos.htm | |||
|title=Programmable Calculators: The Lanczos Approximation | |||
}} | |||
* {{MathWorld|urlname=LanczosApproximation|title=Lanczos Approximation}} | |||
[[Category:Gamma and related functions]] | |||
[[Category:Numerical analysis]] | |||
[[Category:Articles with example Python code]] |
Revision as of 08:29, 27 February 2013
In mathematics, the Lanczos approximation is a method for computing the Gamma function numerically, published by Cornelius Lanczos in 1964. It is a practical alternative to the more popular Stirling's approximation for calculating the Gamma function with fixed precision.
Introduction
The Lanczos approximation consists of the formula
for the Gamma function, with
Here g is a constant that may be chosen arbitrarily subject to the restriction that Re(z+g+1/2) > 0. The coefficients p, which depend on g, are slightly more difficult to calculate (see below). Although the formula as stated here is only valid for arguments in the right complex half-plane, it can be extended to the entire complex plane by the reflection formula,
The series A is convergent, and may be truncated to obtain an approximation with the desired precision. By choosing an appropriate g (typically a small integer), only some 5-10 terms of the series are needed to compute the Gamma function with typical single or double floating-point precision. If a fixed g is chosen, the coefficients can be calculated in advance and the sum is recast into the following form:
Thus computing the Gamma function becomes a matter of evaluating only a small number of elementary functions and multiplying by stored constants. The Lanczos approximation was popularized by Numerical Recipes, according to which computing the Gamma function becomes "not much more difficult than other built-in functions that we take for granted, such as sin x or ex". The method is also implemented in the GNU Scientific Library.
Coefficients
The coefficients are given by
with denoting the (i, j)th element of the Chebyshev polynomial coefficient matrix which can be calculated recursively from the identities
Paul Godfrey describes how to obtain the coefficients and also the value of the truncated series A as a matrix product.
Derivation
Lanczos derived the formula from Leonhard Euler's integral
performing a sequence of basic manipulations to obtain
and deriving a series for the integral.
Simple implementation
The following implementation in the Python programming language works for complex arguments and typically gives 15 correct decimal places:
from cmath import *
# Coefficients used by the GNU Scientific Library
g = 7
p = [0.99999999999980993, 676.5203681218851, -1259.1392167224028,
771.32342877765313, -176.61502916214059, 12.507343278686905,
-0.13857109526572012, 9.9843695780195716e-6, 1.5056327351493116e-7]
def gamma(z):
z = complex(z)
# Reflection formula
if z.real < 0.5:
return pi / (sin(pi*z) * gamma(1-z))
else:
z -= 1
x = p[0]
for i in range(1, g+2):
x += p[i]/(z+i)
t = z + g + 0.5
return sqrt(2*pi) * t**(z+0.5) * exp(-t) * x
See also
References
- Template:Cite web
- One of the biggest reasons investing in a Singapore new launch is an effective things is as a result of it is doable to be lent massive quantities of money at very low interest rates that you should utilize to purchase it. Then, if property values continue to go up, then you'll get a really high return on funding (ROI). Simply make sure you purchase one of the higher properties, reminiscent of the ones at Fernvale the Riverbank or any Singapore landed property Get Earnings by means of Renting
In its statement, the singapore property listing - website link, government claimed that the majority citizens buying their first residence won't be hurt by the new measures. Some concessions can even be prolonged to chose teams of consumers, similar to married couples with a minimum of one Singaporean partner who are purchasing their second property so long as they intend to promote their first residential property. Lower the LTV limit on housing loans granted by monetary establishments regulated by MAS from 70% to 60% for property purchasers who are individuals with a number of outstanding housing loans on the time of the brand new housing purchase. Singapore Property Measures - 30 August 2010 The most popular seek for the number of bedrooms in Singapore is 4, followed by 2 and three. Lush Acres EC @ Sengkang
Discover out more about real estate funding in the area, together with info on international funding incentives and property possession. Many Singaporeans have been investing in property across the causeway in recent years, attracted by comparatively low prices. However, those who need to exit their investments quickly are likely to face significant challenges when trying to sell their property – and could finally be stuck with a property they can't sell. Career improvement programmes, in-house valuation, auctions and administrative help, venture advertising and marketing, skilled talks and traisning are continuously planned for the sales associates to help them obtain better outcomes for his or her shoppers while at Knight Frank Singapore. No change Present Rules
Extending the tax exemption would help. The exemption, which may be as a lot as $2 million per family, covers individuals who negotiate a principal reduction on their existing mortgage, sell their house short (i.e., for lower than the excellent loans), or take part in a foreclosure course of. An extension of theexemption would seem like a common-sense means to assist stabilize the housing market, but the political turmoil around the fiscal-cliff negotiations means widespread sense could not win out. Home Minority Chief Nancy Pelosi (D-Calif.) believes that the mortgage relief provision will be on the table during the grand-cut price talks, in response to communications director Nadeam Elshami. Buying or promoting of blue mild bulbs is unlawful.
A vendor's stamp duty has been launched on industrial property for the primary time, at rates ranging from 5 per cent to 15 per cent. The Authorities might be trying to reassure the market that they aren't in opposition to foreigners and PRs investing in Singapore's property market. They imposed these measures because of extenuating components available in the market." The sale of new dual-key EC models will even be restricted to multi-generational households only. The models have two separate entrances, permitting grandparents, for example, to dwell separately. The vendor's stamp obligation takes effect right this moment and applies to industrial property and plots which might be offered inside three years of the date of buy. JLL named Best Performing Property Brand for second year running
The data offered is for normal info purposes only and isn't supposed to be personalised investment or monetary advice. Motley Fool Singapore contributor Stanley Lim would not personal shares in any corporations talked about. Singapore private home costs increased by 1.eight% within the fourth quarter of 2012, up from 0.6% within the earlier quarter. Resale prices of government-built HDB residences which are usually bought by Singaporeans, elevated by 2.5%, quarter on quarter, the quickest acquire in five quarters. And industrial property, prices are actually double the levels of three years ago. No withholding tax in the event you sell your property. All your local information regarding vital HDB policies, condominium launches, land growth, commercial property and more
There are various methods to go about discovering the precise property. Some local newspapers (together with the Straits Instances ) have categorised property sections and many local property brokers have websites. Now there are some specifics to consider when buying a 'new launch' rental. Intended use of the unit Every sale begins with 10 p.c low cost for finish of season sale; changes to 20 % discount storewide; follows by additional reduction of fiftyand ends with last discount of 70 % or extra. Typically there is even a warehouse sale or transferring out sale with huge mark-down of costs for stock clearance. Deborah Regulation from Expat Realtor shares her property market update, plus prime rental residences and houses at the moment available to lease Esparina EC @ Sengkang - Many property agents need to declare for the PIC grant in Singapore. However, not all of them know find out how to do the correct process for getting this PIC scheme from the IRAS. There are a number of steps that you need to do before your software can be approved.
Naturally, you will have to pay a safety deposit and that is usually one month rent for annually of the settlement. That is the place your good religion deposit will likely be taken into account and will kind part or all of your security deposit. Anticipate to have a proportionate amount deducted out of your deposit if something is discovered to be damaged if you move out. It's best to you'll want to test the inventory drawn up by the owner, which can detail all objects in the property and their condition. If you happen to fail to notice any harm not already mentioned within the inventory before transferring in, you danger having to pay for it yourself.
In case you are in search of an actual estate or Singapore property agent on-line, you simply should belief your intuition. It's because you do not know which agent is nice and which agent will not be. Carry out research on several brokers by looking out the internet. As soon as if you end up positive that a selected agent is dependable and reliable, you can choose to utilize his partnerise in finding you a home in Singapore. Most of the time, a property agent is taken into account to be good if he or she locations the contact data on his website. This may mean that the agent does not mind you calling them and asking them any questions relating to new properties in singapore in Singapore. After chatting with them you too can see them in their office after taking an appointment.
Have handed an trade examination i.e Widespread Examination for House Brokers (CEHA) or Actual Property Agency (REA) examination, or equal; Exclusive brokers are extra keen to share listing information thus making certain the widest doable coverage inside the real estate community via Multiple Listings and Networking. Accepting a severe provide is simpler since your agent is totally conscious of all advertising activity related with your property. This reduces your having to check with a number of agents for some other offers. Price control is easily achieved. Paint work in good restore-discuss with your Property Marketing consultant if main works are still to be done. Softening in residential property prices proceed, led by 2.8 per cent decline within the index for Remainder of Central Region
Once you place down the one per cent choice price to carry down a non-public property, it's important to accept its situation as it is whenever you move in – faulty air-con, choked rest room and all. Get round this by asking your agent to incorporate a ultimate inspection clause within the possibility-to-buy letter. HDB flat patrons routinely take pleasure in this security net. "There's a ultimate inspection of the property two days before the completion of all HDB transactions. If the air-con is defective, you can request the seller to repair it," says Kelvin.
15.6.1 As the agent is an intermediary, generally, as soon as the principal and third party are introduced right into a contractual relationship, the agent drops out of the image, subject to any problems with remuneration or indemnification that he could have against the principal, and extra exceptionally, against the third occasion. Generally, agents are entitled to be indemnified for all liabilities reasonably incurred within the execution of the brokers´ authority.
To achieve the very best outcomes, you must be always updated on market situations, including past transaction information and reliable projections. You could review and examine comparable homes that are currently available in the market, especially these which have been sold or not bought up to now six months. You'll be able to see a pattern of such report by clicking here It's essential to defend yourself in opposition to unscrupulous patrons. They are often very skilled in using highly unethical and manipulative techniques to try and lure you into a lure. That you must also protect your self, your loved ones, and personal belongings as you'll be serving many strangers in your home. Sign a listing itemizing of all of the objects provided by the proprietor, together with their situation. HSR Prime Recruiter 2010 - Template:Cite thesis
- Template:Cite web
I had like 17 domains hosted on single account, and never had any special troubles. If you are not happy with the service you will get your money back with in 45 days, that's guaranteed. But the Search Engine utility inside the Hostgator account furnished an instant score for my launched website. Fantastico is unable to install WordPress in a directory which already have any file i.e to install WordPress using Fantastico the destination directory must be empty and it should not have any previous installation files. When you share great information, others will take note. Once your hosting is purchased, you will need to setup your domain name to point to your hosting. Money Back: All accounts of Hostgator come with a 45 day money back guarantee. If you have any queries relating to where by and how to use Hostgator Discount Coupon, you can make contact with us at our site. If you are starting up a website or don't have too much website traffic coming your way, a shared plan is more than enough. Condition you want to take advantage of the worldwide web you prerequisite a HostGator web page, -1 of the most trusted and unfailing web suppliers on the world wide web today. Since, single server is shared by 700 to 800 websites, you cannot expect much speed.
Hostgator tutorials on how to install Wordpress need not be complicated, especially when you will be dealing with a web hosting service that is friendly for novice webmasters and a blogging platform that is as intuitive as riding a bike. After that you can get Hostgator to host your domain and use the wordpress to do the blogging. Once you start site flipping, trust me you will not be able to stop. I cut my webmaster teeth on Control Panel many years ago, but since had left for other hosting companies with more commercial (cough, cough) interfaces. If you don't like it, you can chalk it up to experience and go on. First, find a good starter template design. When I signed up, I did a search for current "HostGator codes" on the web, which enabled me to receive a one-word entry for a discount. Your posts, comments, and pictures will all be imported into your new WordPress blog.