MaplePrimes Questions

Hello,

Is there a Maple command for copying a text to the clipboard ? (Apart from using the contextual menu or the Edit-Copy menu option)

For example:

ee := x^2+y^2+z^2

CopyToClipboard( convert(ee,string) )

Thank you,

César Lozada

 

 

 

work.mw

I'm having problems plotting these three functions on the same graph. I can get two of them, but as soon as I try to add the third, it throws a couple errors no matter what I do. It doesn't help that the docs are confusing. The first two functions are approximating diff(y(x),x) = -2xy(x)+1 with the Euler method (step size of 0.05 and 0.1) that I implemented using a for loop. I gather the data into an array and then plot those. That works. But once I try to set y(x) equal to a Taylor approximation, I can plot that graph but the values for the other functions are strangely absent. I've attached my work. What is wrong with my syntax and how can I plot all three functions at once?

I want to plot a function f(x,y)=x^3-2x^2y. But I only want to plot values where $x^2+y^2 <= 1$. So far I specified the plotting range in the standard way, but I really need to specify it like I described. I want to use plot3d.

Hello,

How can we write a code for solving following system of Pdes ?

restart;
PDE1:=m1*diff(w1(x,t),t$2)-S1*diff(w1(x,t),x$2)+k*(w1(x,t)-w2(x,t))=F1(t)*delta(x-x1);
PDE2:=m2*diff(w2(x,t),t$2)-S2*diff(w2(x,t),x$2)+k*(w2(x,t)-w1(x,t))=F2(t)*delta(x-x2);

In here,  Ki, mi, xi and k are constants where i=1,2.

Since F1(t) and F2(t) are unspecified (ungiven) functions, solutions u1,u2 which we seek, will be depended on  F1(t) and F2(t). 

 

Thanks for your valuable and praiseworthy suggestions and comments.

When one uses the PolynomialIdeals package, then how should he ask the elemnts in an ideal or the number of generators?

An idea can be writing a proc getting a polynomialideal and returning a list with the generators as its elements in this way. Converting the polynomialideal to a list, then deleting its three last entries. But I'm wondering if there is any other way to do this? It's reasonable to be able to ask generators of an ideal of result of some computations in polynomialideal package.

 

Dear Maple users,

I want to label Y axis such that it doesn't encroach the numbers. The figure below illustrates the difficulty I am facing. How can I change the default setting to put letter '\bar{U}' at some distance from Y axis so that it doesn't look crowded? Thanks.

Edit. One crude way to do this is by using typesetting command.

labels = [log(n), typeset(conjugate(U), " ")]

 

i am trying to write the differential equation 

u_{t}=u_{xx}+2u^{2}(1-u) in my maple 15. 

but it shows error,

Error, empty number and  1 additional error.
 

I'm trying to program a procedure that will return me a list of positions defining equally spaced points (planets) around a circumference, for example:
PSI := [0, Pi]; # Location of 2 planets
PSI := [0, ((2/3)*Pi) , ((4/3)*Pi) ]; # For 3 Planets
I'm new to maple so most commands are new to me, I tried building the size of the list with [0 $ n] because I want the first position to always be at 0 degrees. The first problem is that I get this error:

Error, reserved word `for` unexpected

 

nplanets := 2;

2

(1)

make_PSI :=
proc(nplanets);
local n,psin,i,PSI:
n = nplanets;
psin  :=(pi*2)/n;
PSI := [0 $ n];
for i from 1 to n do
 angle :=(psin*i);
 op(i,PSI) := angle;
end do;
end;

 

 

Error, reserved word `for` unexpected

 


Any advice would be appreciated!

Download planetspace.mw

If I let Maple be running on the computer for a while, maybe a day or 2 or so, I almost certainly get a change of several

characters. See my favourite palette:

 

 

As you can see the eternity sign e.g changes to a big N. If I rerun the worksheet everything works ok except for the change of characters.

Not seen above: :=  changes to d

Remedy?

 

hello...how I can pdsolve three equations with related boundary conditions?

please help me.

thanks...

J := f1(r, z)*f2(r, z)*f3(r, z):

`f&theta;` := f2(r, z)*f3(r, z)/fz:

m0 := 1:

``

g := r*ph/l:

sy := (1/2)*arctan(2*g*fz^2/(-fz^2+g^2+`f&theta;`^2-1)):

I4 := (f2(r, z)^2*cos(sy)^2+f3(r, z)^2*sin(sy)^2-(.25*(f2(r, z)^2-f3(r, z)^2))*sin(2*sy)^2/(f2(r, z)^2*sin(sy)^2+f3(r, z)^2*cos(sy)^2))*cos(b)^2+.5*f2(r, z)*f3(r, z)*(f2(r, z)^2-f3(r, z)^2)*sin(2*sy)*sin(2*b)/(f2(r, z)^2*sin(sy)^2+f3(r, z)^2*cos(sy)^2)+((f2(r, z)^2*sin(sy)^2+f3(r, z)^2*cos(sy)^2)^2+(.25*(f2(r, z)^2-f3(r, z)^2))*sin(2*sy)^2/(f2(r, z)^2*sin(sy)^2+f3(r, z)^2*cos(sy)^2))*sin(b)^2:

