1.前言:
課本中常涉及到大量的數學運算,例如生物學,物理學,化學,數學以及統計學等,可以透過Science Code.Net的函式庫做實際的程式科學計算。
2.說明:
Science Code.Net提供的函式庫目的在提供學生在撰寫程式時可以使用的科學計算類別及函式庫,將教科書中呆板的知識轉為可以靈活應用的軟體系統,幫助學生了解科學。
目前函式庫運行的環境要在.Net 4.5,本範例使用SharpDevelop開發,Target CPU選擇32-bit Intel-compatible processor模式編譯。
軟體說明及函式庫下載:
http://www.sciencecode.com/
加入參考: Science.dll
加入命名空間:
using BIO = Science.Biology.PopulationGenetics; using GC = Science.Chemistry.GeneralChemistry; using IE = Science.Mathematics.IntegralEquation; using LA = Science.Mathematics.LinearAlgebra; using OD = Science.Mathematics.OrdinaryDifferentialEquation; using PD = Science.Mathematics.PartialDifferentialEquation; using SF = Science.Mathematics.SpecialFunction; using VC = Science.Mathematics.VectorCalculus; using GP = Science.Physics.GeneralPhysics; using QM = Science.Physics.QuantumMechanics; using BS = Science.Statistics.BasicStatistics;
程式碼:
//元素在週期表中的基本性質 private string AtomProperties(int atomNumber) { string result = ""; GP.Atom atom = new GP.Atom(); atom.AtomNumber = atomNumber; atom.Find(); result += atom.AtomSymbol.ToString() + "\r\n" + //元素符號 atom.AtomName.ToString() + "\r\n" + //元素名稱 atom.AtomicMass.ToString() + "\r\n" + //元素質量 atom.ElectronConfiguration.ToString() + "\r\n"; //元素電子組態 return result; }
3.應用:
//查詢矽在週期表中的基本性質 string atom = AtomProperties(14); MessageBox.Show(atom);
圖例:
文章標籤
全站熱搜
留言列表