2
我在數學下面的代碼:在mathematica中解決這個問題?
rbar = 0.006236
rt = r_bar
k = 0.95
sigmar = 0.002
betazr = -0.00014
sigmaz = 0.4
pi = 0.99
chi = 0.05
Cbar = -3.7
alpha1[n_] := alpha1[n] = alpha1[n - 1] + alpha2[n - 1]
alpha2[n_] := alpha2[n] = k (alpha2[n - 1])
sigma1sq[n_] :=
sigma1sq[n] = sigma2sq[n - 1] + 2 sigma12[n - 1] + sigmaz^2
sigma12[n_] :=
sigma12[n] = k (sigma12[n - 1]) + k (sigma2sq[n - 1]) + betazr
sigma2sq[n_] := sigma2sq[n] = (k^2) (sigma2sq[n - 1]) + sigmar^2
phi1[n_] := phi1[n] = phi1[n - 1] + phi2[n - 1] + (0.5) (sigmaz^2)
phi2[n_] := phi2[n] = k (phi2[n - 1]) + (1 - k) (rbar)
psi[n_] := psi[n] = phi1[n] - (0.5) (sigma1sq[n])
alpha1[0] = 0
alpha2[0] = 1
sigma1sq[0] = 0
sigma12[0] = 0
sigma2sq[0] = 0
phi1[0] = 0
phi2[0] = 0
B[h_, r_] := Exp[(-alpha1[h]) (r) - psi[h]]
Exp[Cbar - beta] Sum[(Pi^x) B[x, r], {x, 1, 1000}]
,我想知道是否有可能解決的最後一行,使得我有「R」爲「測試版」的功能,滿足
Exp[Cbar - beta] Sum[(Pi^x) B[x, r], {x, 1, 1000}] == 1
因爲最終,我需要整合一個函數J [r]而不是「beta」,所以如果我沒有「r」作爲「beta」的函數,我不知道如何進行整合f] [R]。
它會的必須讓你的代碼稍微減少一點。例如,你可以求解所有的遞歸方程,如RSolve [alpha2 [n] == k(alpha2 [n-1]),alpha2 [0] == 1},alpha2 [n],n] [[ 1,1,2]]'。 –
[1,1,2]在這種情況下做了什麼?可以隔離「r」嗎?謝謝! – user1664484
'[[...]]'和'Part'一樣。我用它將解決方案提取到'RSolve',其形式爲{{alpha2-> solution}}'。我認爲你可以自己取得進展。 –