I6 := (f2(r, z)^2*cos(sy)^2+f3(r, z)^2*sin(sy)^2-(.25*(f2(r, z)^2-f3(r, z)^2))*sin(2*sy)^2/(f2(r, z)^2*sin(sy)^2+f3(r, z)^2*cos(sy)^2))*cos(b)^2-.5*f2(r, z)*f3(r, z)*(f2(r, z)^2-f3(r, z)^2)*sin(2*sy)*sin(2*b)/(f2(r, z)^2*sin(sy)^2+f3(r, z)^2*cos(sy)^2)+((f2(r, z)^2*sin(sy)^2+f3(r, z)^2*cos(sy)^2)^2+(.25*(f2(r, z)^2-f3(r, z)^2))*sin(2*sy)^2/(f2(r, z)^2*sin(sy)^2+f3(r, z)^2*cos(sy)^2))*sin(b)^2:

L := (I4-1)*exp(K2*(I4-1)^2-1):

N := (I6-1)*exp(K2*(I6-1)^2-1):

P23 := -f2(r, z)*f3(r, z)*sin(b)*cos(b)+(.5*(f2(r, z)^2-f3(r, z)^2))*sin(sy)^2*sin(b)^2:

P32 := -f2(r, z)*f3(r, z)*sin(b)*cos(b)+(.5*(f2(r, z)^2-f3(r, z)^2))*sin(sy)^2*sin(b)^2:

P33 := (f2(r, z)^2*sin(sy)^2+f3(r, z)^2*cos(sy)^2)*sin(b)^2:

P22 := ((f2(r, z)^2*cos(sy)^2+f3(r, z)^2*sin(sy)^2)^2-(.25*(f2(r, z)^2-f3(r, z)^2))*sin(2*sy)^2)*cos(b)^2/(f2(r, z)^2*sin(sy)^2+f3(r, z)^2*cos(sy)^2)-f2(r, z)*f3(r, z)*(f2(r, z)^2-f3(r, z)^2)*sin(2*sy)*sin(b)*cos(b)/(f2(r, z)^2*sin(sy)^2+f3(r, z)^2*cos(sy)^2)+(.25*(f2(r, z)^2-f3(r, z)^2))*sin(2*sy)^2*sin(b)^2/(f2(r, z)^2*sin(sy)^2+f3(r, z)^2*cos(sy)^2):

S23 := f2(r, z)*f3(r, z)*sin(b)*cos(b)+(.5*(f2(r, z)^2-f3(r, z)^2))*sin(sy)^2*sin(b)^2:

S32 := f2(r, z)*f3(r, z)*sin(b)*cos(b)+(.5*(f2(r, z)^2-f3(r, z)^2))*sin(sy)^2*sin(b)^2:

S33 := (f2(r, z)^2*sin(sy)^2+f3(r, z)^2*cos(sy)^2)*sin(b)^2:

S22 := ((f2(r, z)^2*cos(sy)^2+f3(r, z)^2*sin(sy)^2)^2-(.25*(f2(r, z)^2-f3(r, z)^2))*sin(2*sy)^2)*cos(b)^2/(f2(r, z)^2*sin(sy)^2+f3(r, z)^2*cos(sy)^2)+f2(r, z)*f3(r, z)*(f2(r, z)^2-f3(r, z)^2)*sin(2*sy)*sin(b)*cos(b)/(f2(r, z)^2*sin(sy)^2+f3(r, z)^2*cos(sy)^2)+(.25*(f2(r, z)^2-f3(r, z)^2))*sin(2*sy)^2*sin(b)^2/(f2(r, z)^2*sin(sy)^2+f3(r, z)^2*cos(sy)^2):

Trr := k0*(J-1)+(1/3)*m0*(2*f1(r, z)^2-f2(r, z)^2-f3(r, z)^2)/J^(5/3):

`T&theta;&theta;` := k0*(J-1)+m0*(f2(r, z)^2*cos(sy)^2+f3(r, z)^2*sin(sy)^2-(1/3)*f1(r, z)^2-(1/3)*f2(r, z)^2-(1/3)*f3(r, z)^2)/J^(5/3)+2*k1*(L*S22+N*P22)/J:

`T&theta;z` := m0*(f2(r, z)^2-f3(r, z)^2)*sin(sy)*cos(sy)/J^(5/3)+2*k1*(L*S23+N*P23)/J:

`Tz&theta;` := m0*(f2(r, z)^2-f3(r, z)^2)*sin(sy)*cos(sy)/J^(5/3)+2*k1*(L*S23+N*P23)/J:

Tzz := k0*(J-1)+m0*(f2(r, z)^2*sin(sy)^2+f3(r, z)^2*cos(sy)^2-(1/3)*f1(r, z)^2-(1/3)*f2(r, z)^2-(1/3)*f3(r, z)^2)/J^(5/3)+2*k1*(L*S33+N*P33)/J:

