Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I am working on a problem involving sums in Maple and I find Maple's facilities lacking.

Specifically; I want to convert the square of a sum into a sum of squares plus the cross terms (which is a subtask of a larger problem). So I start with

sum(E[n],n=1..N)^2;

and immediately get stuck as I do not find any command that does anything with it. The expansion of this is known and easy to derive:

sum(E[n],n=1..N)^2 = sum(E[n]^2,n=1..N) + 2*sum(sum(E[m]*E[n],m=1..n-1),n=1..N);

Maple knows nothing about this relation. I have checked out packages like SumTools but have not found anything useful for this purpose. Quite some time ago I have had difficulty distributing a sum over the elements of its expression; this was answered here and involved a custom function.

Does a package exist that has these kinds of conversions, or do I need to roll my own? It seems a general enough issue that I would expect functions for this to exist.

TIA,

Mac Dude

Hi,

 

  I have the following input in order to obtain the dimension of an array, by means of the values has been assigned

 

with(ArrayTools):
with(LinearAlgebra):
f[1]:=1:
f[2]:=2:
nops(f);
Size(f);
Dimension(f);

 

  The result is 

---

1
[ 1 1 ]
Error, invalid input: LinearAlgebra:-Dimension expects its 1st argument, A, to be of type {Matrix, Vector} or coercible via `~Simplify`, but received f

 ---

 

I cannot get number "2", which is expected. Is there any way to obtain that? I looked for help and mapleprime, without any simple solution ......

 

Thank you very much!

  

Hi,

 

  Suppose I have an array

A[1]:=a;

A[2]:=b;

A[3]:=c;

 

  I would like to check if an element, e.g. "c", belong to this array. I can contrsuct a "for... end do" command to compare each element and/or construct a subroutine. 

 

  Is there any build-in function in maple can do that? Perferably return true/false

 

Thank you!

I want to compute the following solve:

C:=A, B, F, H(It has 4 unknowns):

V:=R,Y,E,I (It has 4 equations):

solve({V},{C});

By hand calculations I just found that the solve result is real ,but in maple there is no solution and no error (the maple ignores to solve this equation !!!) 

can anybody help me to find the solve soltuion ?

Thank you 

H. Kabir

hi.I want to dsolve set of nonlinear equations with one unknown parameter ...is this possible with dsolve rule.in matlab this possible with bvp4c rule..please help me for this problem.if we should another rule please attached file reform.Thanks alot12.mw

I need to solve a set of equations but changing a constant each time.

For example, x+by=0, bx-y=10 where b=10,20.

I don't want to put it in a loop because, in loop, the equations are solved repeatedly. I want Maple to solve it only once and substitute b values automatically since I want to solve big set of equations faster.

Is there any option in Maple to do so with a single command

I know how we can add a member to a mathematical set ,for example :

C := NULL;

C := C, V, B, X;

print(C)

V, B, X

but, my problem is that how we can subtract a member from the defined set ?

 

 

Thanks,

 

hi.how i can chose a minimum and positive answer of different answer in solve rule...

my program attached below.for example at this , the second answer should be selected as 1.965392881*10^9 ,that is the minimum and posetive among other...

thanks alot

11.mw

Dear all,

I am trying to solve the following partial differential equation (transport or advection equation) with given initial and boundary conditions:

restart: with(PDEtools):
sys := [v*diff(u(x,t), x) + diff(u(x,t), t) = 0, u(x,0) = exp(-x), u(0,t) = sin(t)];
pdsolve(sys);

But it does not work. The solution is (or should be): 

u(x, t) = exp(t*v-x)+Heaviside(t-x/v)*(sin(t-x/v)-exp(t*v-x))

I think the reason is that the interval for t (in [0, inf)) and x (in [0, 1]) is not specified. On the other hand, this works:

restart: with(PDEtools):
sys := [diff(u(x, t), t) = diff(u(x, t), x, x), u(0, t) = 0, u(1, t) = 0, u(x,0) = f(x)];
sol := pdsolve(sys);

How can I solve a PDE like the transport equation with given initial AND boundary conditions?

Thanks a lot

I want to display calculation steps by maple like this

k=a+b*c=2+4*4=9

