-
Notifications
You must be signed in to change notification settings - Fork 77
Add C to integration result, change integral node to support range instead of iterations, implement u-substitution and quadratic denominator integral, integration of abs(x), sgn(x) and ln(abs(x))^2 #657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
8dcdff0
e31895c
f748d73
fdd562e
4e29b41
90767b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -328,21 +328,35 @@ public static Entity Differentiate(this string str, Variable x) | |
| => str.ToEntity().Differentiate(x); | ||
|
|
||
| /// <summary> | ||
| /// Integrates the given expression over the `x` variable, if can. | ||
| /// Integrates indefinitely the given expression over the `x` variable, if can. | ||
| /// May return an unresolved <see cref="Integralf"/> node. | ||
| /// </summary> | ||
| /// <param name="str"> | ||
| /// The expression to be parsed and integrated over <paramref name="x"/> | ||
| /// The expresion to be parsed and integrated | ||
| /// </param> | ||
| /// <param name="x">Over which to integrate</param> | ||
| /// <param name="x">Over which variable to integrate</param> | ||
| /// <returns> | ||
| /// An integrated expression. It might remain the same, | ||
| /// it might have no integrals, and it might be transformed so that | ||
| /// only a few nodes have unresolved integrals. | ||
| /// An integrated expression. It might remain the same or be transformed into nodes with no integrals. | ||
| /// </returns> | ||
| public static Entity Integrate(this string str, Variable x) | ||
| => str.ToEntity().Integrate(x); | ||
|
|
||
| /// <summary> | ||
| /// Integrates definitely the given expression over the `x` variable, if can. | ||
| /// May return an unresolved <see cref="Integralf"/> node. | ||
| /// </summary> | ||
| /// <param name="str"> | ||
| /// The expresion to be parsed and integrated | ||
|
||
| /// </param> | ||
| /// <param name="x">Over which variable to integrate</param> | ||
| /// <param name="from">The lower bound for integrating</param> | ||
| /// <param name="to">The upper bound for integrating</param> | ||
| /// <returns> | ||
| /// An integrated expression. It might remain the same or be transformed into nodes with no integrals. | ||
| /// </returns> | ||
| public static Entity Integrate(this string str, Variable x, Entity from, Entity to) | ||
| => str.ToEntity().Integrate(x, from, to); | ||
|
|
||
| /// <summary> | ||
| /// Finds the limit of the given expression over the given variable | ||
| /// </summary> | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,7 +1,7 @@ | ||||||||||||||||||
| /* | ||||||||||||||||||
|
|
||||||||||||||||||
| Remember to run the "antlr_rerun.bat" file at the project root every time you modify this file so that other | ||||||||||||||||||
| source files under the Antlr folder can update and be reflected in other parts of AngouriMath! | ||||||||||||||||||
| Remember to run the "antlr_rerun.bat" file in the "Sources/Utils" folder every time you modify this file so | ||||||||||||||||||
| that other source files under the Antlr folder can update and be reflected in other parts of AngouriMath! | ||||||||||||||||||
| It only consists of commands that are consistent across CMD and Bash so you should be able to run that file | ||||||||||||||||||
| regardless of whether you are on Windows, Linux or Mac. You need to have an installed Java Runtime, however. | ||||||||||||||||||
|
||||||||||||||||||
| Remember to run the "antlr_rerun.bat" file in the "Sources/Utils" folder every time you modify this file so | |
| that other source files under the Antlr folder can update and be reflected in other parts of AngouriMath! | |
| It only consists of commands that are consistent across CMD and Bash so you should be able to run that file | |
| regardless of whether you are on Windows, Linux or Mac. You need to have an installed Java Runtime, however. | |
| Remember to run the "antlr_rerun.bat" file located at "Sources/Utils/antlr_rerun.bat" (relative to the repository root) | |
| every time you modify this file so that the generated source files under the Antlr folder are updated and changes are | |
| reflected in other parts of AngouriMath. The script only consists of commands that are consistent across CMD and Bash, | |
| so you should be able to run it on Windows, Linux, or Mac. You need to have an installed Java Runtime, however. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2968,12 +2968,12 @@ public AtomContext atom() { | |
| State = 734; | ||
| Match(T__39); | ||
|
|
||
| if (Assert("integral", (3, 2), _localctx.args.list.Count)) | ||
| if (Assert("integral", (4, 2), _localctx.args.list.Count)) | ||
| { | ||
| if (_localctx.args.list[2] is Integer { EInteger: var asEInt }) | ||
| _localctx.value = MathS.Integral(_localctx.args.list[0], _localctx.args.list[1], asEInt.ToInt32Checked()); | ||
| if (_localctx.args.list.Count == 4) | ||
| _localctx.value = MathS.Integral(_localctx.args.list[0], _localctx.args.list[1], _localctx.args.list[2], _localctx.args.list[3]); | ||
| else | ||
| throw new InvalidArgumentParseException("Expected number for the third argument of integral"); | ||
| _localctx.value = MathS.Integral(_localctx.args.list[0], _localctx.args.list[1]); | ||
|
Comment on lines
+2973
to
+2976
|
||
| } | ||
| else | ||
| _localctx.value = MathS.Integral(_localctx.args.list[0], _localctx.args.list[1]); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling error: "expresion" should be "expression".