Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hello people :) 

As the captian says, im trying to remove an old task i've made.
But i get this:

Error in Get, invalid object [_XML_reply_data_get("reference" =
"_Maplets_reference_12","parameter" =
"value",_XML_content("Task,UserTasks,Nyops",&Entity "#xc3",&Enity
"#xa6","tning"))]

And i have no idea what it is, but it won't erase my task :'D

Thanks a bunch in advance! 

Have a great weekend you all
Best regards Lucas :)

Hi

I am a student of economics writing my thesis. I have an inverse demand function defined:

p[i,j]=1-q[i,j]-αq[i,k]-β(q[h,j]+αq[h,k])

where α,β are scalars, i{1,2,}, j {1,2,3}, h/=i and k/=j.

I wanted to know how do i input this kind of function in the program and how do i calculate the function of q[i,j] (the inverse)

Thank you!

I would like to extract the x and y values from a list containing ordered pairs, [x,y], and display as a list.

For example, given 

  A:= [ [4,2], [9,1], [6,8] ] 

how can I obtain 

 X:=[4,9,6] and Y:=[2,1,8] 

using a simple command?

Thank you!

Why is lamba protected as something it traditionally isnt for this package?

 


 

restart

lambda(n) = (-1)^Omega(n)

 

 

with(numtheory)

lambda(n) = (-1)^Omega(n)

 

[GIgcd, bigomega, cfrac, cfracpol, cyclotomic, divisors, factorEQ, factorset, fermat, imagunit, index, integral_basis, invcfrac, invphi, iscyclotomic, issqrfree, ithrational, jacobi, kronecker, lambda, legendre, mcombine, mersenne, migcdex, minkowski, mipolys, mlog, mobius, mroot, msqrt, nearestp, nthconver, nthdenom, nthnumer, nthpow, order, pdexpand, phi, pi, pprimroot, primroot, quadres, rootsunity, safeprime, sigma, sq2factor, sum2sqr, tau, thue, varphi]

(1)

Omega := proc (n) options operator, arrow; bigomega(n) end proc:

numtheory:-lambda(667)

308

(2)

``


 

Download main.mw

My learning exercise today is the Calkin-Wilf Tree, and the first worksheet I have the issue, due to needing to use a set operator and at that point of computation losing the ordering if it were to be a list (I have tried with a list, and was unsuccessful) none the less my question is, can I alter the ordering condition for Sets in a worksheet produced therein? 

I also encountered a strange result that I would appreciate an explaination for as seen below in the uploaded worksheet

 


 

restart

``

https://en.wikipedia.org/wiki/Calkin–Wilf_tree

 

 

Q := proc (n) options operator, arrow; (`minus`(map(rhs, solve(`union`(seq({q[0] = 1/2, q[1] = 1, q[i+1] = 1/(2*floor(q[i])-q[i]+1)}, i = 1 .. n)))), map(rhs, solve(`union`(seq({q[0] = 1/2, q[1] = 1, q[i+1] = 1/(2*floor(q[i])-q[i]+1)}, i = 1 .. n-1))))))[] end proc

proc (n) options operator, arrow; (`minus`(map(rhs, solve(`union`(seq({q[0] = 1/2, q[1] = 1, q[i+1] = 1/(2*floor(q[i])-q[i]+1)}, i = 1 .. n)))), map(rhs, solve(`union`(seq({q[0] = 1/2, q[1] = 1, q[i+1] = 1/(2*floor(q[i])-q[i]+1)}, i = 1 .. n-1))))))[] end proc

(1)

NULL

delta := proc (x, y) options operator, arrow; piecewise(x = y, 1, x <> y, 0) end proc

proc (x, y) options operator, arrow; piecewise(x = y, 1, x <> y, 0) end proc

(2)

 

 

q[1] := 1

1

(3)

q[2] := 1/2

1/2

(4)

q0 := proc (n) options operator, arrow; 1/(2*floor(Q(n)*(1-delta(n, 2))+delta(n, 2)*q[2]+delta(n, 1)*q[1])-Q(n)*(1-delta(n, 2))-delta(n, 2)*q[2]-delta(n, 1)*q[1]+1) end proc

