Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I would like to define a fourth-order tensor (3x3x3x3) with zeros, for then defining some non-null terms individually. For that, I'm currently doing:

for it1 from 1 to 3 do
    for it2 from 1 to 3 do
        for it3 from 1 to 3 do
            for it4 from 1 to 3 do
                H[it1,it2,it3,it4]:= 0;
            end do:
        end do:
    end do:
end do:

H[1,1,1,1]:= value1:
H[1,2,2,1]:= value2:
# etc.

 

However, I suppose there is probably a more efficient manner to do do, maybe using Physics package. Does anyone know to do that?

Hello,

I have a very simple problem. When Maple displays long outputs I can only see a part of them. Here there is an example

https://www.dropbox.com/s/ymp1vdsg80ewu1s/Untitled.jpeg?dl=0

On my previous versions of Maple I had a slider on the bottom of the page. How can I activate it in Maple 2016?

Thanks, Nicola

Aleksandrov Denis,
7th grade
secondary school #57 of Kazan

_ANIMATED_PICTURE_ON_THE_COORDINATE_PLANE_Aleksandrov_D..mw

 

Why does Maple dsolve give this strange error from dsolve? I do not see that the input is wrong

restart;
F := x * ( y(x) + x*sqrt(x*y(x)) + sqrt(x^3*y(x)) );
ode:= diff(y(x),x) = F;
dsolve(ode,y(x));

I do not see where the input is invalid. I stared at it for 5 minutes.

Mathematica can solve this as follows

ode = y'[x] == x ( y[x] + x Sqrt[x y[x]] + Sqrt[x^3 y[x]]  )
DSolve[ode, y[x], x]

Did I type something wrong in Maple?

Physics:-Version();
    2018, June 12, 1:40 hours, MapleCloud version: 60

 

 

I want z  to becomes abs(z) then later on, remove abs() and obtain z back in the same form it was.

I found that Maple changes z when I put it inside abs. Like this

expr:=(-y^2+1);
abs(expr);
op(1,%);

So instead of 1-y^2, I end up now with  y^2-1. I want to keep the same expression I started with.

Mathematica does not do this:

expr = 1 - y^2
Abs[expr]
%[[1]]

Is there a way or option to tell Maple not change the expression when I put it inside abs()?

This complicates what I am trying to do in Maple.

thank you

Hello,

I've tried many combinations of assume(), simplify(), expand(), and evalc(), and I simply can't figure out how to make Maple evaluate my symbolic expression as a purely real valued expression. I know that my expression must be able to be expressed solely in real-valued terms since any number times its complex conjugate is real-valued. What function do I use to accomplish this? Thanks for your consideration. I've attached the code in question below.

Ian

testing_real_simplification.mw

restart;
v := 6000;

# Define the Fresnel reflection coefficient, rp
eta0 := 4; eta1 := n1+I*kappa1;
theta0 := (1/180)*ang*Pi; theta1 := arcsin(eta0*sin(theta0)/eta1);
xi0 := eta0*cos(theta0); xi1 := eta1*cos(theta1);
rp := (-eta0^2*xi1+eta1^2*xi0)/(eta0^2*xi1+eta1^2*xi0);

# Define the complex conjugate of the Fresnel reflection coefficient, rpCon
eta1Con := evalc(conjugate(eta1));
theta1Con := arcsin(eta0*sin(theta0)/eta1Con);
xi1Con := eta1Con*cos(theta1Con);
rpCon := (-eta0^2*xi1Con+eta1Con^2*xi0)/(eta0^2*xi1Con+eta1Con^2*xi0);

# Take the product of rp and its complex conjugate, rpCon. This should necessarily evaluate to a real-valued quantity.
prod := evalc(rp*rpCon);

Hello, i am a student from Germany and have a question:

for a  written paper in microeconomics I have to draw an "Edgeworth Diagram" in Maple, so I have to display two functions ( indifference curves) in one box, which has two x axis and two y axis. All axis have to be positive and in one box. Maybe you can imagine one standard graph with x and y axis as a half of a cube, which gets completed by an other x and y axis with negative values (in our imagination, later the negative values should be transformed into positive values). All in all I have to build up a box with two complete coordinate systems. I mean that a need a plot with two different x axis and two different y axis. I read about but the possibility to define lines through the plottools package, but I really dont know.

Maybe one of you has an idea, which would be fantastic. If you cant follow my bad description, maybe its better to google "edgeworth diagram". 

Thank you all !

Hello.

I wrote a simple code for the plot of the function:

