Unanswered Questions

This page lists MaplePrimes questions that have not yet received an answer

Hi all

Hope the best for all. 

I have a single product of two sum, where the second sum admits one variable, namely j, from first one.

how can I it via maple?

thanks for any help.

how can write this loop that has written in matlab to maple??
i=1;
for e=T1P1:0.0399:T1P;
    E(i)=e;
    gama1(i,:)=a-atan(e/Rb1);
     i=i+1;
end
 

HELLO

I AM A STUDENT AND WAS LOOKING FOR USING MAPLE2018.

I REQUESTED FOR A MAPLE EVALUATION. MY QUESTIONS ARE:

FOR HOW LONG CAN I USE THIS EVALUATION VERSION?

SECONDLY, WHAT SOFTWARE FACILITIES I WOULD NOT GET WITH THIS EVALUATION VERSION? WHAT ARE THE DIFFERENCES BETWEEN THE PRICED ENTERPRISE VERSION AND MAPLESOFT EVALUATION VERSION?

THIRDLY, WHAT ARE THE DIFFERENCES BETWEEN MAPLESOFT STUDENT VERSION AND THE ULTIMATE PRICED ENTERPRISED VERSION?

PLEASE REVERT BACK TO ME AT THE EARLIEST.

Hi,

this has been asked before but none of the other answers worked for me. I want to generate code from expressions that were simplified using some assumptions. I the assumptions remain on the variables Maple replaces variable names wich I don't understand.

Here is my script where I tried to remove the assumptions based on the answers of previous questions. Unfortunately, even though assumptions are removed in the end, Code generation still replaces the variables.

Thank you in advance!

Here is my minimal exaple Code:

 

restart:

 

# test removing assumptions

funa:=x+y

x+y

(1)

 Maple_proc := codegen[makeproc](funa,(ListTools[Flatten]([eval(alist,1)])));

proc (alist) x+y end proc

(2)

# make some assumptions

assume(x,real);assume(y,real);

x,y

x, y

(3)

#place variables in a list

alist:=[x,y];

[x, y]

(4)

# make cool interferences with assumptions...

# clear assumptions

# try 1 from https://www.mapleprimes.com/questions/207601-Remove-Assumptions-

nms:=convert(indets(alist,name),list);
nmsS:=convert~(nms,string);
L:=StringTools:-Substitute~(nmsS,"~",""); #Removing "~"
L1:=parse~(L);
S:=nms=~L1;
Expr:=subs(S,expr);

[x, y]

 

["x~", "y~"]

 

["x", "y"]

 

[x, y]

 

[x = x, y = y]

 

expr

(5)

hasassumptions(x)

true

(6)

# try 2

nops(alist)

2

(7)

for i from 1 to nops(alist) do
parse(cat(StringTools[Substitute]~(alist[i],"~",""),":='",StringTools[Substitute]~(alist[i],"~",""),"'"));
end do;

'x'

 

'y'

(8)

# check if assumtions are there

hasassumptions(x)

true

(9)

#try 3 https://www.mapleprimes.com/questions/39555-Unassume

for u in alist do
`property/object`[u]:=evaln(`property/object`[u]);
`property/OrigName`[u]:=evaln(`property/OrigName`[u]);
end do;

`property/object`[x]

 

`property/OrigName`[x]

 

`property/object`[y]

 

`property/OrigName`[y]

(10)

hasassumptions(x)

false

(11)

hasassumptions(y)

false

(12)

alist

[x, y]

(13)

funb:=x+y

x+y

(14)

 Maple_proc := codegen[makeproc](funb,(ListTools[Flatten]([eval(alist,1)])));

proc (x, y) x+y end proc

(15)

 Maple_proc := codegen[makeproc](funa,(ListTools[Flatten]([eval(alist,1)])));

proc (x, y) x+y end proc

(16)

 

 CodeGeneration[C](Maple_proc, optimize, declare=[x::float,y::float], defaulttype=float, deducetypes=false, coercetypes=false, output="fun.c");

Warning, the following variable name replacements were made: x~ -> cg, y~ -> cg1

 

 

>

 

 

 

 

 

 

 

 


 

Download testunassuming.mw

Hello guys

I have a simple but crucial question about variation, especially in cosmology and gravity. suppose we have the action such as

S=int(sqrt(-g)*F(R,RµναβRµναβ),d^4x) where g is determinant metric gµν and d^4x is space in 4D and F is an arbitrary function of R (Ricci scalar) and scalar which created by Riemann tensor. How we can define this action in the maple 18 and take variation with respect to the metric.

thanks

Essentially I have this trigonometric equation and I want to solve (get the roots of) it within the range -Pi..Pi:

v := a+b*cos(t)-c*(d*(1-(a+b*cos(t))^2-d^2*sin(t)^2)^(1/2)+e*sin(t)) = 0;
v1 := t > -Pi;
v2 := t < Pi;

Where t is the variable and a..e are constants.  At the moment I am trying the following:                  
solve({v, v1,v2}, t, allsolutions, explicit);


My problem is that Maple tries to solve this - I get Evaluating in the bottom left corner of the window - but never seems to return with a solution even after using 52,000s and 5GB of memory: I am using a late model macbook.

