フィルターのクリア

Solve Symsum equation for implied discount rate

2 ビュー (過去 30 日間)
peterhack
peterhack 2016 年 7 月 2 日
コメント済み: peterhack 2016 年 7 月 3 日
Dear All,
I am trying to solve for a discount rate which sets the net present value to a specific value.
Stream = [-20000, 2000, 2500, 3500, -5000, 6500,...
9500, 9500, 9500];
syms x k real;
eqn = symsum(Stream(1,k)*(1+x)^-k,k,1, length(Stream)) == 5274;
solx = solve(eqn,x)
Could anyone help to get the exact number for x?
Thanks in advance!

採用された回答

Walter Roberson
Walter Roberson 2016 年 7 月 2 日
symsum() cannot be used for indexing. Create a vector of symbolic values and sum() that.
eqn = sum(Stream .* (1+x).^-(1:length(Stream))) == 5274
  1 件のコメント
peterhack
peterhack 2016 年 7 月 3 日
This did the trick. Additionally I have used vpasolve over a certain intervall to get the numeric value:
syms x k real;
eqn = sum(Stream .* (1+x).^-(1:length(Stream))) == 5274;
alpha = vpasolve(eqn,x,[0 1])

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by