{"id":16909788,"url":"https://github.com/philiproman/approx","last_synced_at":"2025-03-20T17:48:03.436Z","repository":{"id":139668843,"uuid":"177273005","full_name":"PhilipRoman/approx","owner":"PhilipRoman","description":"Error propagation using Lua","archived":false,"fork":false,"pushed_at":"2019-06-20T17:54:48.000Z","size":39,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-25T16:29:15.470Z","etag":null,"topics":["error-propagation","lua","math","mathjax"],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PhilipRoman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-03-23T10:04:45.000Z","updated_at":"2022-08-23T18:41:09.000Z","dependencies_parsed_at":"2023-07-23T09:30:41.351Z","dependency_job_id":null,"html_url":"https://github.com/PhilipRoman/approx","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilipRoman%2Fapprox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilipRoman%2Fapprox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilipRoman%2Fapprox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilipRoman%2Fapprox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PhilipRoman","download_url":"https://codeload.github.com/PhilipRoman/approx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244666410,"owners_count":20490283,"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":["error-propagation","lua","math","mathjax"],"created_at":"2024-10-13T18:57:44.072Z","updated_at":"2025-03-20T17:48:03.409Z","avatar_url":"https://github.com/PhilipRoman.png","language":"Lua","readme":"# Error propagation using Lua\n\nThe expression `input(\"x\", x, Δx)` denotes a value named \"x\" with a value of x ± Δx. You can use all standard math operators\non these values and the result will contain the propagated error as well as the expression used to obtain both the value and error.\nI built this tool to simplify the process of physics experiments, since error propagation calculation is often very deeply nested\nand complicated.\n\n### Example\n[test.lua](test.lua) contains a demo on how to create some expressions and display them within an HTML file using MathJax.\n\nGiven time `t`, initial positions `x0`, `y0`, initial velocities `vx0`, `vy0` and horizontal acceleration `a`, the following\ncode will calculate the distance between `(0, 0)` and the object after `t` seconds:\n```lua\nlocal t = input(\"t\", 60, 0.01)\nlocal x = input(\"x0\", 0, 0.1) + input(\"vx0\", 5, 0.5)*t + input(\"a\", 3, 0.5)*t^2/2\nlocal y = input(\"y0\", 10, 0.1) + input(\"vy0\", 5, 0.5)*t + input(\"g\", -9.8, 0.1)*t^2/2\nlocal length = vsqrt(x^2 + y^2) -- vsqrt is sqrt for values with error\n```\nThe error and value of `length` can be accessed using `length.val` and `length.err`. Each of these values are\ntables containing the result `val` and textual expression `name`.\n\nUsing MathJax, you can beautify the expressions. The end result looks something like this:\n![Formatted expressions](example.png)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphiliproman%2Fapprox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphiliproman%2Fapprox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphiliproman%2Fapprox/lists"}