Integral equations

Dear Comrades,
I'm trying to solve a system of coupled integral equations. Does anybody know how to use IntSolve? And what's the shared library? Do I have to download IntSolve from somewhere? And is this the best way to spolve integral equations if I did?
Regards,
Andrew

Robert Israel's picture

IntSolve and the share library

The Maple share library was replaced (as of Maple 6) by the
on-line Maple Application Center. However, I can't find
IntSolve there. In any case, I think IntSolve could
handle a single integral equation (of certain types) but
not a system of integral equations.

If you give us an example of the type of system you're
trying to solve, we might have some ideas of how to solve it.

gkokovidis's picture

Share Library and intsolve

A copy of the share library for Maple version 10 and later can be found here.

There exists a command called intsolve in Maple 11 but not in Maple 10. If you have Maple 11, you can get help for the command by typing ?intsolve.

Regards,
Georgios Kokovidis
Dräger Medical

JacquesC's picture

The Share Library

It evokes mixed feelings in me. Certainly it was full of rather useful code. However, when Maplesoft "took it over" to include in the product, we couldn't just include it as-is, we had to make sure that a minimum level of quality and consistency was met by all packages.

And that turned out to be a huge amount of work. I led that effort, and it involved work by a lot of people over several months to get all the help pages cleaned up, all the code to 'work' (it had bit-rotted a lot more than we'd expected). It does seem like Maple users did appreciate the effort though.

The Application Center was an interesting political and technological solution to the maintenance of user-shared code. If the code shipped with Maple, then Maplesoft had to ensure a minimum quality level. But if it was on the App Center, then it was up to the authors of the packages to ensure that they did not bit-rot. [The fact is that a lot of them have bit-rotted, the grand claims to backwards compatibility by Maplesoft notwithstanding.] It was also nice because it was the first foray of Maplesoft into using the web constructively, and it really was a success. It was both useful for users, gave some prestige to some avid Maple fans&developers, and was a useful marketing too. It also meant that this app center could be updated continuously instead of having to wait through release cycles.

In another 5 years, maybe I'll be able to tell the full story of the decline and rebirth of the app center. Hint: a lot of the app center consists of .mws files.

Will's picture

Rebirth of the App Center

I cannot say too much, but the project that I am about to spend a lot of time working on will bring lots of big improvements to the app center.

____
William Spaetzel
MaplePrimes Administrator
Software Developer, Maplesoft

Actually I need help with plot.

Dear Comrades,
Sorry I've been offline for a while. The equations I'm looking at aren't really integral equations in the standard sense. They involve integrals, but the integrals can be done (as opposed to standard integral equations where the mystery function is under one of the integrals).

So, I have two equations involving four quantities; alpha, beta, Omega and delta, and I want to plot the surface of beta as a function of Omega and delta (eliminating alpha leaves one equation in three variables, which defines a surface). Without having to eliminate alpha myself by hand, I want to give maple both equations and have it plot those points which satisfy both equations. My equations are complicated, so I tried a simpler example to get the syntax right. I tried to plot the circle where a cylinder cuts through a sphere. Unfortunately, using plot(eq1, eq2) command it plots both surfaces (cylinder and sphere), not just the intersection. So, do any of you know a way to give maple two equations and have it plot the points which satisfy both equations?

New plots[intersectplot] command

Andrew writes:

I tried to plot the circle where a cylinder cuts through a sphere. Unfortunately, using plot(eq1, eq2) command it plots both surfaces (cylinder and sphere), not just the intersection. So, do any of you know a way to give maple two equations and have it plot the points which satisfy both equations?

Try using the new plots[intersectplot] command, introduced in Maple 11. This can be used to plot the intersection of two surfaces.

Paulina Chin
Maplesoft

Robert Israel's picture

Actually I need help with plot.

intersectplot won't help, though, with two equations in four variables. If the equations involve polynomials, you can
take the resultant with respect to the variable you want to eliminate. For example, consider the equations

> e1:= x^2 + y^2 + z^2 + w^2 - 1 =0 ;
> e2:= x*y^2 + y*z^2 + z*w^2 + w*x^2 = 0; 
> Res := resultant(lhs(e1),lhs(e2),w);
> plots[implicitplot3d](Res,x=-1..1,y=-1..1,z=-1..1,
    grid=[30,30,30],axes=box,style=patchnogrid,
    scaling=constrained);

If they're not polynomial (and can't be recast
in terms of polynomials), it's not so easy.

