MaplePrimes Questions

Hi,

i have a problem with this code ?

CodeVectorCalculus.mw

ideas ?

Thanks

Ty4 :=combine(-(chi*omega^2+2*omega)*cos(omega*(Upsilon+b1))*P1*(3*exp(-3*omega)*kappa+exp(-omega)*kappa+exp(-omega*(2*d1+1))*kappa^2+3*exp(-omega*(2*d1+3))*kappa^2-2*exp(-omega*(2*d1+3))*omega-4*exp(-3*omega)*omega^2-2*exp(-omega*(2*d1+3))*d1*kappa*nu__p^2*omega+4*exp(-omega*(2*d1+3))*d1*kappa*nu__p*omega+2*exp(-omega*(2*d1+1))*d1*kappa*nu__p^2*omega+4*exp(-omega*(2*d1+1))*d1*kappa*nu__p*omega-exp(-3*omega)*kappa*nu__p^2+exp(-omega)*kappa*nu__p^2+exp(-omega*(2*d1+1))*kappa^2*nu__p^2-exp(-omega*(2*d1+3))*kappa^2*nu__p^2+2*exp(-omega*(2*d1+1))*d1*kappa*omega-8*exp(-omega*(2*d1+3))*d1*nu__p^2*omega^3-16*exp(-omega*(2*d1+3))*d1*nu__p*omega^3-4*exp(-omega*(2*d1+3))*kappa*nu__p^2*omega^2-8*exp(-omega*(2*d1+3))*kappa*nu__p*omega^2+6*exp(-omega*(2*d1+3))*d1*kappa*omega-4*exp(-3*omega)*kappa*nu__p*omega+4*exp(-3*omega)*d1*nu__p^2*omega^2+8*exp(-3*omega)*d1*nu__p*omega^2-2*exp(-3*omega)*kappa*nu__p^2*omega+2*exp(-3*omega)*kappa*nu__p+2*exp(-omega)*kappa*nu__p+2*exp(-omega*(2*d1+1))*kappa^2*nu__p+2*exp(-omega*(2*d1+3))*kappa^2*nu__p-8*exp(-omega*(2*d1+3))*d1*omega^3-4*exp(-omega*(2*d1+3))*nu__p*omega-2*exp(-omega*(2*d1+3))*nu__p^2*omega-4*exp(-omega*(2*d1+3))*kappa*omega^2-2*exp(-3*omega)*kappa*omega-4*exp(-3*omega)*nu__p^2*omega^2+4*exp(-3*omega)*d1*omega^2-8*exp(-3*omega)*nu__p*omega^2)*exp(-omega*(1-d1-chi))/(omega*(4*exp(-2*omega)*nu__p^2*omega^2+8*exp(-2*omega)*nu__p*omega^2-exp(-4*omega)*nu__p^2+2*exp(-2*omega)*nu__p^2+4*exp(-2*omega)*omega^2+2*exp(-4*omega)*nu__p-4*exp(-2*omega)*nu__p-nu__p^2+3*exp(-4*omega)+10*exp(-2*omega)+2*nu__p+3)*(kappa+1)*Pi),exp);

 

Hey guys, I am looking for a way to translate a maple code to matlab with the resultnames of codegeneration following a rule set by the loop. I tried a few ways, including with printf in the result name but no success.

Basically I need the resultname variables to be KNL(1,1) or KNL[1,1]. It doesn't let me do the way I put in the sheet, it renames the variable automatically.

Please see the sheet attached

Thanks in advance!!

restart

with(CodeGeneration)

with(LinearAlgebra)

A := RandomMatrix(6, 6)

Matrix(%id = 18446746689673050582)

(1)

``

for ii to 6 do for jj to 6 do Matlab(A[ii, jj], resultname = KNL[ii, jj]) end do end do

cg = 67;

 

``

Download Matlab_-_Resultname.mw

My problem is explained with sufficient detail in the below worksheet:

 

restart

Digits := 100:

with(StringTools); with(FileTools); with(ListTools)

``

currentdir("H:\\MAIN DIRECTORY\\ESD-USB\\my_maple_library")

L[1] := ListDirectory(currentdir()):

L[2] := [seq([k, L[1][k]], k = 1 .. nops(L[1]))]:

read L[1][15]:

currentdir("H:\\MAIN DIRECTORY\\ESD-USB\\Computer Science\\MAPLE\\Exponentiation by Squaring"):

 

B := proc (n) options operator, arrow; [seq(d(n, 2, j), j = 0 .. floor(ln(n)/ln(2)))] end proc:

 

 

Identity0 := proc (x, n) options operator, arrow; x^n = piecewise(`mod`(x, 2) = 1, x*(x^2)^((1/2)*n-1/2), `mod`(x, 2) = 0, (x^2)^((1/2)*n)) end proc

