MaplePrimes Questions

Say I have

a.mpl

b.mpl

c.mpl

each of them can be ran seperately. While I am running a single file, it looks like that the machine is not "using" too much computation power. I wonder if it's possible to run multiple at the same time ?

My CPU is i7 940X, with 4 dual core processors, so it has 8 threads.

I know that the GUI can run multiple worksheets seperately, but if in one of the worksheet, i click "run all" (!!! botton),  I will have to run each line separtely by clicking one at a time.

Is there a better way to do this? What's the best way to do this? I hope to somehow 'maximize' the full use of my CPU (without changing the code).

 

casper

Is this a  false positive, where Maple is solving an ODE which is supposed to be unsolvable?

Accoding to http://www.maplesoft.com/compare/mathematica_analysis/Comparison_Maple_Mathmatica_DEs_Kamke.pdf and considering ODE 13

Maple 18.01 does give an answer for the above ODE. I verfied the ODE from the book as well. The answer returned by Maple is very large, but it does solve it in 195 CPU seconds. Therefore the question is: Is this a false result? Or is the above document have an error in it and ODE 13 is actually solvable?

restart;
ode:=diff(y(x), x$2)-(a*y(x)^2+b*x*y(x)+c*x^2+alpha*y(x)+beta*x+gamma)^(-3/2);
sol:=dsolve(ode,y(x)) assuming a::NonZero; #I get an answer with or without this assumption. The book has the assumption
odetest(sol,ode);

btw,

 odetest(sol,ode)

gives an error as well. May be this is related to the issue or not. Not sure now.

Hi:

when use the dsolve,numeric,I see error,why?

f := (x, t) -> piecewise(t < 10, 0.480e9*(1-(1/10)*t)*sin(Pi*x), 10 < t, 0)

eq1 := diff(y(t), t, t)-y(t)^2-f(x,t) = 0:
eq2 :=simplify( int(lhs(eq1)*sin(Pi*x), x = 0 .. 1) = 0):

dsolve({eq2, y(0) = 0, (D(y))(0) = 0}, numeric)

initial conditions are zero.

 

 

Hi,

 

  I have a loop code, such as

 

****

i_max:=10;

for i from 1 to i_max do
  blah blah blah

end do;

****

 

  I would like to clean memory, something like restart suppose to do, after each cycle. Restart could only work at top level. How should I do to clean memory after each cycle?

 

Hi every Body?

I will define the function f(t) in maple,how?

f(t)=1-t for 0<t<10 and t for t>10

The question has been asked at http://www.mapleprimes.com/questions/133139-A-Question-About-Obtaining-Power-Of-A-Variable

 

 

However, still, I would like to have a simple, straightfoward solution. The situation is not about several term case, x^a*y^b + x^(a+2)*y^b, but for a single term. I have a term "3*x^k*y^(k+2) ", and how should I do to obtain the power of x, and the power of y? (k and k+2) 

 

I tried the following input as somehow suggested in the link above

***********

term:=3*x^k*y^(k+2);

x_degree:=map(t -> `if`(match(t = a*x^b*y^c, x, 's1'), subs(s1,b), NULL), convert(term, list));
y_degree:=map(t -> `if`(match(t = a*x^b*y^c, y, 's1'), subs(s1,c), NULL), convert(term, list));
print(x_degree,y_degree);

*****

 

I got 

***

k (k + 2)
3 x y
[0, k, 0]
[0, 0, k + 2]
[0, k, 0], [0, 0, k + 2]

****

I have no idea why k appear at second variable in [0,k,0] while k+2 appear at the third in [0,0,k+2]...

Dear all,

I want to compute the charateristic polynomials of some matrices (the number of matrices is more than 10000), and write the coefficients of the resulting polynomials to a text file. The entries of the given matrices are stored in a text file. More specifically, suppose that M_1, M_2 and M_3 are three matrices, and the entries of them are stored in a text file named "data.txt" in the following form:

1 2 3

4 5 6

7 8 9

 

1 -1 0

2 3 6

-3 0 2

 

2 1 -1

1 -1 -2

0 1 2

The resulting output file should be of the following format:

1, -15, 18, 0

1, -6, 13, -28

1, -3, 1, 3

I don't know how to repeatedly read the data from the given text file. I think the procedure should be as follows.

>restart:

>with(LinearAlgebra):

>with(FileTools:-Text):

>fid:=Open("data.txt"):

>fid_1:=Open("data_1.txt"): #data_1 is the output file

>ReadFile(fid); #since the number of matrices is very large, I want the data to be read once

>numlines:=CountLines(fid);

