This is very similar to the problem I'm stuck on:

*1) Problem:*
-I have two functions defined by linear inequalities
-I would like to add these functions
-*they are piecewise*
*
*
My case is signal processing. Like you, these inequalities
-define bounded regions equally expressible as simple geometric envelopes 
and
-I would like to integrate over them as well.

but that requires adding them first.

Piecewise is missing ordinary manipulation methods. I could compute a 
Fourier series approximation of two triangles, and add 
those approximations. (And so could you)  But I cannot add them directly. 
 Hilarious. 

*2) General considerations*
(echoing your comments.  Let me know if we disagree, or if this does not 
relate to your problem.)
The functions are simple enough to be computed by hand. I have a large 
number of them.
Yes,  can write my own program to sum and integrate them in SAGE. I can 
also open notepad.exe and do it in C++.  I would like to use SAGE *instead,* 
not 
*as a programming environment* in which to do them.  The tasks are too 
simple to merit the overhead of interfacing SAGE.  If I have to hand-define 
integration for regions enclosed by lines, in space, I'll do it in GL or 
DirectX where I can then immediately leverage geometric generalization, 
topological reordering and display, 3D navigation/vector methods.

*3)  Offer*
*I'd love to help revamp the Piecewise class,* but I'm new enough to 
programming that I'll need a buddy.

Suppose that happened.  
*4) *Would such a project assist you, Mr. Irving?
Say, if we proposed reworking Piecewise. Goal: provide a flexible container 
for accessing continuous computation over regions defined by a finite 
number of continuous boundaries?

Your example of trapping the region of interest in a polyhedron is 
charming.  I'm a bit bewildered this is not possible at present.  You 
describe the most fundamental definition of an integral.  We've had this 
one for 2500 years.  Which leads me to...

*5)Plea*
Personally, the last thing I want is for the SAGE developers to believe 
that the way to make a coherent environment is to extend further and 
acquire more packages.  SAGE is an OCD madhouse of methods.  To have a 
coherent environment, SAGE needs a coherent environment.  Right now, I 
could *use* SAGE (python) to write such an application.  SAGE is supposed 
to *be* that application. I want reliable generalizations  that allow me to 
draw from the methods already present.  I want to define and manipulate 
arbitrary mathematical problems without knowing the syntax of the python 
library after calling it by hand.
I know development takes time.  But another package simply will not solve 
the problem. Suppose we then want to *visualize* our data structures.  Or *add 
points and lines to them, directly*.  *Define boundaries to assist 
integration, by drawing them?*
I do this every day in a CAD environment.  The tools to define connection 
graphs for manifolds in a natural way have *nothing* to do with syntax. 
 They are *topological* tools, for topological problems.  It would be an 
extraordinary thing to have such tools as a mathematician as well.

Let me advance the following position:  We could *decide* that adding new 
packages is by default NOT the answer to any problem involving elementary 
mathematics that SAGE can already handle.  Where, and when it proves too 
difficult to build a solution into the existing methods and libraries, *then 
*seek to acquire new ones.

{as usual, please know if these questions or comments do not properly 
relate.  And feel free to contact me directly if they do} 

On Saturday, June 16, 2012 6:54:15 AM UTC-7, Alastair Irving wrote:
>
> Hi 
>          
> I want to numerically evaluate the integral of a function f(x,y) over a 
> region defined by linear inequalities, for example 
> 1/8<=y<=x<=1/3 
> x+y<=1/3. 
> I can do this with a repeated call to numerical_integral because I can 
> re-write the constraints as y<=min(x,1/3-x).  However, this solution 
> isn't very satisfying in general.  If I have more constraints and/or 
> more variables then working out the limits on the repeated integrals by 
> hand is going to be rather unpleasant. 
>
> Is there any way I can get sage to compute the integral directly from 
> the inequalities.  For example, if I use a Polyhedron object to store 
> the region of interest is there any way of getting functions from it 
> which describe the limits of integration?  Ideally, if P is a Polyhedron 
> it would be nice to have something like P.integral(f) which computes the 
> integral of f over P. 
>
> Many thanks 
>
> Alastair Irving 
>
>

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to