`Tr&theta;` := 0:

`T&theta;r` := 0:

Trz := 0:

Tzr := 0:

NULLpartial equations

equ(1) := r*(diff(Trr, r))+Trr-`T&theta;&theta;`:

equ(2) := diff(`T&theta;z`, z):

equ(3) := diff(Tzz, z):

# BOUNDARY CONDITIONS

Trr := proc (ro, z) options operator, arrow; 0 end proc:

int((`T&theta;&theta;`-Trr)/r, r, ri, ro) := 13.3*10^3:

2*Pi*(int(Tzz*r, r, ri, ro))-13.3*Pi*ri^2*10^3

Error, (in int) wrong number (or type) of arguments: invalid options or option values passed to indefinite integration. Unknown options: {ro, .8333333333*f1(r, z)*f2(r, z)}

 

int(`T&theta;z`*r^2, r, ri, ro) := 10:

NULL


 

Download for_site.mw

hello...how I can pdsolve three equation with related boundary conditions?

please help me.

thanks...

for_site.mw

Hello, 

I'm having trouble seeing which command is calling the "thaw" for the code below and was wondering if someone is able to save me the trouble from working it out myself. i know its not when the "is" function is called from viewing the showstat for it, but the output prior to mapping that function pops out with no troubles, so im guessing its the generic mapping proc, but of course, in built function so i can only assume its the same way i would write it but im pretty sure i dont use thaw either so anyway the line in question:

map(is, seq(seq(map(eval, Matrix(3, omega[1]) = Matrix(3, omega[0]), [n = i, m = j]), i = 1 .. 10), j = 1 .. 10));
Error, (in thaw) too many levels of recursion
 

 

Hi guys ,

i have a manifold ( schwarzschild spacetime ) which want to find Gibbons-Hawking boundary term.

boundary.mw

 

Thanks in advance

Maple 2017.1 on windows 7.

This is VERY frustrating. If I have a string which is too long (do not blame me, it is Maple's output), and  try to save it to text file using fprintf(), then Maple decides to insert CARRIAGE RETURN at about each 1,000,000 characters intervals. 

So if the string happened to be 5 million chars, and instead of getting one long line in the file for this one result, It writes 5 lines in the file.

Becuase of this, I can't postprocess this output, since the program that reads the file expects one line per one result. So it fails to parse it. And having to post process the file to correct this is not easy at all.

Why is there a limitation of writing long string to a file without it being chopped of like this? Is there a way to work around this? Here is a MWE

 

restart;
directory("C:\\bug");
result:=int((a+b*tan(e*x+d)+c*tan(e*x+d)^2)^(1/2)*tan(e*x+d)^2,x):
result_as_string:=convert(result,string):
fd := fopen("out.txt",WRITE):
fprintf(fd,"%s\n",result_as_string);
fclose(fd);

As you can see, I wrote the result as one string. Now if you look at the file out.txt in the directory (you might want to use good editor for this, such as vi or textedit), you will see many lines in there, and not one long line as expected. Or you can run this code

restart;
directory("C:\\bug");
number_of_lines :=0:
line:=readline("out.txt"):
while line <>0 do
   number_of_lines :=number_of_lines + 1:
   line:=readline("out.txt"):
od:
print(` number of lines read is `,number_of_lines);

The above gives

                ` number of lines read is `, 24

This problem now means I am not able to continue with what I am doing. Does this happen on other platforms?

I think this happens due to Maple limits

      `[Length of output exceeds limit of 1000000]`

However, I am NOT dispalying anything on the screen. This is all going to text files.  It seems Maple output limits of 1,000,000 is confusing fprintf() to a file as well?

When we have a two variable function f(x,y), Maple can plot f-inverse of a value with contourplot. But how about contourplot of a three variable function? for example f-1(0) which can be a surface in the 3 dimensional space. The contourplot3d is just the contourplot (2-dimensional) which also shows the value of f(x,y) on the third axis. So this is not what I want.

Hi,

I am trying to execute a for loop for some repetitive calculation. For eg. i is varying from 1 to 10 and j is varying from 1 to 6. For each combination of i and j, I am computing  value of a function.  I got output for some initial (i,j) pair in for loop. After that, an error encountered and for loop interrupted( stopped). How can I tell maple to continue  for loop even when some error occurred for some combination of (i,j) pair. Maple can discard the output for which an error occurred and can continue the foor loop for the remaining (i,j) pair. For eg.

1) In for loop, I am using NLPSolve command and after giving some initial result it shows-

Error, (in Optimization:-NLPSolve) complex value encountered.

2) Similarly, in for loop, I am using DirectSearch[search] command and after giving some initial result it shows-

Error, (in DirectSearch:-Search) cannot find feasible initial point; specify a new one

Please guide me in this problem..

Thanks and Regards,

Nilesh

4 5 6 7 8 9 10 Last Page 6 of 1478