Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brunolkatz/php-goalseek
A simple function to simulate Goal Seek excel/libre office using Regula Falsi Method https://packagist.org/packages/kidjapa/php-goalseek
https://github.com/brunolkatz/php-goalseek
Last synced: about 2 months ago
JSON representation
A simple function to simulate Goal Seek excel/libre office using Regula Falsi Method https://packagist.org/packages/kidjapa/php-goalseek
- Host: GitHub
- URL: https://github.com/brunolkatz/php-goalseek
- Owner: brunolkatz
- License: mit
- Created: 2019-12-10T11:17:42.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-22T18:03:28.000Z (almost 4 years ago)
- Last Synced: 2024-11-13T06:22:40.327Z (3 months ago)
- Language: PHP
- Homepage:
- Size: 17.6 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Php-GoalSeek
- Php function to simulate Goal Seek from libre office using the Regula Falsi method.
- In most cases the result is equal of the Excel formula. Because the Excel do not show what formula are used in goal seak we need to use the similar function in Libre Office.- Install
```bash
composer require kidjapa/php-goalseek
```## In Libre office
- Function in archive: core/sc/source/coredata/dcoumen4.cxx
```c++
bool ScDocument::Solver(SCCOL nFCol, SCROW nFRow, SCTAB nFTab,
SCCOL nVCol, SCROW nVRow, SCTAB nVTab,
const OUString& sValStr,
double& nX
)
```## Sample
```php
$goalSeek = new SolveGoalSeek();$getValue = 0;
$getValue = $goalSeek->seekGoal(
function($value, $data){
return sqrt($value);
},
16, // The Actual Value
20 // The Goal Value
);echo "------------- results ------------- \n";
echo "Result: ".$getValue."\n"; // Expect: 400
```