How can I do so that when I enter k:=a+b*c (the value of a,b,c have been assigned) and it can show the substitution process and display the result like this

The font size in the output pane of the standard interface, interactive debugger is really, really small and I can't figure out how to increase it. (Other than drop my screen resolution from its native 2560x1440, which makes it bigger but "fuzzier" - not a huge improvement for tired eyes!!)

I started to notice strange things happening to Maple help pages lately when I google something. I think someone is changing them from inside Maplesoft? Now they look hard to read since I see text below another text and also can't copy it to retype it in my notebook since the syntax is not even valid. Here is a screen shot

http://www.maplesoft.com/support/help/maple/view.aspx?path=FileTools%2fText%2fOpen

 

I thought at first my browser was playing games on me. But I tried it with firefox and Chrome and after refreshing, and the pages still look mangled like the above.

Since I find it hard to believe someone at Maplesoft will make help pages like the above on purpose, where text falls below the line and it not even possible to interpret it when one wants to copy it, since the syntax is not even valid Maple syntax, I would have to imagine there is a bug somewhere inthe help pages generation.  But if so, someone must have seen it before me. I can't be the only person in the world who is googling Maple help.

This is why I am asking.

Is everyone seeing the same thing I am seeing? I am on windows 7, using Latest browsers.

I do not understand why I am getting permission denied trying to create a file.

restart;
fd := FileTools[Text][Open]("C:\\foo.txt", create=true,overwrite=true);

     Error, (in FileTools:-Text:-Open) permission denied

I am running the above on my PC, from Maple, using the same user which is me. I can ofcourse create a file on my C drive outside of Maple. So I do not understand why it says permission denied. Also tried "C:/foo.txt". Also tried

         fd := FileTools[Text][Open]("C:\\foo.txt", create,overwrite);

Any idea what can be the problem? and how to determine why it is giving this error? I am on windows 7, using Maple 2015.

http://www.maplesoft.com/support/help/maple/view.aspx?path=FileTools%2fText%2fOpen

http://www.maplesoft.com/support/help/maple/view.aspx?path=IO_errors

"permission denied" - An attempt was made to read from a file on which the user does not have
read permissions, or write to a file on which the user does not have write permissions."

Well, I do have write permission to make a file on my C drive !

I tried using fopen, and got same error

restart;
  try     
     fd := fopen("C:\\foo.txt",APPEND,TEXT);
  catch:
     print(`Unable to open file, error is`);
     print(StringTools:-FormatMessage(lastexception[2]));
  end try:

                 Unable to open file, error is
                      "permission denied"

So I have no idea why I keep getting permission denied.

 

diff(y(x), x, x)+2*(diff(y(x), x))/x+af(x)*g(y(x))=0

restart

"n:=5:  y[0]:=0:  f(x):=1:  g(y):=e^(-y): L:=x^(-2)(ⅆ)/(ⅆ x) (x^(2)(ⅆ)/(ⅆ x) ):  L^(-1)(y):=(∫)[0]^(x)x^(-2)(∫)[0]^(x)x^(2)dxdx:  "

"for m from 1 to n do:  `&varkappa;`[m]:={[[0,m<=1],[1,m>1]]:   R[m]:=simplifyL^(-1)((d^(2)y[m-1])/(dx^(2))+(2)/(x)(&DifferentialD;y[m-1])/(&DifferentialD; x)+f(x)g(y) );  y[m]:=simplify(y[m-1]*`&varkappa;`[m]-R[m]):  od;"

``

plz help me, I m trying to solve homotopy analysis method for lane emden, what additional steps I have to taken in above programming?

Download LE_EQ.mw

Hi,

  Excuse me, I have the following code

  

###########################

with(combinat);
with(LinearAlgebra);
f:=([1,2,3]);
permute(f);

n:=3;
g:=array(1..n);

for i from 1 to n do
  g[i]:=i;
end do;

permute(g);

###########################

 The output ends up with

 

Error, (in combinat:-permute) 1st argument must be a list, set or a non-negative integer

 

 It seems that maple will not generate permutation of g... How to generate the permutation of array g? i.e. by assigning all variables automatically.

 

Thank you very much!

 

First 1223 1224 1225 1226 1227 1228 1229 Last Page 1225 of 2228