restart;
Omega := 2*Pi*N; R0 := a*tanh((a^2-mu)/(2*T_c))*ln((2*a^2+2*a*q+q^2-2*mu-I*Omega)/(2*a^2-2*a*q+q^2-2*mu-I*Omega))/q-2;                      
T_c := 0.169064e-1; mu := .869262; N := 10;
R1 := int(R0, a = 0.1e-3 .. 100);    
R2 := evalf(abs(R1));
plot(R2, q = 0.1e-2 .. 10);

If the parameter N is not equal to zero then after near one hour calculations I got the desired plot. But for N=0 I have an error

Error, (in signum) too many levels of recursion

I searched this error on this site but I can't find anything relevant for this problem.

Thank you in advance for the help.

 

What is the correct idiom in Maple to do subexpression replacement?

Suppose I want to replace each occurance of ln(anything) by ln(abs(anything)) in an expression.

Currently I call indets and then loop over each entry and use patmatch to do the replacement.

Is there a better method than what I doing now? Here is an example

restart;
expr := 7*ln(arcsin(x))-(1/2)*ln(x-1)*sin(x)-(1/2)*ln(x+1)+f;
lis:=indets(expr):
for z in lis do
    a:='a';b:='b';c:='c';
    if patmatch(z,a::anything*ln(b::anything)*c::anything,'la') then
       map(z0->assign(z0),la);
       expr:=subs(z = a*ln(abs(b))*c, expr);
    fi;
od:
expr;

I do not know if this will fails on some other cases yet.


 

restart

Digits := 4

"phi(x):=16*x^(2)*(1-x)^(2):"

``

a1 := int((diff(phi(x), x, x, x, x))*phi(x), x = 0 .. L)

(6144/5)*L^5-3072*L^4+2048*L^3

(1)

``

a3 := int(phi(x)*phi(x), x = 0 .. L)

(256/9)*L^9-128*L^8+(1536/7)*L^7-(512/3)*L^6+(256/5)*L^5

(2)

``

lambda := 0.170e-1

0.170e-1

(3)

B := 0.223e11

0.223e11

(4)

A := 0.346e11

0.346e11

(5)

k[n] := W*(4*R*G*L^2+pi^2*(2*n-1)^2)/(C*(pi^2*(2*n-1)^2+4*R*L^2*(G+W)))

W*(4*R*G*L^2+pi^2*(2*n-1)^2)/(C*(pi^2*(2*n-1)^2+4*R*L^2*(G+W)))

(6)

b[n] := 4*pi*(2*n-1)/(4*R*G*L^2+pi^2*(2*n-1)^2)

4*pi*(2*n-1)/(4*R*G*L^2+pi^2*(2*n-1)^2)

(7)

U := Heaviside(t)

Heaviside(t)

(8)

w := 1

1

(9)

L := 3.5

3.5

(10)

Ra := 9

9

(11)

Rb := 5

5

(12)

W := 1

1

(13)

G := 0.5e-3

0.5e-3

(14)

R := Ra+Rb

14

(15)

C := 0.2e-1

0.2e-1

(16)

h := 0.250e-1

0.250e-1

(17)

nu := .22

.22

(18)

I1 := (1/3)*w*h^3

0.5207e-5

(19)

E[0] := A+B

0.569e11

(20)

nu1 := (1-nu)/((1+nu)*(1-2*nu))

1.142

(21)

"beta(x,t):=1/(w*h)(W(∑)(-(Pi^(3)*b[n]*(2*n-1)^(3))/(k[n]*8*L^(3))*cos(((2*n-1)*Pi)/(2*L)*x)*(exp(-k[n]*t)))+(R*G*(R*G)^(0.5)*sinh((R*G)^(0.5)*(x-L)))/(cosh((R*G)^(0.5)*L))*t+C*U*(R*G*(R*G)^(0.5)*sinh((R*G)^(0.5)*(x-L)))/(cosh((R*G)^(0.5)*L)))*exp(-W/(C)*t)"

proc (x, t) options operator, arrow; (W*(sum(-(1/8)*Pi^3*b[n]*(2*n-1)^3*cos((1/2)*(2*n-1)*Pi*x/L)*exp(-k[n]*t)/(k[n]*L^3), n = 1 .. 8))+R*G*(R*G)^.5*sinh((R*G)^.5*(x-L))*t/cosh((R*G)^.5*L)+C*U*R*G*(R*G)^.5*sinh((R*G)^.5*(x-L))/cosh((R*G)^.5*L))*exp(-W*t/C)/(w*h) end proc

(22)

eq := -nu1*I1*a1*((1/2)*E[0]*q(t)+B*lambda*(int(exp(-lambda*(t-s))*q(s), s = 0 .. t)))+2*w*h^2*beta(x, t)

