469,581 Members | 2,009 Online

# Mathematical Programming

Hi there, I have a problem in writing a mathematical function using C++
programming. How to write an input that can insert whole equation?
Example is the input are x² + 3y - 4z³ = 0. In maple, it was
x^2+3*y-4*z^3 = 0, but how to write it in C++ ? How about the
declaration?

Jul 23 '05 #1
3 2814 "gelong" <ge******@yahoo.com> wrote in message
Hi there, I have a problem in writing a mathematical function using C++
programming. How to write an input that can insert whole equation?
Example is the input are x² + 3y - 4z³ = 0. In maple, it was
x^2+3*y-4*z^3 = 0, but how to write it in C++ ? How about the
declaration?

It's somewhat hard (at least for me) to understand what you're asking:

If your question is how to use C++ mathematical operators, then you can use
+,-,*,/ as usual, e.g., x + y, and for ^ you can use the function pow.

But when you write x² + 3y - 4z³ = 0, then you're writing a mathematical
equation - a concept which C++ doesn't directly "understand". The question
is what do you want to do with "x² + 3y - 4z³ = 0"? Do you want plot it?
search numerically for minimum and maximum? solve it symbolically (say for
x)? Based on your answer, you need to find an appropriate library.

So it might help if you clarify further. For example, you might repost and
say "I'm looking for a library that can plot 3D mathematical functions", or
something like that.
Jul 23 '05 #2
Fri, 28 Jan 2005 20:21:38 -0800|gelong :
Hi there, I have a problem in writing a mathematical function using C++
programming. How to write an input that can insert whole equation? Example
is the input are xÂ² + 3y - 4zÂ³ = 0. In maple, it was x^2+3*y-4*z^3 = 0,
but how to write it in C++ ? How about the declaration?

Hi , maybe somthin like that :
-/+ * multi * ( X * n ) ^ pow as elements of array
struct Node {
int multi; // if not exist =1
int n; // ... 1
int pow; // 1
int sign; // 1 or -1
} ;
Node abc;
/*
abc : */
multi=1;n=1;pow=3;sign=1; /* will be 1 * 1 * ( X * 1 ) ^ 3 etc.. */
sry4engl

Jul 23 '05 #3
gelong wrote:
Hi there, I have a problem in writing a mathematical function using C++
programming. How to write an input that can insert whole equation?
Example is the input are x² + 3y - 4z³ = 0. In maple, it was
x^2+3*y-4*z^3 = 0, but how to write it in C++ ? How about the
declaration?

You will have to accept the input as text, parse it and make the
necessary calculations and output.

--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #4

### This discussion thread is closed

Replies have been disabled for this discussion.

### Similar topics

 6 posts views Thread by administrata | last post: by 1 post views Thread by Jerry chapman | last post: by reply views Thread by Juan R. | last post: by 4 posts views Thread by Xah Lee | last post: by 2 posts views Thread by rameshadari | last post: by 4 posts views Thread by Talbot Katz | last post: by 3 posts views Thread by gelong83 | last post: by 13 posts views Thread by jacek.strzelczyk | last post: by 2 posts views Thread by Madmartigan | last post: by reply views Thread by Trystan | last post: by reply views Thread by Marketing QM | last post: by reply views Thread by devgraph | last post: by 1 post views Thread by strativab | last post: by reply views Thread by PitrL | last post: by reply views Thread by allessa | last post: by 1 post views Thread by tbutler | last post: by 1 post views Thread by Samuh | last post: by 4 posts views Thread by guiromero | last post: by