?
Solved

Calculating Complex Equations...

Posted on 2003-11-07
3
Medium Priority
?
428 Views
Last Modified: 2010-04-16
Hi,

I am developing a mathematical application that involves the storage and process of equations of cubic and quartet order. I am storing the data in an MSDE database. The equation is stored in the database in the following format, (all equations are structured this way at the moment);

3.5604e-3*x(3) + 4.5394e-2*x(2) + 2.9238e+1*x(1) + 2223

The x(3) is interperated as x cubed, x(2) x squared.

The UI extracts this equation and has to break it into its atomic parts substituting x with a user input and calculating it accordingly.

Can anyone advise me on a more efficient storage format of the equations and a technique to break the equation into its constituent parts for ease of calculation.

kind regards Imran Farooq
0
Comment
Question by:imran89
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 9703538
1) you can use the SPLIT function to break up each member of the polynomial :

Split(strFormula,"+")

you can then split each part, into the two factors, using the *

Split(Part, "*")

then extract the power of x from the (...) (if the () is present)

actually rather close to a problem I solved a long time ago (1963 - in FORTRAN, after my Freshman year in college, worked as a Summer Intern at what is now UCSD, in La Jolla, Calif)...and no, I do not have the code.

AW
0
 
LVL 1

Accepted Solution

by:
jdauie earned 180 total points
ID: 9708835
You could easily make a class for it that would hold an array of coefficients.  You wouldn't even need to include the variable and the exponent if you have similar equations.
You can then save the object using serialization.
0
 

Author Comment

by:imran89
ID: 9709732
That seems a good idea, how would I hold the coefficients in a class, could you elaborate for me please as this is my first project in c#.

kind regards Imran
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question