Skip to content

Commit

Permalink
More docsssss
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Smith committed Sep 10, 2016
1 parent c86b5a9 commit b09689b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
Binary file removed docs/src/man/.manual.md.swp
Binary file not shown.
37 changes: 29 additions & 8 deletions docs/src/man/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ maxima>

# Maxima Expressions

Maxima.jl revolves around the Maxima expression type: `MExpr`. Maxima expressions can be constructed using a constructor or a string macro.
Maxima.jl revolves around the Maxima expression type: `MExpr`. Maxima expressions can be constructed using a constructor or a string macro and evaluated with `mcall`.

```@repl
using Maxima # hide
MExpr("sin(x)/x")
m"integrate(1 + x^2, x)"
mcall(ans)
```

Maxima expressions don't neccessarily need to be valid Maxima, but a warning will be printed when the expression is printed and an error will be thrown if the expression is evaluated.
Expand All @@ -52,19 +53,39 @@ m"1/0"
mcall(ans)
```

Maxima expressions can be evaluated using `mcall`.
Maxima.jl also allows for translation between Maxima and Julia expressions.

```julia
julia> g = m"atan(%i*%pi*y)"

%i atanh(%pi y)

julia> parse(g)
:(im * atanh(y * π))

julia> exp = :(sin*im))
:(sin* im))

julia> mexp = MExpr(exp)

%i sinh(%pi)

```@repl
using Maxima # hide
m"integrate(1/(1+x^2), x)"
mcall(ans)
mcall(m"1+")
```

#
# Basic Library

Maxima.jl wraps many of the basic Maxima functions for convenience and these functions may be applied to Maxima expressions, Julia expressions or basic strings. By convention, the return type of these functions is determined by the most important input type. For instance, the `integrate` function returns the type of the integrand.

```julia
julia> integrate("sin(x)", :x)
"-cos(x)"

julia> integrate(:(sin(x)), "x")
:(-cos(x))

julia> integrate(m"sin(x)", 'x')

- cos(x)

```
As you can see, the basic library functions are very flexible about their argument types. Basically, as long as the argument string interpolates to the thing you want then it will work. For a list of all the functions that are wrapped take a look through the library reference section of the documentation.

0 comments on commit b09689b

Please sign in to comment.