Post Reply 
25-MAR-2017 SolveSys - Equation Library and Nonlinear Systems Solver
02-05-2017, 10:51 PM (This post was last modified: 03-26-2017 03:27 AM by Han.)
Post: #1
25-MAR-2017 SolveSys - Equation Library and Nonlinear Systems Solver
25-MARCH-2017 (Ver. 1.000)
CHANGELOG
  • Major updates to reference manual
  • Added support for animated diagrams (see Oscillations > Mass-Spring System)
  • Library file format modified slightly (see ref. manual)
  • Minor fix in library file for Conduction+Convection system (L1-L3 changed to l1-l3)
  • Added option to revert to Solve app engine if anyone needs it
  • Fixed deletion bug when library has more than 70 systems
  • Systems may now be saved with diagram information
  • Preliminary support for switching libraries (i.e. future update will allow users to have multiple libraries rather than saving everything into a single library)
  • Information during solve process much more informative
  • New icon (top half of old HP Solve application card)

Download link at bottom of post; same link but zip file has been updated.

NOTE: I am putting any further development (i.e. no new features) until summer; until then, any new update will only address bugs in the current version. Sorry, but I need to direct my focus on other things. Of course, I will still keep up with requests and relevant posts to this thread.

ABOUT THE APP

[Image: attachment.php?aid=4562] [Image: attachment.php?aid=4564] [Image: attachment.php?aid=4563]

This app is intended to replicate and combine programs from the HP48 series of calculators for organizing equations and launching an equation solver. While there are a few user-created programs/apps that help manage equations, most of them have the formulas built-in (hard-coded into the source code of the program/app). This app attempts to allow users to build their own equations library. The user can then also launch a numerical solver. Using the built-in Solve app may be adequate for some users, but it lacks the ability to handle more general systems.

The current Solve app is quite deficient in that in requires the number of equations in a system be the same as the number of variables. Therefore, over-determined or under-determined systems cannot be solved numerically. Usually under-determine systems have an infinite number of results, and a numerical solver should ideally try to return a solution that is as close to the initial guess as possible. For over-determined systems, a solution usually does not exist. Most numerical solvers would return a "least-squares" solution.

This app implements the Newton-Raphson algorithm for solving a system of equations. In order to handle ill-conditioned, over-determined, under-determined, rank-deficient (etc.) Jacobian matrices, the SVD is used to determine the pseudo-inverse of the Jacobian (the pseudo-inverse coincides with the regular inverse of a matrix for non-singular matrices). Users have reported that the app can handle complex values just fine. Minimal testing seems to confirm this.

INSTALLATION AND USAGE

(Please refer to the reference manual included in the zip file)

REFERENCE MANUAL

The reference manual will likely see another update in which all the images are updated to nicer, crisp images created by \( \LaTeX\ \) and ps-tricks. For now, though, I will leave them there so that there is at least some frame of reference, and for old time's sake. The equations will also likely get a face lift as the variables are updated to follow typical mathematical conventions (e.g. subscripts). While the HP Prime currently does not support subscripted variables, the correspondence between the calculator's variables and those in the reference manual should be obvious (e.g. \( v_0 \) vs. \( \tt{v0} \) ).

If you notice any typos, please let me know.

OTHER NOTES:

There are two versions: a merged version (SVD merged into the source code for Equation Library) and the separated version. Does it make a difference which version I use? Yes, if you plan to work with under/over determined systems or systems whose Jacobian is either singular or near singular, it can make a major difference.

PRIOR CHANGES:
(08-MAR-2017 v0.900)
  • Added pictures; press [View] > View Picture
  • Currently supports picture viewing; cannot save systems with a picture yet
  • Fixed some typos in the reference manual
  • This update modifies the Equation Library.lib file to add a 9th (picture data)


TODO
  • Add a command to allow solving without using the app interface: ssSolve({ equations }, { vars }, { initial guesses })
  • Add options to use other inverse techniques (e.g. QR, LU, or regular \( A^{-1} \)) to improve upon the solving speed
  • Curve fitting like in SolveSys from the HP48/HP49/HP50 days
  • Move all strings into a single list for localization.
  • Implement numerical approximation of the Jacobian (right now, it is computed using the CAS which could potentially cause issues.
  • Units

The current firmware seems to exhibit issues with CAS programs. If you should find the app not working suddenly, type restart; at the command line (NOTE: this will delete all CAS results) and "recompile" the app and/or the SVD program (simply open and close their files in the program editor). Turn the calculator off and then on to save the memory state.

DOWNLOADS

Version 1.000 (same file name, just re-download to get the update)

.zip  Equation Library Prime.zip (Size: 540.99 KB / Downloads: 907)





Attached File(s) Thumbnail(s)
           

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
25-MAR-2017 SolveSys - Equation Library and Nonlinear Systems Solver - Han - 02-05-2017 10:51 PM



User(s) browsing this thread: 1 Guest(s)