Skip to Content
高效能PYTHON程式設計
book

高效能PYTHON程式設計

by Micha Gorelick, Ian Ozsvald
August 2015
Intermediate to advanced
384 pages
7h 42m
Chinese
GoTop Information, Inc.
Content preview from 高效能PYTHON程式設計
102
|
第六章
問題介紹
這一節主要是為了讓我們更深入理解本章即將解決的方程式,然而,就探索本
章其餘部分而言,瞭解這一節嚴格來說並非必要。如果你希望略過這一節,請
務必檢視過範例 6-1 6-2 的演算法,確實瞭解我們即將最佳化的程式碼。
另一方面,如果你讀過這一節,並且想要瞭解更多資訊,請參閱《
Numerical
Recipes
》( 3 版,William Press 等著,劍橋大學出版社)的第 17 章。
為了探索本章的矩陣與向量計算,我們將反覆地使用流體擴散的範例。擴散
diffusion)是移動流體,並試圖讓它們均勻混合的機制之一。
在這一節裡,我們將探索擴散方程式(diffusion equation)背後的數學問題,看起來可
能有些複雜,但是別擔心!我們會迅速簡化這個問題,讓它更容易被理解。此外,務必
注意,雖然對我們正在解決的方程式具有基本的認識有助於本章的閱讀,但並非必要;
後續章節主要聚焦於程式碼的各種規劃,而不是方程式本身。不過,理解方程式將有助
於你洞悉如何最佳化你的程式碼。這基本上是真實的—瞭解程式碼背後的動機以及演算
法的錯綜複雜,將讓你深入洞察可能的最佳化方法。
一個簡單的擴散範例就是水裡頭的染料︰如果你在室溫下把幾滴染料放進水中,它將慢
慢擴散,直到完全與水融合。因為我們沒有攪動,水的溫度不會提高到足以產生對流,
擴散將是混合二種液體的主要過程。在以數值方法解決這些方程式時,我們挑選想要
的初始條件,並且能夠隨著時間持續演進,看看一段時間過後會是什麼模樣(參閱圖
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Kafka权威指南

Kafka权威指南

Neha Narkhede, Gwen Shapira, Todd Palino
手把手教会你linux

手把手教会你linux

桑德.范.乌格特
流畅的Python

流畅的Python

Luciano Ramalho
精通機器學習

精通機器學習

Aurélien Géron

Publisher Resources

ISBN: 9789863477105