Skip to content

Commit

Permalink
spelling mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
n0rbed committed Jul 25, 2024
1 parent 0d6395e commit 3535116
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/solver/attract.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
6 changes: 3 additions & 3 deletions src/solver/ia_main.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/solver/main.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3535116

Please sign in to comment.