kappa-89
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 熱擴散(Thermal Diffusion) ## 簡介 ![](https://i.imgur.com/wJCwc9M.png) 在這個宇宙中,能量的分佈最終會趨於平衡。而熱能在一個空間中的分佈情況可以由溫度隨著時間變化的過程來描述。於是我們可以推導出**熱方程式**以及其變化型態: ![](https://i.imgur.com/NQ38FU1.png) <br> 其中alpha為熱擴散率,為物體内部熱量擴散速率的量度,也就是物體内部溫度趨向均匀的能力。而當我們將空間設為一個一個的格點時,可以將上述方程式簡化為 ![](https://i.imgur.com/dJBgPQz.png) 代表著每一點的溫度變化會受到相鄰點溫度的影響,以此類推,完成熱擴散的過程。 ## 例題 我們假設有一個邊長為0.1公尺的正方形銅板,其初始溫度值如下圖所示,格點的距離設為0.0025公尺,銅板的熱擴散率設為0.000111。目標是要觀察其溫度隨時間的擴散情況和中心點達到定溫的時間。 ![](https://i.imgur.com/xcITNSs.png) <br> 1. 參數(epsilon為收斂判定值、r_x\r_y為該點的溫度變化率) ``` %參數:熱擴散係數、邊界條件 alpha=1.11e-4; L=0.05; H=0.05; dx=0.0025; dy=0.0025; tmax=50; dt=0.01; epsilon=1e-4; r_x=alpha*dt/dx^2; r_y=alpha*dt/dy^2; ``` <br> <br> 2. 首先建立格點和銅板的中心點。接著建立一個對應格點數的溫度矩陣,並設定邊界的溫度條件。 ``` % 建立 x,y軸網格點 nx=uint32(L/dx+1); ny=uint32(H/dy+1); [X,Y]=meshgrid(linspace(0,L,nx),linspace(0,H,ny)); %中心點 ic=uint32((nx-1)/2+1); jc=uint32((ny-1)/2+1); % 建立初始溫度:左右25度、下50度、上0度 T=10*ones(ny,nx); T(:,1)=25; T(:,end)=25; T(1,:)=50; T(end,:)=0; ``` <br> <br> 3. 最後來跑**while**迴圈,這邊是分成垂直方向和平行方向的溫度擴散來做計算。特別注意每一個點除了會受到周圍四個臨點的溫度影響,**自己也會貢獻熱量給周圍四個臨點**,因此要記得減去自己造成的影響。作圖的部分則是利用**contourf**函數來話出溫度擴散輪廓圖、**scatter**函數來畫出中心點溫度圖。記得要設定**pause(秒數)** 來更新圖片,才會有動圖的效果。最後當中心點溫度收斂時結束迴圈。 ``` % 迴圈設定 n=0; nmax=uint32(tmax/dt); while n < nmax n=n+1; T_n=T; for j=2:ny-1 for i=2:nx-1 T(j,i)=T_n(j,i)+r_x*(T_n(j,i+1)-2*T_n(j,i)+T_n(j,i-1))... +r_y*(T_n(j+1,i)-2*T_n(j,i)+T_n(j-1,i)); end end if uint16(n/50) == n/50 % 溫度擴散輪廓圖 subplot(1,2,1),contourf(X,Y,T,30); colormap(jet) title(sprintf('Time = %g s',n*dt)), colorbar(), xlabel('x (m)'),ylabel('y (m)') axis('equal','tight'), % 中心點溫度隨時間之變化 subplot(1,2,2),scatter(n*dt,T(jc,ic),'r.'); grid on; xlim([0 tmax]),xlabel('t (s)'),ylabel('Tcenter') hold('on') pause(0.01) end % 確認有無收斂 err=max(max(abs((T-T_n)))); if err<=epsilon break end end ``` <br> <br> 4. 最後的圖片會長這樣,完整的動圖請點選下方的網址觀看。 ![](https://i.imgur.com/J5U5Yp6.png) https://www.youtube.com/watch?v=5hC7xpFavBA ## 練習 請下載附件的程式碼並加以修改來模擬不同物體、溫度、邊界條件的熱擴散情形並詳細比較。

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully