Project ID:
785239
Project Type:
Fixed
Budget:
$30-$250 USD
Project Description:
We need to crate an interface for the user to enter some data, store it in a table and then use some formulas to calculate a number for the data entered. The data entered by user will consist of (number, date) pairs and the formulas for calculation are provided below. Once number is generated we create a chart by saving entry in plotalot table so that chart can be displayed on user front end using plotalot plugin example: { plotalotid id="3"}
Data input by user will have the following options:
1. Enter Initial Deposit and Date
2. Enter Recurring deposit and start and end dates (select from weekly, monthly or yearly)
3. Enter Recurring Withdrawals and start and end dates (select from weekly, monthly, yearly)
4. Enter One time Deposit and date
5. Enter One time Withdrawal and date
6. Enter Final value and date
Note that user can have multiple entries for number 2 to to 5.
Once user click submits, data is saved in table and a number R is calculated from the data using the following formula:
NPV = sum [ value(i)/(1+R)^t(i) ] where value(i) and t(i) are number and time interval from table.
To calculate R, we run random tests to find NPV(R1) >0 and NPV(R0) <0
We then use following code to find R where NPV(R) =0.
// Assumption: One of f(a) and f(b) is ≥ 0 and the other is ≤ 0
if f(a) <= 0 then
lo := a; hi := b
else
lo := b; hi := a
endif
mid := lo + (hi-lo)/2
while (mid ≠ lo) and (mid ≠ hi) do
if f(mid) ≤ 0 then
lo := mid
else
hi := mid
endif
mid := lo + (hi-lo)/2
endwhile
return mid
Skills required:
Joomla,
PHP