Results 1 to 14 of 14

Thread: Simplify Algebraic Expression

  1. #1

    Thread Starter
    Hyperactive Member DavesChillaxin's Avatar
    Join Date
    Mar 2011
    Location
    WNY
    Posts
    451

    Simplify Algebraic Expression

    Here is my first ever attempt at creating anything solely math related.

    So having said, there are known bugs. Simply put, it cannot handle large numbers. But soon I hope to find the time where I can implement a solution to solve this issue.


    Updates:
    November 10th - Initial support* for the basics. IE (), *, /, +, -, and ^.
    November 11th - Square Roots (√) is now supported). Format: √(x)
    November 12th - Summation (∑) is now supported*. Format: ∑(expression,index,lower,upper)
    November 13th - Complete reconstruction of my operations that fixed a few bugs.
    November 17th -Factorials (!) is now supported* and all doubles have now been replaced with decimals. Plus some more bugs fixed.
    February 10th 2013 - Negative (-) signs were not being recognized as numeric values.

    *AT THE MOMENT I REALIZE AN ON GOING ISSUE. When converting to string from a double, if the number is large/small enough I'll receive my converted string in scientific notation. Which cannot be converted back into a double. I'm working hard at the moment to fix this, but if anyone has any suggestions please do tell. In the mean time, avoid using any fractions which can produce irrational numbers. Those seem to be the killers. However once supported, the Pi and e Symbols will be added to the support list.

    *DO NOT USE SQUARE BRACKETS ([, ])IN YOUR EQUATIONS. When an equation such as, (-1)^n is simplified. It becomes [-1]^n for evaluation purposes. My guess would be that if you used any, then that would cause an exception.
    Attached Images Attached Images  
    Attached Files Attached Files
    Last edited by DavesChillaxin; Feb 10th, 2013 at 04:13 PM.

  2. #2

    Thread Starter
    Hyperactive Member DavesChillaxin's Avatar
    Join Date
    Mar 2011
    Location
    WNY
    Posts
    451

    Re: Simplify Algebraic Expression

    ^ Full Project ^
    Last edited by DavesChillaxin; Nov 13th, 2011 at 11:50 AM. Reason: Uploading the actual project rather than chunks of code.

  3. #3
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,388

    Re: Simplify Algebraic Expression

    Sounds like a good idea ... but can you make the project compatible with vs2008? ; has a few errors (could prob fix them but don't have the time 2 look atm)....

    Kris

  4. #4

    Thread Starter
    Hyperactive Member DavesChillaxin's Avatar
    Join Date
    Mar 2011
    Location
    WNY
    Posts
    451

    Re: Simplify Algebraic Expression

    In the near future I will, but my first priority is to fix all the bugs, also most important the issue of accuracy. I'm in the middle of attempting a transition to BigInteger which will hopefully eliminate this issue. I'll be uploading an update to this tonight however, which now can support ! - factorials.


    Edit:
    Quote Originally Posted by i00 View Post
    has a few errors (could prob fix them but don't have the time 2 look atm)....
    Could you possibly give me a few pointers to the errors? I know there were some obvious ones such as 6^10. I was building the exponent backwards which gave me 01. That had been noted and fixed last night at school. Also I change all doubles to decimals until I can figure how to approach the transition to BigIntegers. Doing decimals gave me a little more play with accuracy, but still not completely. Going to far will give you overflows.
    Last edited by DavesChillaxin; Nov 17th, 2011 at 06:52 PM.
    Please rate if my post was helpful!
    Per favore e grazie!




    Code Bank:
    Advanced Algebra Class *Update | True Gradient Label Control *Dev | A Smarter TextBox *Update | Register Global HotKey *Update
    Media Library Beta *Dev | Mouse Tracker (Available in VB.net and C#.net) *New | On-Screen Numpad (VB.net) *New

  5. #5
    Addicted Member Joshlad's Avatar
    Join Date
    May 2011
    Location
    England
    Posts
    160

    Re: Simplify Algebraic Expression

    I'd recommend #Regions to split it up a bit, increase searching etc. but some very cool calculations!
    Quote Originally Posted by Shaggy Hiker View Post
    EDIT: Wow, I think I need to refresh my browser faster. You had it solved before I even started writing.
    May not be able to provide code, but i sure can provide the logic
    AutoTyper Moves Mouse Cursor to Screen Position
    All my Projects contain flashy scrolling text

  6. #6

    Thread Starter
    Hyperactive Member DavesChillaxin's Avatar
    Join Date
    Mar 2011
    Location
    WNY
    Posts
    451

    Re: Simplify Algebraic Expression

    Sorry for anyone who's seen no updates for this. I've been really busy with my main project at the moment Ive had no time for any of my other side projects... however soon I will require this math class of mine in my main project. So soon I'll be back on this with hopes of finding a way of dealing with irrational numbers and such.
    Please rate if my post was helpful!
    Per favore e grazie!




    Code Bank:
    Advanced Algebra Class *Update | True Gradient Label Control *Dev | A Smarter TextBox *Update | Register Global HotKey *Update
    Media Library Beta *Dev | Mouse Tracker (Available in VB.net and C#.net) *New | On-Screen Numpad (VB.net) *New

  7. #7
    Junior Member
    Join Date
    Jan 2012
    Posts
    27

    Re: Simplify Algebraic Expression

    good idea !! nice job


    downloading ...

  8. #8

    Thread Starter
    Hyperactive Member DavesChillaxin's Avatar
    Join Date
    Mar 2011
    Location
    WNY
    Posts
    451

    Re: Simplify Algebraic Expression

    Quote Originally Posted by Jack Tomy View Post
    good idea !! nice job


    downloading ...
    Let me know what ya thing!

    Also the biggest bug is numbers too large to handle... I stopped working on this for a bit, but I was in the middle of fixing this(which is a ton of work.. much more than I had hoped for) But I'm hoping to jump back into this soon and fix all bugs Also, I've learned a lot since I wrote this so a lot can probably be changed and modified to perform better, faster and stronger.
    Please rate if my post was helpful!
    Per favore e grazie!




    Code Bank:
    Advanced Algebra Class *Update | True Gradient Label Control *Dev | A Smarter TextBox *Update | Register Global HotKey *Update
    Media Library Beta *Dev | Mouse Tracker (Available in VB.net and C#.net) *New | On-Screen Numpad (VB.net) *New

  9. #9
    Member
    Join Date
    Dec 2012
    Location
    việt nam (vietnam)
    Posts
    37

    Re: Simplify Algebraic Expression

    Hey, I found wrong results when simplifying 2x when x running from -10 to 10 : All the x values from -10 to -1 are wrong. Can you fix this?

  10. #10

    Thread Starter
    Hyperactive Member DavesChillaxin's Avatar
    Join Date
    Mar 2011
    Location
    WNY
    Posts
    451

    Re: Simplify Algebraic Expression

    Quote Originally Posted by PAPYRON View Post
    Hey, I found wrong results when simplifying 2x when x running from -10 to 10 : All the x values from -10 to -1 are wrong. Can you fix this?
    Wow, nice catch on that. I'll take a look at it after work today, but unfortunately I'm going to remake this project from scratch. I'll fix this error for now, but expect in the near future a much more powerful and efficient version of this.
    Please rate if my post was helpful!
    Per favore e grazie!




    Code Bank:
    Advanced Algebra Class *Update | True Gradient Label Control *Dev | A Smarter TextBox *Update | Register Global HotKey *Update
    Media Library Beta *Dev | Mouse Tracker (Available in VB.net and C#.net) *New | On-Screen Numpad (VB.net) *New

  11. #11
    Member
    Join Date
    Dec 2012
    Location
    việt nam (vietnam)
    Posts
    37

    Re: Simplify Algebraic Expression

    Thank you. This stuff will be better if you can fix it. I'm running it in VS 2005 after compiling it to a .net 2.0 dll with VS 2010.

  12. #12

    Thread Starter
    Hyperactive Member DavesChillaxin's Avatar
    Join Date
    Mar 2011
    Location
    WNY
    Posts
    451

    Re: Simplify Algebraic Expression

    Hey PAPYRON,

    Just figure it out. It was rather simple, and kind of surprised this slipped past me.

    The issue was within this function...
    vbnet Code:
    1. ''' <summary>
    2. ''' Determines if a character value is numeric.
    3. ''' </summary>
    4. ''' <param name="character">Character; Value in question to be checked.</param>
    5. ''' <returns>Boolean; True if the character value is numeric, otherwise false.</returns>
    6. Protected Function IsNumeric(ByVal character As Char) As Boolean
    7.     If Char.IsNumber(character) Or character = "."c Or character = "-"c Then ' Now includes the negative (-) sign.
    8.         Return True
    9.      End If
    10.      Return False
    11. End Function

    The negative (-) sign was not being recognized as numeric. Therefore, I added to the condition to include the negative (-) sign.
    Attached Files Attached Files
    Last edited by DavesChillaxin; Feb 10th, 2013 at 02:37 AM.
    Please rate if my post was helpful!
    Per favore e grazie!




    Code Bank:
    Advanced Algebra Class *Update | True Gradient Label Control *Dev | A Smarter TextBox *Update | Register Global HotKey *Update
    Media Library Beta *Dev | Mouse Tracker (Available in VB.net and C#.net) *New | On-Screen Numpad (VB.net) *New

  13. #13
    Member
    Join Date
    Dec 2012
    Location
    việt nam (vietnam)
    Posts
    37

    Re: Simplify Algebraic Expression

    Thank you, my project now can continue now.

  14. #14
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,123

    Re: Simplify Algebraic Expression

    Hi Daves, can your project solve an equation like this?

    (2x2)(3x + 2)
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width