From 3535116e5b60e7a6290528fe627c1bfd308c17ad Mon Sep 17 00:00:00 2001 From: n0rbed Date: Thu, 25 Jul 2024 16:03:59 +0300 Subject: [PATCH] spelling mistakes --- src/solver/attract.jl | 2 +- src/solver/ia_main.jl | 6 +++--- src/solver/main.jl | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/solver/attract.jl b/src/solver/attract.jl index b256f33fe..27da8c863 100644 --- a/src/solver/attract.jl +++ b/src/solver/attract.jl @@ -76,7 +76,7 @@ function detect_trig(lhs, var) args = arguments(u_lhs) oper = operation(u_lhs) - # should traverse entire expresssion in the future, so + # should traverse entire expression in the future, so # u_lhs as a whole, then u_lhs arg by arg recursively, # say we have 2sin(x)cos(x) / y # or do we do this traversing outside? in the mother func attract? diff --git a/src/solver/ia_main.jl b/src/solver/ia_main.jl index ccb4c7c0f..69c52ca5d 100644 --- a/src/solver/ia_main.jl +++ b/src/solver/ia_main.jl @@ -172,7 +172,7 @@ This function attempts to solve transcendental functions by first checking the "smart" number of occurrences in the input LHS. By smart here we mean that polynomials are counted as 1 occurrence. for example `x^2 + 2x` is 1 occurrence of x. So we abstract all occurrences of x's as polynomials. -Say: `log(x+1) + x^2` is seen as `log(f(x)) + g(x)` so there are 2 ocurrences +Say: `log(x+1) + x^2` is seen as `log(f(x)) + g(x)` so there are 2 occurrences of x. If there is only 1 occurrence of x in an input expression, isolate is called. Isolate reverses all operations applied on the occurrence of x until we have @@ -183,13 +183,13 @@ occurrences of x in order to reduce these occurrences to 1. For example, `log(x+1) + log(x-1)` can be converted to `log(x^2 - 1)` which now could be isolated using Isolate. -`attract(lhs, var)` currently uses 3 techniques for attraction. +`attract(lhs, var)` currently uses 4 techniques for attraction. - Log addition: `log(f(x)) + log(g(x)) => log(h(x))` - Exponential simplification: `a*b^(f(x)) + c*d^(g(x)) => f(x) * log(b) - g(x) * log(d) + log(-a/c)`. And now this is actually 1 occurrence of x since `f(x)` and `g(x)` are just multiplied by constants not wrapped in some operation. - Trig simplification: this bruteforces multiple trig identities and doesn't detect them before hand. - Polynomialization: as a last resort, attract attempts to polynomialize the expression. Say `sin(x+2)^2 + sin(x+2) + 10` is converted to `X^2 + X + 10`, we then solve this using our polynomial solver, and afterwards, isolate `sin(x+2) = the roots found by solve for X^2 + X + 10` -After attraction, we check the number of ocurrences again, and if its 1, we isolate, if not, +After attraction, we check the number of occurrences again, and if its 1, we isolate, if not, we throw an error to tell the user that this is currently unsolvable by our covered techniques. # Arguments diff --git a/src/solver/main.jl b/src/solver/main.jl index 781ba2dfd..146519cc1 100644 --- a/src/solver/main.jl +++ b/src/solver/main.jl @@ -30,7 +30,7 @@ The `solve` function implements the following backends: - x: Could be a single variable or an array of variables which should be solved -- multiplicities: Should the output be printed `n` times where `n` is the number of occurrence of the root? Say we have `(x+1)^2`, we then have 2 roots `x = -1`, by default the output is `[-1]`, If multiplicites is inputed as true, then the output is `[-1, -1]`. +- multiplicities: Should the output be printed `n` times where `n` is the number of occurrence of the root? Say we have `(x+1)^2`, we then have 2 roots `x = -1`, by default the output is `[-1]`, If multiplicities is inputted as true, then the output is `[-1, -1]`. # Examples