Can anyone see a way of re-framing this equation so that Maple can return an answer?

hi,

I want to setup quantum mechanical angular momentum operators and kets such that i can do something like:

Lz[2] . Ket(??, j, m) -> m hbar        (instead of getting m as eigenvalue)

L^2[1] . Ket(??, j, m) -> j (j+1) hbar^2           (instead of getting j)

where L and Lz are quantum operators. 

maybe if i knew how to do 

QuantumOp . Ket{QuantumOp, j) -> j (j+1)

i could do it with explicit tensor products of Kets - one for j, one for m?

can somebody give me an idea of how to do this, or point me at an example?

many thanks,

larry

I was just wondering if someone could explain why kernelopts(maxdigits) = 38654705646, as in is this different for a differing computer, or is there a design aspect of maple that requires it to be this number, or is there a mathematical reason?

Interestingly solves runtimes vary by orders of magnitude when new equations are added to it. Interestingly in one of the cases shown here when  a larger more complex equation is added it runs orders of magnitude faster.

This graph shows the runtimes of solve on my laptop, as i pass it more members of a family of equations. Notably runtime jumps up by an order of magnitude at 4 but then reduces when i add the next equation, despite it being a much longer and more complex one



The worksheet this is taken from ,where you can see all the arguments passed to solve is here.

Hi all. I have two questions about polynomials over Q.

i) Let f,g be polynomials over Q. How to show (with Maple) that the decomposition field of f is included in the decomposition field of g?

ii) Let f be a polynomial of degree n  over Q with Galois group C_n, the cyclic group of order n. Then, there is a polynomial P with coefficients in Q, of degree n-1, s.t. the iteration: u0=some root of f, u_{k+1}=P(u_k) gives all the roots of f; how to find P (with Maple)?

Thanks in advance.

Hello.

I have this problem when executing the entire worksheet or selected groups.
Also Maple can crash by itself, to its heart's content)
What I can do to solve this problem?
OS: W7 x64, Java is up to date

Thx.

(a) Plot the graph of  
                       sin(x)*exp( -x^2)
 for x in the interval [-2,2]. 
(b) Find to 10 decimal digits the maximum and minimum values of 
                         sin(x)*exp( -x^2)
 for x in [-2,2] AND find the corresponding values of x. [So if the maximum occurs at x=a, you should also compute sin(x)*exp( -x^2)   both to 10 digits. Similarly for the minimum. Using unapply to make the expression into a function will be useful here.]  

So far I have this for a

> j := exp(-x^2)*sin(x);

> plot(j, x = -2 .. 2);

 

There is a one-to-one correspondence between subsets of {1, 2, . . . , n} and binary lists of length n, that is, lists L = [x1, x2 , . . . , xn] where x1, x2, . . . , xn are elements of the set {0,1}.  The correspondence is given by associating to the set S the list L where xi = 1 if i is in S and 0 if not. For example, the set {1,3,5} corresponds to the list [1,0,1,0,1,0,0] if n = 7.

(a) Write a procedure list_to_set whose input is a binary list and whose output is the corresponding set. E. g., list_to_set([1,0,1,0,1]) will return the set {1,3,5}. Note that nops(L) is the length of a list.

(b) Write a procedure set_to_list whose input is a pair S,n where S is a subset of {1, 2, . . . , n} and n is a positive integer and whose output is the binary list of length n corresponding to the set S. E. g., if n = 5 then set_to_list({1,3,5},5) will return [1,0,1,0,1].

(c) Show by a few tests that each procedure works. Then apply set_to_list to each set in the powerset of {1, 2, 3, 4} to form all binary lists of length 4. Make a program to print out a table of the following form. (But the order need not be the same as that started below.)

   [0,0,0,0] <-->  {  }
   [1,0,0 0] <--> { 1 }
   [0,1,0,0] <--> { 2 } 
    ........
    etc

Some extra commas in the output is okay. You may obtain the power set of the set {1,2,...,n} by the command powerset(n); but you must first load the package combinat.

The expression X^n, for an interger power n and any X, can be computed using the following formulae, which represent a negative power in terms of a positive power (-n), and a positive power in terms of a smaller non-negative power (either n/2 or n-1), and use only multiplication and division: 
                                    
                          X^n = 1/X^(-n)                      if n < 0 
                          X ^n = I*d                             if n = 0
                          X ^n  = X^(n/2) * X^(n/2)      if n is even
                          X^n  = X*X^(n-1)                  if n is odd.
These formulae lead to an efficient recursive algorithm for computing integer powers using the minimal number of multiplications. 

(a) Write a procedure MatPow(X,n::integer) to implement this algorithm for computing powers of matrices. Test MatPow(<<1|2>,<3|4>>,12) and MatPow(<<1|2>,<3|4>>,-12).

(b) Write a procedure PolyPow(X,n::integer) to implement this algorithm for computing powers of numbers and polynomials. Your procedure needs to exapnd each product of polynomials in order to be effective. Test PolyPow(123,12), PolyPow(123,-12), PolyPow(x^2+1,12) and PolyPow(x^2+1,-12). 

First 107 108 109 110 111 112 113 Last Page 109 of 334