{"id":25021886,"url":"https://github.com/adityarohatgi11/numerical_optimization","last_synced_at":"2025-03-30T11:44:09.811Z","repository":{"id":273613928,"uuid":"920304847","full_name":"adityarohatgi11/Numerical_Optimization","owner":"adityarohatgi11","description":"Implementations of Grid Search and Newton-Raphson methods for numerical optimization. It includes Python scripts to compare their performance in maximizing mathematical functions","archived":false,"fork":false,"pushed_at":"2025-01-21T23:20:09.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-05T13:42:06.712Z","etag":null,"topics":["grid-search","newton-raphson-algorithm","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adityarohatgi11.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-21T23:08:11.000Z","updated_at":"2025-01-22T00:03:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"25a2a8c0-ab24-4fc1-a70a-94584129c84e","html_url":"https://github.com/adityarohatgi11/Numerical_Optimization","commit_stats":null,"previous_names":["adityarohatgi11/numerical_optimization"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityarohatgi11%2FNumerical_Optimization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityarohatgi11%2FNumerical_Optimization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityarohatgi11%2FNumerical_Optimization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityarohatgi11%2FNumerical_Optimization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adityarohatgi11","download_url":"https://codeload.github.com/adityarohatgi11/Numerical_Optimization/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246314120,"owners_count":20757457,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["grid-search","newton-raphson-algorithm","python"],"created_at":"2025-02-05T13:37:13.704Z","updated_at":"2025-03-30T11:44:09.805Z","avatar_url":"https://github.com/adityarohatgi11.png","language":"Python","readme":"# Numerical Optimization using Grid Search and Newton-Raphson\n\nThis repository contains an implementation of two numerical optimization methods — **Grid Search** and **Newton-Raphson** — for finding the maximum of a given mathematical function.\n\n## Project Overview\n\n### Assignment Description\nThe project compares the performance of **Grid Search** and **Newton-Raphson** methods in optimizing a mathematical function f: R^2 -\u003e R. Both methods compute the maximum value of the function within specific constraints and measure the number of function calls made during execution.\n\n### Key Functions\n1. **`gridsearch`**: Uses a brute-force grid search algorithm to find the maximum of the function \\( f \\) over a defined interval with a given precision.\n2. **`newton`**: Implements the Newton-Raphson method to find the maximum of the function \\( f \\) using its gradient and Hessian matrix.\n\n---\n\n## Getting Started\n\n### Prerequisites\nThis project requires Python 3.x. No additional libraries are needed.\n\n### Files\n- **`optimization_project.py`**: Python script containing the implementations of `gridsearch` and `newton` functions.\n- **Documentation**: This README and the assignment description document provide details about the methods and implementation.\n\n---\n\n## Usage\n\n### Running the Code\n1. Clone this repository.\n2. Open `optimization_project.py` in your favorite Python IDE or text editor.\n3. The code includes predefined test cases:\n   - **Newton-Raphson**: \n     ```python\n     newton([0,0], 0.001, f, f1, f2)\n     ```\n     Tests the method with an initial guess of \\([0, 0]\\) and \\( epsilon = 0.001 \\).\n   - **Grid Search**: \n     ```python\n     gridsearch([-10,-10], [10,10], 0.01, f)\n     ```\n     Tests the method over the interval \\([-10, 10]\\) for both dimensions with a precision of \\( 0.01 \\).\n\n4. Run the script:\n   ```bash\n   python optimization.py\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadityarohatgi11%2Fnumerical_optimization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadityarohatgi11%2Fnumerical_optimization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadityarohatgi11%2Fnumerical_optimization/lists"}