MaplePrimes Questions

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 was wondering someone could help me with something.

Basically I've got a function of f(x,z) that I have plotted which comes from an integration that was taken over a large number of small steps. I have been able to plot this function to determine a Potential Field as a function of x and z. (No Problems so far)

However the next step that I want to be able to do is compute a field form this potential. apologies for my lack of knowing how to input into here as I am fairly new to this. To do this I have:

Field = - Nabla * Potential 

Again no problem, I can plot a gradient field from it which is great using the gradplot command. I beleive this comes as a result of the following:

gradplot = [diff(f,x), diff(f,z)]

HOWEVER I want to be able to plot a Field Strength plot (In essence a Gradient Field Strength) where it takes the magnitude of the vectors at each point. Firstly am I correct in saying that this should be:

Magnitude Field = |F| = sqrt( Fx^2+Fz^2)      where Fx is diff(f,x) and Fz is diff(f,z)

 

However when I try to compute this, it takes an age to evaluate and doesn't seem to make much progress. I think this may come as a result of computing square roots of large numbers/large decimal places? I was wondering whether there is any command that anyones knows of that would calculate Gradient Field Strength/Magnitude that may solve this issue? Or even who to just compute this Square root?

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

First 624 625 626 627 628 629 630 Last Page 626 of 2427