View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Symbolic Manipulation

To me, symbolic manipulation is simply the ability to manipulate mathematical expressions symbolically, rather than hard coded into the source code. Kindof like the Nick Black homework 6 from last semester in 2330 that involved symbolic differentiation. There probably is a better definition, but I'm too lazy to look it up.


The most current (and last one this semester): Sixth Expression changeset. Now with 4d graphing.

NOTE: save your image before trying this!

Since calculating and drawing a 3d wireframe, many times a second, in SQUEAK is pretty much impossible given the speed of today's computers, I have to prerender each of the images on a form.

Rendering may take a while, depending on the speed of your computer. Start it and go do something else.

Then after rendering all the 3d wireframes onto a collection of forms, it goes into an infinite loop (displaying the forms in order) that waits for a mouse button. It sometimes exits the loop when you hold down a mousebutton, but not always.

Just "do" XYZWGraph example and you'll see what I mean.

XYZWGraph example2 does something more interesting.

and XYZWGraph example3 takes about 10 minutes to render on my computer. It looks like Squeak locked up, but just let it sit there for a while... it'll eventually finish, if it doesn't run out of virtual memory first. I gave it 64 MB, and it was fine.

No sample image because I don't have an animated gif editor.




The Expression changeset 1 (old, see below for most current changeset) creates all the Expression classes, and adds a method to String called asExpression.

Expression changeset 2 (old, see below for most current changeset) with several bug fixes, and additions. I think partial derivatives now work. Anyone wish to confirm this for me?

And now the 4th Expression changeset... (old, see below for most current changeset) I can't waste any more time on this, since finals are approaching, so here's some code hacked together to show what can be done with expressions.
After filing in changeset four, just type "XYZGraph example" into a workspace, and this should come up.



The 5th Expression changeset... (now old too) with major a speed improvement.
Same as before, file it in and "do" XYZGraph example



The most current: Sixth Expression changeset.





Read the Expression class comment for a more detailed explanation on how to use, or add new operations.

'x^7' asExpression derivative printString
will give you the string '(7*(x^6))'

Expressions can be added, multiplied, raiseTo:.... trig.... etc... just like numbers, except everything is done symbolically. It automatically reduces constant expressions (1+2*3/4-5 would become -2.75), and attempts to simplify expressions such as
'0*something' becomes '0'
'1*something' becomes 'something'
'0+something' becomes 'something'
'0/something' becomes '0'
etc...


I am not finished with everything I hope to do with this, but I have reached a stable point with some standard operations working.


The reason I wrote something like this is to be able to promt a user for an equation, say of two or maybe three variables, and then graph it on the screen... like this:
External Image


I have a longer explanation on my webpage.

Jared Ivey

http://www.prism.gatech.edu/~gte466i/

External Image

Links to this Page