proc (n) options operator, arrow; 1/(2*floor(Q(n)*(1-delta(n, 2))+delta(n, 2)*q[2]+delta(n, 1)*q[1])-Q(n)*(1-delta(n, 2))-delta(n, 2)*q[2]-delta(n, 1)*q[1]+1) end proc

(5)

[seq(q0(k), k = 1 .. 20)][1]

1/(2*floor(()+1)+())

(6)

NULL


 

Download Q1_MP_08112019.mw

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa


Hello. Here is my question.

 

#GIVEN:

ST := [`162` = Record(mu = 475, sigma = 41), `70` = Record(mu = 480, sigma = 42),
       `168` = Record(mu = 448, sigma = 103)]

[`162` = Record(mu = 475, sigma = 41), `70` = Record(mu = 480, sigma = 42), `168` = Record(mu = 448, sigma = 103)]

(1)

Games:=[[`162`, `70`], [`70`, `168`], [`168`, `162`]]

[[`162`, `70`], [`70`, `168`], [`168`, `162`]]

(2)

#I need Maple commands to follow the order of Games to auto create STO please

STO:=[`162` = Record(mu = 475, sigma = 41),`70` = Record(mu = 480, sigma = 42),
       `70` = Record(mu = 480, sigma = 42),`168` = Record(mu = 448, sigma = 103),
     `168` = Record(mu = 448, sigma = 103),`162` = Record(mu = 475, sigma = 41)]

`Non-fatal error while reading data from kernel.`

(3)

 


 

Download ORDERED.mw

Good day.

My question involves a set of prescribed points in the Cartesian plane. The x and y ranges are fixed. The points are connected by (imaginary) horizontal and vertical lines to produce a fixed number of blocks / grids.

An example is given in the attached file.  Grid_Example.mw

Now, I wish to reduce the intervals between these points by a scaling factor, n, so as to generate more blocks within the plane that is constrained by the x and y-ranges.

In doing so, I need to find the (x,y)-location of these points in the plane and it would also be great if I could obtain a simple plot.  

As I have several scaling factors to investigate, I was hoping someone may be able to guide me towards a simple routine to help obtain these solutions.

Once again, thanks for taking the time to read this.

 

Dear Maple Users, 

 

First of all I would like to thank for your great support and hints on making a package for Maple. It has made possible for me to construct this package here: 

 

restart; 
MyMat:=module()
description "My Package";
option package; 
export RegModelPlot,RegModel;
RegModelPlot :=proc(c::algebraic,xd::list,yd::list,x::algebraic)
    uses Statistics, plots:
     display
                            (  [ plot
                                 ( Fit(c, xd, yd, x),
                                   x=min(xd)..max(xd),
                                   color=blue,gridlines,
                                   title=typeset("Regressionformula\n f(x) = ", evalf[4](Fit(c, xd, yd, x))),caption=typeset("Residuals = ", Fit(c, xd, yd, x, output = residuals) ))                    
                                 ,
                            
                                 plot
                                 ( xd, yd,
                                   style=point,
                                   symbol=solidcircle,
                                   symbolsize=10,
                                   color=red
                                 )
                               ],
                               size=[800,600]
                            );
                           
                           end proc; 

    RegModel:=proc(c::algebraic,xd::list,yd::list,x::algebraic)
            uses Statistics, plots:
return  Fit(c, xd, yd, x);
end proc; 
    end module

 

My question is now. How do I make it installable ? Meaning, making it so I can be accessed using with the with() argument alene? I have tried to convert it to into an MLA-file and place it in the lib folder. 
 

But if I type with(MyMat) it gives me the error: 

Error, invalid input: with expects its 1st argument, pname, to be of type {`module`, package}, but received MyMat 
 

So anyone with an idea/hint on what I need to add to make the package installable? 

 

Thanks in advance :)

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

 

First 496 497 498 499 500 501 502 Last Page 498 of 2097