Make plugin, Calculate Number and Display Chart
Project ID:
790634
Project Type:
Fixed
Budget:
$30-$250 USD
Project Description:
We have some php code that allows user to enter some data. We need to make this code into a plugin? so that it can be used on the frontend to enter some data, store data 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"}
Once user click submit, 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
Public Clarification Board
0 messages