File:DiffusionMicroMacro.gif
出自Wikimedia Commons
跳至導覽
跳至搜尋
DiffusionMicroMacro.gif (360 × 300 像素,檔案大小:402 KB,MIME 類型:image/gif、循環、60 畫格、6.5秒)
檔案資訊
結構化資料
說明
說明
添加單行說明來描述出檔案所代表的內容
ব্যাপন প্রক্রিয়া
![]() |
File:DiffusionMicroMacro.svg是本檔案的向量版本。 如果品質不低,就應該優先使用該檔案,而非GIF檔案。
File:DiffusionMicroMacro.gif → File:DiffusionMicroMacro.svg
更多資訊請參閱Help:SVG/zh。
|
摘要
[編輯]描述DiffusionMicroMacro.gif |
English: Diffusion from a microscopic and macroscopic point of view. Initially, there are solute molecules on the left side of a barrier (magenta line) and none on the right. The barrier is removed, and the solute diffuses to fill the whole container. Top: A single molecule moves around randomly. Middle: With more molecules, there is a clear trend where the solute fills the container more and more evenly. Bottom: With an enormous number of solute molecules, the randomness is gone: The solute appears to move smoothly and systematically from high-concentration areas to low-concentration areas, following Fick's laws.
Image is made in Mathematica, source code below. |
日期 | |
來源 | 自己的作品 |
作者 | Sbyrnes321 |
授權條款
[編輯]Public domainPublic domainfalsefalse |
![]() |
我,此作品的版權所有人,釋出此作品至公共領域。此授權條款在全世界均適用。 這可能在某些國家不合法,如果是的話: 我授予任何人有權利使用此作品於任何用途,除受法律約束外,不受任何限制。 |
<< Mathematica source code >>
(* Source code written in Mathematica 6.0, by Steve Byrnes, 2010. I release this code into the public domain. Sorry it's messy...email me any questions. *) (*Particle simulation*) SeedRandom[1]; NumParticles = 70; xMax = 0.7; yMax = 0.2; xStartMax = 0.5; StepDist = 0.04; InitParticleCoordinates = Table[{RandomReal[{0, xStartMax}], RandomReal[{0, yMax}]}, {i, 1, NumParticles}]; StayInBoxX[x_] := If[x < 0, -x, If[x > xMax, 2 xMax - x, x]]; StayInBoxY[y_] := If[y < 0, -y, If[y > yMax, 2 yMax - y, y]]; StayInBoxXY[xy_] := {StayInBoxX[xy[[1]]], StayInBoxY[xy[[2]]]}; StayInBarX[x_] := If[x < 0, -x, If[x > xStartMax, 2 xStartMax - x, x]]; StayInBarY[y_] := If[y < 0, -y, If[y > yMax, 2 yMax - y, y]]; StayInBarXY[xy_] := {StayInBarX[xy[[1]]], StayInBarY[xy[[2]]]}; MoveAStep[xy_] := StayInBoxXY[xy + {RandomReal[{-StepDist, StepDist}], RandomReal[{-StepDist, StepDist}]}]; MoveAStepBar[xy_] := StayInBarXY[xy + {RandomReal[{-StepDist, StepDist}], RandomReal[{-StepDist, StepDist}]}]; NextParticleCoordinates[ParticleCoords_] := MoveAStep /@ ParticleCoords; NextParticleCoordinatesBar[ParticleCoords_] := MoveAStepBar /@ ParticleCoords; NumFramesBarrier = 10; NumFramesNoBarrier = 50; NumFrames = NumFramesBarrier + NumFramesNoBarrier; ParticleCoordinatesTable = Table[0, {i, 1, NumFrames}]; ParticleCoordinatesTable[[1]] = InitParticleCoordinates; For[i = 2, i <= NumFrames, i++, If[i <= NumFramesBarrier, ParticleCoordinatesTable[[i]] = NextParticleCoordinatesBar[ParticleCoordinatesTable[[i - 1]]], ParticleCoordinatesTable[[i]] = NextParticleCoordinates[ParticleCoordinatesTable[[i - 1]]]];]; (*Plot full particle simulation*) makeplotbar[ParticleCoord_] := ListPlot[{ParticleCoord, {{xStartMax, 0}, {xStartMax, yMax}}}, Frame -> True, Axes -> False, PlotRange -> {{0, xMax}, {0, yMax}}, Joined -> {False, True}, PlotStyle -> {PointSize[.03], Thick}, AspectRatio -> yMax/xMax, FrameTicks -> None]; makeplot[ParticleCoord_] := ListPlot[ParticleCoord, Frame -> True, Axes -> False, PlotRange -> {{0, xMax}, {0, yMax}}, Joined -> False, PlotStyle -> PointSize[.03], AspectRatio -> yMax/xMax, FrameTicks -> None] ParticlesPlots = Join[Table[makeplotbar[ParticleCoordinatesTable[[i]]], {i, 1, NumFramesBarrier}], Table[makeplot[ParticleCoordinatesTable[[i]]], {i, NumFramesBarrier + 1, NumFrames}]]; (*Plot just the first particle in the list...Actually the fifth particle looks better. *) FirstParticleTable = {#[[5]]} & /@ ParticleCoordinatesTable; FirstParticlePlots = Join[Table[makeplotbar[FirstParticleTable[[i]]], {i, 1, NumFramesBarrier}], Table[makeplot[FirstParticleTable[[i]]], {i, NumFramesBarrier + 1, NumFrames}]]; (* Continuum solution *) (* I can use the simple diffusion-on-an-infinite-line formula, as long as I correctly periodically replicate the initial condition. Actually just computed nearest five replicas in each direction, that was a fine approximation. *) (* k = diffusion coefficient, visually matched to simulation. *) k = .0007; u[x_, t_] := If[t == 0, If[x <= xStartMax, 1, 0], 1/2 Sum[ Erf[(x - (-xStartMax + 2 n xMax))/Sqrt[4 k t]] - Erf[(x - (xStartMax + 2 n xMax))/Sqrt[4 k t]], {n, -5, 5}]]; ContinuumPlots = Join[ Table[Show[ DensityPlot[1 - u[x, 0], {x, 0, xMax}, {y, 0, yMax}, ColorFunctionScaling -> False, AspectRatio -> yMax/xMax, FrameTicks -> None], ListPlot[{{xStartMax, 0}, {xStartMax, yMax}}, Joined -> True, PlotStyle -> {Thick, Purple}]], {i, 1, NumFramesBarrier}], Table[ DensityPlot[1 - u[x, tt], {x, 0, xMax}, {y, 0, yMax}, ColorFunctionScaling -> False, AspectRatio -> yMax/xMax, FrameTicks -> None], {tt, 1, NumFramesNoBarrier}]]; (*Combine and export *) TogetherPlots = Table[GraphicsGrid[{{FirstParticlePlots[[i]]}, {ParticlesPlots[[i]]}, {ContinuumPlots[[i]]}}, Spacings -> Scaled[0.2]], {i, 1, NumFrames}]; Export["test.gif", Join[TogetherPlots, Table[Graphics[], {i, 1, 5}]], "DisplayDurations" -> {10}, "AnimationRepititions" -> Infinity ]
檔案歷史
點選日期/時間以檢視該時間的檔案版本。
日期/時間 | 縮圖 | 尺寸 | 用戶 | 備註 | |
---|---|---|---|---|---|
目前 | 2012年3月7日 (三) 13:41 | ![]() | 360 × 300(402 KB) | Dratini0(對話 | 貢獻) | Just removed the white last fram for aesthetic purposes, and prologed the display time of the last frame to mark the reatart of the animation. |
2010年3月25日 (四) 19:37 | ![]() | 360 × 300(402 KB) | Aiyizo(對話 | 貢獻) | Optimized animation, converted to 256 color mode | |
2010年1月16日 (六) 09:57 | ![]() | 360 × 300(529 KB) | Sbyrnes321(對話 | 貢獻) | sped up bottom panel to match better with middle panel | |
2010年1月16日 (六) 09:46 | ![]() | 360 × 300(508 KB) | Sbyrnes321(對話 | 貢獻) | {{Information |Description={{en|1=Diffusion from a microscopic and macroscopic point of view. Initially, there are solute molecules on the left side of a barrier (purple line) and none on the right. The barrier is removed, and the solute diffuses to fill |
無法覆蓋此檔案。
檔案用途
下列頁面有用到此檔案:
全域檔案使用狀況
以下其他 wiki 使用了這個檔案:
- ar.wikipedia.org 的使用狀況
- ast.wikipedia.org 的使用狀況
- bn.wikipedia.org 的使用狀況
- ca.wikipedia.org 的使用狀況
- cy.wikipedia.org 的使用狀況
- el.wikipedia.org 的使用狀況
- en.wikipedia.org 的使用狀況
- es.wikipedia.org 的使用狀況
- et.wikipedia.org 的使用狀況
- fa.wikipedia.org 的使用狀況
- fi.wikipedia.org 的使用狀況
- fr.wikipedia.org 的使用狀況
- ga.wikipedia.org 的使用狀況
- gl.wikipedia.org 的使用狀況
- he.wikipedia.org 的使用狀況
- hi.wikipedia.org 的使用狀況
- is.wikipedia.org 的使用狀況
- kk.wikipedia.org 的使用狀況
- ko.wikipedia.org 的使用狀況
- no.wikipedia.org 的使用狀況
- pl.wikipedia.org 的使用狀況
- pt.wikipedia.org 的使用狀況
- ro.wikipedia.org 的使用狀況
- sh.wikipedia.org 的使用狀況
- sk.wikipedia.org 的使用狀況
- sl.wikipedia.org 的使用狀況
- sr.wikipedia.org 的使用狀況
- ta.wikipedia.org 的使用狀況
- vi.wikipedia.org 的使用狀況
檢視此檔案的更多全域使用狀況。