-0.4603e11*q(t)-0.6134e9*(int(exp(-0.170e-1*t+0.170e-1*s)*q(s), s = 0 .. t))+0.5000e-1*(-0.7235e-2*pi*(pi^2+686.)*cos(.4488*x)*exp(-50.*(.3430+pi^2)*t/(pi^2+686.))/(.3430+pi^2)^2-.5860*pi*(9.*pi^2+686.)*cos(1.346*x)*exp(-50.*(.3430+9.*pi^2)*t/(9.*pi^2+686.))/(.3430+9.*pi^2)^2-4.522*pi*(25.*pi^2+686.)*cos(2.244*x)*exp(-50.*(.3430+25.*pi^2)*t/(25.*pi^2+686.))/(.3430+25.*pi^2)^2-17.37*pi*(49.*pi^2+686.)*cos(3.142*x)*exp(-50.*(.3430+49.*pi^2)*t/(49.*pi^2+686.))/(.3430+49.*pi^2)^2-47.47*pi*(81.*pi^2+686.)*cos(4.039*x)*exp(-50.*(.3430+81.*pi^2)*t/(81.*pi^2+686.))/(.3430+81.*pi^2)^2-105.9*pi*(121.*pi^2+686.)*cos(4.937*x)*exp(-50.*(.3430+121.*pi^2)*t/(121.*pi^2+686.))/(.3430+121.*pi^2)^2-206.6*pi*(169.*pi^2+686.)*cos(5.834*x)*exp(-50.*(.3430+169.*pi^2)*t/(169.*pi^2+686.))/(.3430+169.*pi^2)^2-366.3*pi*(225.*pi^2+686.)*cos(6.732*x)*exp(-50.*(.3430+225.*pi^2)*t/(225.*pi^2+686.))/(.3430+225.*pi^2)^2+0.5616e-3*sinh(0.8367e-1*x-.2928)*t+0.1123e-4*Heaviside(t)*sinh(0.8367e-1*x-.2928))*exp(-50.00*t)

(23)

``


 

Download n-h-ie.mwn-h-ie.mw

Why this event dose'nt work ?
S(t) is a state , a parameter
dsolve(...,numeric,events = [[[s(t), a*arcsinh(2/a) < s(t)], halt]]);

Hello everyone,

 

I am currently trying to plot lines from different lists.

I got 3 lists with points and another 3 lists with points (Connect each point from one list with the other), and another list with my x-axis.

 

I tried something like that

(nply in this case is 4)

for i from 1 to nply do

sigma1P1[i] := display(line([grenzeu[i], sigma1unter[i]], [grenzeo[i], sigma1ober[i]])):

sigma2P1[i] := display(line([grenzeu[i], sigma2unter[i]], [grenzeo[i], sigma2ober[i]])): 

tau12P1[i] := display(line([grenzeu[i], tau12unter[i]], [grenzeo[i], tau12ober[i]])):

end do:
plot:-display(sigma1P1,sigma2P1,tau12P1);

The for loop creates 3 tables with 4 line plots, but the plot:-display(sigma1P1,sigma2P1,tau12P1);

gives me this Error message:

Error, `plot` does not evaluate to a module

Have anyone an idea how to get these 3 table with plots in one plots?

Plot_problem.mw

And if yes is it possible to implement this in a EMbedded Plot Window?

 

Many thanks in advance!

 

 

 

Who should be considered an 'expert'? How does one achieve expert status? In this guest MaplePrimes blog post, 'Understanding Maple' author Ian Thompson discusses his view of what makes an expert, his journey of becoming an expert in Maple, and the process of putting together and perfecting this resource for Maple users.

 

In days of 8-bit computers, one would sometimes encounter individuals who knew everything about a particular device or piece of software. Single programmers wrote entire applications or games, and some could debug their work by looking directly at a core dump (a printout of the numbers stored in the computer’s memory). Some even managed to take computers beyond their specifications by exploiting design loopholes that the manufacturers hadn’t foreseen or intended. It would be fair to classify such individuals as ‘experts’.

Fast forward twenty five years, and the picture is far less clear. The complexity of computers and software has grown to such an extent that even relatively small smartphone applications are created by teams of developers, and nobody understands every aspect of a CPU chip, much less an entire PC or tablet. Who now should be classified as an expert? One possibility is that an expert is a person who may sometimes need to look up the details of a rarely used command or feature, but who is never confused or frustrated by the behavior of the system or software in question (except where there is a bug), and never needs help from anyone, except perhaps on rare occasions from its creators.

This rather stringent definition makes me an expert in only two areas of computing: the Fortran programming language, and the mathematical computation system Maple. An argument could be made for the typesetting system LATEX, but whilst this has a large number of expert users, there is also a much smaller group of more exalted experts, who maintain the system and develop new packages and extensions. It would be fair to say that I fall into the first category, but not the second.*

