-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.txt
42 lines (19 loc) · 6.38 KB
/
update.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Overall update: There is a short summary here and we elaborate individually below. Compile instructions are seperate for each part.
the gist: We have most of the basic functionality up except for calculus and plotting. The interface and the calculus part need the most development. The linear algebra part ahd parsing part are pretty okay (even though we had to pretty much write libraries in the process). We think that we should be able to accomplish most of what we set out to do although as detailed below we may scale back some of the calculus parts or some graphics stuff (plotting). We hope to avoid this. Otherwise, we have decided to add Tex expression rendering (because who wants to render a matrix with elm as opposed to bmatrix?) if we can and possibly some minor number information thing. We elaborate on everything below
Separate Updates:
Bowen's part: Expression.elm OurParser.elm ExpParser.elm Eval.elm Interface.elm port.js index.html
compile: run make in the directory. Then view the interface by opening index.html. In the interface (which is terribly ugly), there are two boxes. The upper one is the one for input and you can type in some simple expressions like 2+3*4, and after clicking on the "see Result" button, the result of the evaluation will be shown in the lower box. Notice that we are trying (unsuccessfully) to render the output in LaTex. Therefore the result shown now is surrounded by "$$".
We currently have all the simple expressions working (including matrix). The Expression module exposes all the types we use for the project including the main Exp type that is used as the internal representation of the input expression from the user.
Since the elm parser library doesn't have that many useful functions (it doesn't even have the left-biased combinator!), I decide to just grab the source file and directly modify it to add more useful functions needed in parsing the expression (for example, chainl1 and chainr1 are extremely useful). Then I write the ExpParser module to parse the input string into the Exp type.
Then the Eval module is a evaluator of that simplifies the Exp type as much as possible. Currently the evaluator is only partly functioning as we only have the basic arithmetic operations working. A main issue here is that when evaluating matrix, the matrix has type Matrix Exp, which makes it somewhat annoying to write the function that evaulates it since we have to deal with the inner Exp stuff. Hence currently we don't have matrix evaluation working.
The Interface is supposed to be a wolframalpha like interface where the user can type in expressions and see the results of the evaluation. The way we achieve this is that when the user click on the "see Result" button, we send a signal to the javascript port to retrieve the text from the input div and then parse and evaluate the input to generate the output. Currently the interface is very ugly and unfriendly, but I hope to make it better as we progress. Also, we are trying to embed latex into html so that the output is rendered in latex output (which is nice). However, there are some problems with dynamically generating tex code so that currently we don't quite have that working. Hopefully that will be solved soon...
Teo's part: Linear.elm/Native(CostlyLinear)/Complex.elm/Expresion.elm (part of it)
Compile: Install all the packages in elm-packages.json. Load in the file you want to try in the repl to play around with it.
What I will address: Progress on Linear Algebra, thoughts on the calculus library.
So, on the face of everything, we have most of the linear algebra functionality that we promised. If you look at the HASTILY WRITTEN DOCUMENTATION for linear.elm, you will find that we have (in almost full generality) functions for just about everything that we specifically mentioned. The only thing that is obviously missing is diagnolization and conditional number, but now that I have eigenvalues working, neither of these will be hard. If you look at a sample matrix put through wolframalpha:
http://www.wolframalpha.com/input/?i=%7B%7B1,2,5%7D,%7B3,5,-1%7D,%7B7,-3,5%7D%7D
you will find that we have the capability of generating almost everything so I think we have sort of delivered on this.
I will also note that to do eigen values we used native code. During this, I ended up simply useful code from JMmath (a javascript lib) and putting it in since import does not work. Since the FFI doesn't automatically convert elm types, I went into the native elm core and grab the relevant functions.
Now, there are a number of problems with the library that I need to fix. First, the docs should be better (e.g. spell matrix correctly...). Second, there are a lot of small/easy to implement functions that don't make this incomplete, but would be nice. Third, literally everything is unsafe/doesn't check invariants; we need to fix this (not to say that it doesn't work, but doing anything out of bounds will lead to a crash...). On a similar note, we need to consider another wrapper so that the vector/matrix type actually hide their array heritage. Fourth, there are also a few functions that could be improved (e.g. the determiant is horribly inefficiently). Lastly, we need to find a testing suite and make sure that everything works (there are probably a few bugs.). All of this withstanding, I still think we have something approaching a linear algebra library that can do almost our wolframalpha would need it to do.
With regard to the current standing of the project, I think we will deliver on the Linear Algebra part as stated. We have not started on the calculus part, but I think we will be able to deliver on symbolic diffrentation at a min and probably also on numeric integration and easy plottings. The graphics situation for the plotting might be more complicated than we thought, but besides that I don't have many concerns. Bowen will discuss the interface/graphics in greater detail. The expression/manipulations are done in terms of some basic things and we have a basic interface (Again, see Bowen's part).
With regard to any expansions, I might take the time to write something that looks up information about numbers in some online data base and see if I can do anything with it. (E.g. see what happens when you enter '3' in wolframalpha). This is more on a desire to understand related features and I've not talked to Bowen about this yet and I'm not sure it would integrate well with the graphics part. We will see... (I will probably not do it...)