NULL

Generate_Equations_List := proc (n) global EquationsList, r, B_n, T; B_n := B(n); T := nops(B_n); r[T] := 1; return [seq(r[u-1] = r[u]^2*x^B_n[u], u = 1 .. T)] end proc:

Exp_by_squares := proc (M, Y) global R; Generate_Equations_List(M); R[1] := max([allvalues(rhs(isolate(F[0](Y, M)[1], r[1])))]); return 'x^n' = R[1]^2*X^B_n[1] end proc:

 

N := (rand(25 .. 33))():

n = 31

 

x = 34

 

x^n = 299120672332806228664106719451209941853702979584

 

x^n = 299120672332806228664106719451209941853702979584

(1)

NULL

st := time[real]():

x^n = 299120672332806228664106719451209941853702979584

 

0.40e-1

(2)

st := time[real]():

x^n = 299120672332806228664106719451209941853702979584

 

0.74e-1

(3)

is(t2 < t1)

false

(4)

``


 

Download slow.mw

 

 

So I know I have obviously done something wrong, but it has proven very difficult to establish where given how little i know about the solve function

 

Hi all; 

Given two vectors C1 and C2.
Under what condition on C1 and C2,  the two matrices D1 and D2 are equal.

condition.mw

 

many thanks for your help


I'm trying to evaluate an integral, but after several hours, MAPLE 2019 is unable to return an answer.  My CPU and memory are not being taxed, and the integrand appears well behaved.  Please see below. Any advice?

restart

istar := y*sinh(Pi*y)*exp(-alpha*y^2)*LegendreP(-1/2+I*y, 1+u)

y*sinh(Pi*y)*exp(-alpha*y^2)*LegendreP(-1/2+I*y, 1+u)

(1)

Istar := `assuming`([int(istar, y = 0 .. infinity)], [alpha > 0, u > 0])

int(y*sinh(Pi*y)*exp(-alpha*y^2)*LegendreP(-1/2+I*y, 1+u), y = 0 .. infinity)

(2)

alpha := 1; u := 2

2

(3)

plot(istar, y = 0 .. 40)

 

evalf(Istar)

``


 

Download Istar.mw

 

How I can substitute Eqs1-16) into Eq (17)?

Should I use subs rule?

Thanks 

 

 

A few seconds after calling up Help starts zucking araound and the whole computer then freezes. Ctrl-Alt-Delete doesn't work, hard reset required. Very funny. Am I alone?

Hi

I'm trying to export a file using the .mw file. without a lot of success. Can someone help?

For 1 game, the output is between (8) and (9).

For 2 games. the output is after (17).

TEST.mw

 

How to find 
x=log(6) in maple

Hi Everyone, 

 

I am searching for some examples on Maple how to do a Static Analysis of a Truss: Method of Joints. IS there any Maplesoft App or something that has been built already that anyone here can recommend to me. Thank you in advance.  

Express cos(5t)  in terms of powers of cost and sint. cos(6t)=cos(t)^6+acos(t)^4*sin(t)^2*+bcos(t)^2*sin(t)^4+csin(t)^6.

a=?,b=?c=?

how do we find this through maple?

Hey guys, 

Is there any way to remove these imaginary parts of the numbers ?

I tried using the RealDomain package in beginning of code but it starts showing some Float(undefined) numbers and I don't understand why since none of the terms inside the sqrt are negative.

Thanks in advance.

Download Reforço.mw

Dear,

I'm trying to reproduce in Maple an integer linear programming example from Chvatal's book: 

Maximize z= 4x1 + 5x2 + 5x3 + 2x4

Subject to 33x1 + 49x2 +51x3 + 22x4 <= 120,  x= nonnegative integers. 

The optimal solution is: x1 = 2,   x= 1,  x3 = x4 = 0,     z=  13.

 

In Maple I type: 

 LPSolve( 4x1 + 5x2 + 5x3 + 2x4, {33x1 + 49x2 +51x3 + 22x4 <= 120}, maximize, assume ={nonnegative, integer}); 

but Maple gives me back the following error: 

Warning, problem appears to be unbounded. [0, [x=0, x2 =0, x3 =0, x4 =0]]

 

I know the example has the abovementioned definite solution since it comes from the textbook. So, what could I be doing wrongly? 

Many thanks for your help. 

 

As useful as the SetProperty and GetProperty commands are in this package, I am seeking a command that is called by the action of a user input prompt, for example, the prompt window question is something like:

"How many parameters of silly do you want to specifiy for this analysis? (maximum is 10)"

And once the user has entered a natural number between 1 and 10, that number of components of a specified type is generated  in the worksheet.

Is this a real thing already and I can't find it or is there a round about way to do it without an actual command existing?

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