plotting

I'll try that. Thanks.
It is a shame, though, that one can't tell it to plot all the points which satisfy two equations rather than just one.
Is it possible, for example, to tell it to solve the two equations and find all points which satisfy both equations and spit out a table of numbers for each of the four variables, which could then be plotted as data points? For example, leaving my monster equations aside or a moment and looking to something simpler, suppose I wanted to tell it to give me all the points which satisfy both f1(x,y,z)=x^2+y^2+z^2-1=0 and f2(z)=z=0, and have it give (in this case) all the points in that circle? This doesn't sound like something which should be difficult. I know that in this simple example it's trivial to combine the functions symbolically anyway but that won't work for my real equations.

Drew

Robert Israel's picture

plotting

Actually there is another possibility that might make sense:
build up a sequence of cross-sections using intersectplot.
For example, using the two equations I used before:

> with(plots):
  e1:= x^2 + y^2 + z^2 + w^2 - 1 =0 ;
  e2:= x*y^2 + y*z^2 + z*w^2 + w*x^2 = 0; 
  display([seq(intersectplot(e1,e2,x=-1..1,y=-1..1,z=-1..1,
    colour=COLOR(HUE,(w+1)/2)),w=[seq(0.1*j,j=-10..10)])]);

Another possibility

Dear all,
There's another possibility that might work. One of the variables (delta) can be simply written in terms of the other three. I'd like to be able to give maple the equation g(alpha,beta,Omega)=0 but have it plot on three axes Omega, beta and delta (given by the other equation.
In other words, is it possible to give an implicit finction of three variables, and have it plot two of the variables on two axes and some function of the third variable on the third axis. For the simple sphere case, imagine giving the equation x^2+y^2+z^2-1=0 and asking it to plot not (x,y,z) but rather (x,y,f(z)) where f is some function of z you specify. Does anybody know how to do this?

By the way folks, thanks for your help on this. I appreciate it.
Drew

acer's picture

plots[implicitplot3d]

Isn't that what implicitplot3d() is for?

See ?plots,implicitplot3d

acer

Doug Meade's picture

A third approach

Suppose you want to find the intersection of surfaces f(x,y,z)=L and g(x,y,z)=M. Wouldn't it work to use implicitplot3d to look at the surface defined by (f(x,y,z)-L)^2 + (g(x,y,z)-M)^2 = 0?

To answer my own question, yes - in principle. But, Maple does have some troubles because this definition is too precise. You really want to have all of the points that are "really close" to this intersection. I thought I remember there being a tolerance option in implicitplot(3d) but I can't find mention of this in the online help. In lieu of this, I'll do it manually as follows:

with( plots ):

eq1 := x^2+y^2-z^2=1;
                         2    2    2    
                        x  + y  - z  = 1

eq2 := z=0;
                             z = 0

Z := (lhs(eq1)-rhs(eq1))^2 + (lhs(eq2)-rhs(eq2))^2;
                                      2     
                    / 2    2    2    \     2
                    \x  + y  - z  - 1/  + z 

implicitplot3d( Z=0, x=-2..2, y=-2..2, z=-2..2,
                axes=boxed, grid=[45,45,45] ); # empty plot

implicitplot3d( Z=0.01, x=-2..2, y=-2..2, z=-2..2,
                axes=boxed, grid=[45,45,45] ); # decent plot

The grid option is needed to force Maple to evaluate the function at enough points to get a reasonable picture. This is far from optimal, but with some care can be made to work.

I hope this is helpful,

Doug

---------------------------------------------------------------------
Douglas B. Meade
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu/~meade/

plottools[transform]

Andrew writes:

In other words, is it possible to give an implicit finction of three variables, and have it plot two of the variables on two axes and some function of the third variable on the third axis. For the simple sphere case, imagine giving the equation x^2+y^2+z^2-1=0 and asking it to plot not (x,y,z) but rather (x,y,f(z)) where f is some function of z you specify. Does anybody know how to do this?

You can use plots[implicitplot3d] to generate a plot p of the (x,y,z) values satisfying your equation. Then, use the plottools[transform] command to transform the points to (x,y,f(z)):
plottools[transform]((x,y,z)->[x,y,f(z)])(p)

Paulina Chin
Maplesoft

Error

Hello Paulina,
I've tried your suggestion and it doesn't seem to work. I get the error message "invalid subscript selector" after trying to transform the plot.
My system looks like this:

I have one equation f(alpha,beta,Omega)=0 and I wish to find all the points which satisfy it and then for each point find delta from the know function delta=g(alpha,beta,Omega) and the plots I wish to create are beta(Omega,delta) and alpha(Omega,delta).

I used the commands

p:=implicitplot3d(f(alpha,beta,Omega)=0,alpha=-1..1,beta=-1..1,Omega=-5..5,grid=[15,15,15],axes=box):

and

> deltasolved:=(alpha,beta,Omega)->evalf(solve(G(alpha,beta,Omega,delta)=0,delta));

This last line is just because the equation delta=g(alpha,beta,Omega) is originally written in the form G(alpha,beta,delta,Omega)=0. It should all be on one line.

plottools[transform]((alpha,beta,Omega)->[alpha,deltasolved(alpha,beta,Omega),Omega])(p);

I think I followed your instructions. What am I doing wrong?

Andrew

Re: Error

Andrew, could you send the worksheet to me? It'll be easier to determine the problem if I can see the exact input you're giving to Maple. Thanks.

Paulina Chin
Maplesoft

Robert Israel's picture

Re: Error

As Paulina said, it would be easier if we could see the exact input, but my suspicion is that for some values of the variables your deltasolved(alpha,beta,Omega) returns either no solution or more than one. That would certainly mess up the transform.

I don't understand what you mean about "It should all be on one line", and I don't think it's a good idea to call solve each time you need to transform a point, if you can avoid that. If you know g (explicitly) then use g. If there isn't a closed-form expression for g, you should use fsolve rather than solve. If fsolve doesn't always work [in particular if g is not everywhere defined], you'll want to use a "wrapper" for fsolve that will return undefined when fsolve doesn't return
a numerical result.

Thanks

I've tried to upload the worksheet, but I seem to be having trouble doing that. I'll keep trying and then you'll be able to see it.

As for the "one line" comment, I just meant that the line defining deltasolved is written on one line in my worksheet, but it broke into two when I copied and pasted onto this webpage. I thought this might have caused confusion. I suppose the semicolon tells you where the real end of the line is anyway, so it wasn't necessary to point out.

I think you're both right about this. I'd come to the same conclusion. The explicit form for g giving delta does exist in closed form and I put that in instead of the solve command and it seems to be working now.

Thanks both very much for your help. There are a couple of other questions I have. Firstly, how do I restrict the range of delta plotted? In other words zoom in on a slab with delta between two values (keeping the range for the other variables the same)?
The other thing I'm interested in is the wrapper you mentioned. I'd like to have it put alpha=0 anytime there's no solution from the equations.

I'll get the file up ASAP.

Thanks everybody.
Andrew

refer to previous thread?

It sure seems this exact discussion was addressed on a previous thread

http://www.mapleprimes.com/forum/plotting-surfaces-in-maple-with-constraints

Yes

Hello,
Yes, that's right. This time, though, I wanted to include the (definite) integrals in the equations rather than their numerical values. The reason for this is that later on I'm going to have to solve a similar system which has integrals which are functions of one of the variables and I wanted to develop a general approach. I thought that this made it different enough to warrant a new thread. Sorry for any confusion, and thanks for your help on both.

Andrew

Re: Thanks

Andrew, did you try the instructions for uploading files at this page?

I had trouble replying to your private message. Do you have receipt of private messages enabled in your settings? You can also send a message or worksheet to me via Maple Support. If you include my name, it will get to me.

Paulina Chin
Maplesoft

success

It seems that all is well now.
One last thing, though. I've calculated the values of (alpha,beta,Omega) from one equation using plot. I then used plottransform to change these into (Omega,delta,alpha) in the one case and (Omega,delta,beta) in the other case as you suggested.

plotB=implicitplot3d(f4(alpha,beta,Omega)=0,alpha=0..1,beta=0..1,Omega=0..5,grid=[50,50,50],labels=[alpha,beta,Omega]):

plotBTrans:=transform((alpha,beta,Omega)->[Omega,2*(-beta*Omega/sqrt(2))+Omega/sqrt(2)*(alpha^2+(3*(abs(beta*Omega))^(3/2)*(IntegralA(1,0,infinity))/(4*2^(3/4))))*(1/beta),alpha])(plotB);

plotBTrans1 := (transform(proc (alpha, beta, Omega) options operator, arrow; [Omega, -2*beta*Omega/sqrt(2)+Omega*(alpha^2+(3/8)*abs(beta*Omega)^(3/2)*IntegralA(1, 0, infinity)*2^(1/4))/(sqrt(2)*beta), beta] end proc))(plotB)

This seems to be all working fine, but I wonder if it would be more efficient to take the initial values of (alpha,beta,Omega) and use plottransform only once to get a bigger array of (Omega,delta,alpha,beta) and then tell it to plot, in the one case columns 1,2 & 3 and in the other case columns 1,2 & 4. This means that all the values of delta would only be calculated once rather than twice. Is this possible?

Thanks again, everybody,
Andrew

Robert Israel's picture

More efficient

I don't think plottools[transform] would do this, but you could work directly with the Array in the ISOSURFACE plot structure. Something like this:

> plotB := implicitplot3d(f4(alpha,beta,Omega)=0, ...);
# extract the Array
  A:= op([1,1],indets(plotB,specfunc(anything,ISOSURFACE)));
# get its dimensions
  Adims:= ArrayDims(A);
# delta as function of alpha, beta, Omega 
  fdelta:= (alpha,beta,Omega) -> 2*(-beta*Omega/sqrt(2))+Omega/sqrt(2)*
(alpha^2+(3*(abs(beta*Omega))^(3/2)*(IntegralA(1,0,infinity))
/(4*2^(3/4))))*(1/beta);
# Array of delta values
  Delta:= Array(Adims[1..3],
    (i,j,k) -> fdelta(A[i,j,k,1],A[i,j,k,2],A[i,j,k,3]),
     datatype=float[8],order=C_order);
# new Array with Omega, delta, alpha, f4 values
  A1:= Array(Adims, datatype=float[8],order=C_order);
  A1[Adims[1..3],1]:= A[Adims[1..3],3];
  A1[Adims[1..3],2]:= Delta;
  A1[Adims[1..3],3]:= A[Adims[1..3],1];
  A1[Adims[1..3],4]:= A[Adims[1..3],4];
# plot it
  PLOT3D(ISOSURFACE(A1), AXESSTYLE(BOX), 
    AXESLABELS("W","d","a",FONT(SYMBOL,12)));

Thanks

Thanks everybody. That seems to all be working. I have another problem with a related system, but I think it's different enough to warrent starting a new thread.
Regards,
Drew

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}