
舉例來說,我們在針對參數作敏感性分析時,你可能會每個每個參數分別計算,那實在太麻煩。在Mathematica我們可以這樣做:
Step 1. 產生所有變動參數組合
mysendata=Flatten[Table[ xxx /. xxx[[i]] -> xxx[[i]]*j, {i, 變數個數}, {j, 0.5, 1.5, 0.1}], 1]
Step 2. 以11個資料為一組將所有參數組合帶進求解最佳解
mysen = Partition[(Parameter1 = #[[1]]; Parameter2 = #[[2]]; .....; Parametern= #[[n]];
NMaximize[{objective, constraints}, variables][[2]]) & /@ mysendata, 11]
Step 3. 表格輸出
TableForm[mysen]
簡單,輕鬆,愉快~~
範例
目標函數:tp, 變數:t1, t2
產生所有變動參數組合

以11個資料為一組將所有參數組合帶進求解最佳解

表格輸出

輸出TeX程式碼

讀者回應 ( 0 意見 )
訂閱發佈留言 (Atom)
發佈留言
Please leave your name and tell me what you thought about this site. Comments, suggestions and views are welcomed.
如果這篇文章對你有幫助,那請留個訊息給我~