Equation solving interface

Written by

in

In moment of clarity I realised today that many of the things that I want to create as GUI applications can be generalised to a single application: An equation solving interface. I have played around with various equation solving environments like EES and PolyMath, also math environments like Mathcad but none of them work like the thing I am starting to see in my head.

The idea is like this: You set up a set of variables and constraints, which may be equalities or inequalities. You give the variables names and dimensions (length, time, etc). So far so normal. Traditionally you would now start to specify your problem, perhaps with the tool checking when there were enough specifications to solve the problem. In my vision, you get an interface consisting of entry boxes for each of the variables. You can enter values in any box, and as more information becomes available, the other boxes are filled. Some colour coding helps you to see which values you filled in recently and which ones have just been calculated. Hovering over a variable highlights the values that are linked to it, perhaps with an overall and direct distinction, perhaps with a drillable menu.
So the first mode of operation allows you to start typing the information you have and the unknowns are calculated as they can be. Now you can play with the values, and select which calculated values should stay the same and which should be recalculated (perhaps using that drill-down menu). You can select some variables to be “Fixed”. You can elect to change some of the text boxes to sliders, which allows you to “play” with the solution. You can change some of the boxes to ranges, which will use interval arithmetic to calculate ranges on the other variables. You can change some of the variables to Min or Max, if you select more than one you get multiobjective optimisation. From the same interface, you can see visualisations of the current position in the design space and the constraints that you have placed via the equation setup and via the ranges you have imposed on the other variables. When you find a nice combo, you save it and it gets added to a list of tagged points in the plot views.
Other nice things you can do: automatic nondimensionalisation, perhaps with plotting of variables and implied boundraries (that’s why you specify dimensions on the variables instead of units).
This generalises problems like doing brewing calculations, designing equipment and many of the things people use spreadsheets for.
A final note about why spreadsheets and programming languages aren’t right for this job. It all has to do with the directionality of equations. Equations go both ways. In fact, a set of equations is like a graph connecting all the variables in it. On spreadsheets and in most programming languages, equations are one-way — a cell can contain a value or a formula, not both. In some constraint programming languages, it’s easier to be declarative, but most of them enforce complete specification and don’t even try to calculate values if the whole problem hasn’t been correctly specified. They also don’t provide direct interaction that allows one to play with the solution.
Perhaps I’m missing something, but I haven’t found anything like I’ve just described. I really want something like this, so perhaps this should the project that I finally break my GUI programming block on. If you have any information or comments, please pipe up!

Comments

  1. the SA Critic Avatar

    Indeed, I don't think it exists, or if it does, I haven't seen it. Not that I solve typical engineering problems, but I do a lot of financial modeling.

    Spreadsheets are my easy-to-use tool, but I have to think carefully how I construct them primarily because of this one-way effect that you describe.

    Sometimes I type values over my formulas to play with solutions, and just undo (CTRL+Z), or save-as… Its crude.

    Or I model the problem from a few different perspectives, and punch in the results obtained from one approach manually into another sheet…. have a few sheets.

    The speed and low learning curve makes the humble spreadsheet quite workable for me despite its deficiencies.

    I use the conditional cell colouring a lot too.

    I can see the benefits of such a tool as you propose.

  2. Carl Sandrock Avatar

    The normal way of solving in the opposite direction in Excel would be Goal Seek or Solver, but that only gets you so far, and is annoyingly different from entering a value in a cell. Also, imagine sliders on all those values, letting you play any which way. I think I'm on to something.

  3. Unknown Avatar

    Mathcad may be close to what you are looking for. See http://wp.me/pxmcv-P

  4. Carl Sandrock Avatar

    Hey Will: If you know something I don't about Mathematica's abilities, please share. As near as I can tell, there is way to do the stuff I describe (automatically determining which variables can be solved for from a set of equations, allowing manipulation both ways) short of actually writing a program. Note that the problem is not really solving the equations — I have plenty of tools that can do that — rather providing an equation solving environment.

  5. Carl Sandrock Avatar

    Will: I suppose you were talking about the Manipulate function, which does indeed supply the interactivity. Seems interesting. It appears that the Sage function Interact is a re-implementation of the concept. I'm still trying to figure out where I stand on this. The thing that differentiates this idea from what I've seen before is primarily the directionality thing — the fact that there aren't "inputs" and "outputs" like you have to specify in Manipulate or Interact.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.