>for i from 1 to numlines do

       here I need repeatedly read the data to a matrix M (I don't know how to do);

       P:=CharacteristicPolynomial(M,x);

       writedata[APPEND]("data_1.txt",map(i-> coeff(p, x, i), [seq(i, i = 0 .. degree(p, x))]));  #this statement cannot write the coefficients of a polynomial in the same row

>end do;

>Close(fid):

>Close(fid_1):

Now as I'm pretty new to Maple, I don't know any better and can't seem to get any information out of the help documents. 

Thanks a lot.

Hi,

So I wrote this script (30 lines) in Maple and it works fine. But now I want Maple to repeat the script while changing my input variable.

My variable is T and I want Maple to perform the script for T=0 to T=15 and with a step size of 0.1.

 

I tried for loop and proc, but could not make it work. What is the most appropriate way do this?

 

Thank you.

 

 

 

Hi everyone. Could I work with functions of complex variable in maple ?

Hi all,

I'm using MAPLE 13 and I'd like to know if someone knows how to generate the variables associated to the CodeGeneration for C code. At this moment I need to create manually the variable generated from the C code.

Example:

JJ := Jacobian(convert(Pint, Vector), [P1xenu, P1yenu, P1zenu, roll, pitch, yaw, D1xbody, D1ybody, P2xenu, P2yenu, P2zenu, ROLL, PITCH, YAW, D2xbody, D2ybody]);

CodeGeneration['C'](JJ, optimize);

Output:

t1 = cov2 * cov2;
t2 = cov1 * cov1;
t4 = 0.1e1 / (t1 + t2);
t5.......

And in the C code I need to create:

double t1, t2, t3..... manually

I can I solve this issue?

Best regards

André Dias

Hi everyone,

I have a question regarding the derivation of tensors/matrices.
Let's assume for simplicity, that I have a vector (6x1) s and a matrix A (6x6)defining Transpose(s)*Inverse(A)*s. From this function I want to calculate the derivative w.r.t. s. My approach would be

restartwith(Physics):
with(LinearAlgebra):
Define(s,A)

Diff(
Transpose(s)*Inverse(A)*s, s)

As a result I get

though I'd rather expect something like Inverse(A)*s + Transpose(s)*Inverse(A)

Now as I'm pretty new to Maple, I can imagine that my approach is wrong, but I don't know any better and can't seem to get any information out of the help documents.

Thanks in advance for any of your suggestions!

In the book "Challenges in Geometry" of the author Christopher J. Bradley at p. 32, the triangle with three sides a := 136, b := 170, c := 174 has three medians ma := 158, mb := 131, mc := 127. I checked

restart:

a:=2*68;

b:=2*85;

c:=2*87;

ma:=sqrt((b^2+c^2)/2-a^2/4);

mb:=sqrt((a^2+c^2)/2-b^2/4);

mc:=sqrt((b^2+a^2)/2-c^2/4);

Now I want to find coordinates of vertices of a triangle like that (in plane). I tried

restart;
DirectSearch:-SolveEquations([(x2-x1)^2+(y2-y1)^2 = 136^2,
(x3-x2)^2+(y3-y2)^2 = 170^2, (x3-x1)^2+(y3-y1)^2 = 174^2], {abs(x1) <= 30, abs(x2) <= 30, abs(y1) <= 30, abs(y2) <= 30, abs(x3) <= 30, abs(y3) <= 30}, assume = integer, AllSolutions, solutions = 5);

but my computer runs too long. I think, there is not a triangle with integer coordiantes. 

How can I get  a triangle  with coordinates of vertices are rational numbers?

 

Dear all,

It's very convenient to define a DE or PDE through Differential Operator D, for example,

((D[1, 1]+D[1, 2]+D[2, 2])(z))(x, y) = exp(x)*sin(y)

Is it possible to realize Inverse Operator Method of Operator D? How to solve the following equation if we rewrite the pde through inverse operator method?

(z)(x, y)=((D[1, 1]+D[1, 2]+D[2, 2])^(-1))exp(x)*sin(y)

 

Thanks a lot.

hi.i am a problem for solve analytic double integration as blow,plese help me....Thanks alot

int(int((2*gamma*cos(psi)/(D-r*sin(theta)*sin(phi))-2*gamma*cos(psi)/(D+r*sin(theta)*sin(phi)))*r^2*cos(theta)*sin(phi), r = 0 .. L), phi = 0 .. Pi)

 

I UPLOAD THIS INTEGRAL AS FOLLOW;;;;;int.mw

int(int((2*gamma*cos(psi)/(D-r*sin(theta)*sin(phi))-2*gamma*cos(psi)/(D+r*sin(theta)*sin(phi)))*r^2*cos(theta)*sin(phi), r = 0 .. L), phi = 0 .. Pi)

``


Download int.mw

I want to extract all the coefficients of a polynomial. For example, let p:=x^5-8x^3+2, and the function coeffs(p) returns 1, -8, 2. In fact, I want to obtain 1, 0, -8, 0, 0, 2. Thanks to everyone.

First 1395 1396 1397 1398 1399 1400 1401 Last Page 1397 of 2429