How does one achieve expert status? Some software actively prevents this, by hiding its workings to such an extent that fully understanding its behavior is impossible. Where it is possible to gain expert status, I have experienced two very different routes, both starting during my time as a research student, when it became clear that Fortran and Maple would be useful in my work. There were several parallels. I knew a little about both, having used them for basic tasks as an undergraduate. However, working out why things went wrong and how to fix them was time-consuming and unrewarding, since it often relied on magic recipes obtained from unreliable sources, and in many cases I didn’t really understand why these worked, any more than I understood why my own attempts had not. I realized then that knowing a little was at the root of these problems. Partial knowledge, supplemented by contradictory, outdated and even downright bad advice from websites and well-meaning individuals (some of whom invariably labor under false pretences of their own expert status) is not an efficient way to approach scientific computing. In fact it’s just a recipe for frustration. In the case of Fortran, fixing this turned out to be easy, because there are lots of good books on the subject. Reading one of these eliminated all of my problems with the language at a stroke. I can’t claim that I remembered every command and its syntax, nor do I know them all now. This is hardly surprising — the Fortran Language Standard (a very terse document that sets out everything the language provides) now extends to more than 600 pages. Instead, the book provided a general picture of how things work in Fortran, and showed the right way to go about tackling a problem. This investment in time has since paid itself back hundreds of times over.

The route to expert status in Maple was far more challenging. Its own help pages give a very comprehensive description of individual commands, but they are intended as a reference guide, and if it’s possible to become an expert using these alone, then I never discovered the correct order in which to read them. I found a number of books on Maple in the university library, but most were too basic to be useful, and others focused on particular applications. None seemed likely to give me the general picture — the feel for how things work — that would make Maple into the time-saving resource it was intended to be.

The picture became clearer after I taught Maple to students in three different courses. Nothing encourages learning better than the necessity to teach someone else! Investigating the problems that students experienced gave me new opportunities to properly understand Maple, and eventually the few remaining gaps were filled in by the Programming Guide. This is a complex document, similar in length to the Fortran Language Standard, but with more examples. Personally I would only recommend it to readers with experience of programming language specifications. Students now started to ask how I came to know so much about Maple, and whether there was a book that would teach them the same. Since no such book existed, I decided to write one myself. As the old adage goes, if you want something doing properly, do it yourself. The project soon began to evolve as I tried to set down everything that the majority of Maple users need to know. I’ve always hated books that skirt around important but difficult topics, so where before I might have used a dirty trick to circumnavigate a problem, now I felt compelled to research exactly what was going on, and to try to explain it in a simple, concise way. When the first draft was complete, I approached Cambridge University Press (CUP). The editor arranged for reviews by four anonymous referees**, and by Maplesoft’s own programming team. This led to several major improvements. My colleague, Dr Martyn Hughes, also deserves a mention for his efforts in reading and commenting on four different drafts. Meanwhile, Maplesoft continued to release new editions of their software, and the drafts had to be revised to keep up with these. The cover was created by one of CUP’s designers, with instructions that it should not look too ‘treeish’ — one might be surprised by the number of books that have been written about Maple syrup, and it would be a shame for Understanding Maple to be mixed up with these by potential readers browsing the internet. Then there were the minor details: how wide should the pages be? What font should be used? Should disk be spelled with a ‘c’ or a ‘k’? Could quotes from other sources be used without the threat of legal action over copyright infringement? One rights holder laughably tried to charge $200 for a fragment of text from one of their books. Needless to say, no greenbacks were forthcoming.

The resulting book is concise, with all the key concepts needed to gain an understanding of Maple, alongside numerous examples, packed into a mere 228 pages. It gives new users a solid introduction, and doesn’t avoid difficult topics. It isn’t perfect (in fact I have already started to list revisions that will be made if a second edition is published in the future) but I’ve seen very few problems that can’t be solved with the material it contains. Only time will tell if Understanding Maple will it create new experts. At the very least, I would certainly like to think it will make Maple far easier to grasp, and help new users to avoid some of the traps that caught me out many years ago.

 

Learn more about Understanding Maple, which is published by Cambridge University Press.

Hi everyone, i got problems with animation: how can i avoid the overlapping of designed bodies in a 2D animation? Thanks everyone!

Hello everyone, 

         Anyone with the solutions to the error code "Error, unable to compute coeff" should please help. 

         Attached below is the code.

         Thanking you in anticipations for your prompt response. 

Hpm_1.mw

First 796 797 798 799 800 801 802 Last Page 798 of 2217