Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I am currently trying to evaluate the performance of different methods for the same calculation and use codegen:cost to give me an overview on the rough computational effort for the results. I stumbled over the function counts not matching my own count in the optimized Matlab code generated by Maple.

Minimal example:

with(codegen):
Fcn1 := sqrt(a):
cost(Fcn1);
Fcn2 := sqrt(sin(q)):
cost(Fcn2);

The first expression gives me "2*functions+multiplications", the second one "3*functions+multiplications".

So my question: Does anyone know, why the square root is counted as two functions while the sine is counted correctly as one?

Good day everyone,

I am trying to write a finite difference Method solution for an ODE and its giving me problem solving the algebraic simplifications generated. Please, any one with useful informations. Below is the attached file

FDM1.mw
 

restart

with(ODETools)

with(student)

with(plots)

with(plottools)

xmin := 0; xmax := 6

n := 60

`σ__1` := .5

ode:=diff(f(eta),eta$3)+f(eta)*diff(f(eta),eta$2)=0

diff(diff(diff(f(eta), eta), eta), eta)+f(eta)*(diff(diff(f(eta), eta), eta)) = 0

(1)

bc1:=df(xmin)=2*sigma__1;

df(0) = 1.0

(2)

bc2:=d2f(xmin)=0;

d2f(0) = 0

(3)

bc3:=d3f(xmax)=2;

d3f(6) = 2

(4)

dfde:=proc(h)(f[k+1]-f[k-1])/2/h;end proc:

dfde(h);

(1/2)*(f[k+1]-f[k-1])/h

(5)

d2fde2:=proc(h)(f[k+1]-2*f[k]+f[k-1])/h^2;end proc:

d2fde2(h);

(f[k+1]-2*f[k]+f[k-1])/h^2

(6)

d3fde3:=proc(h)(f[k+1]-3*f[k]+3*f[k-1]-f[k-2])/h^3;end proc:

d3fde3(h);

(f[k+1]-3*f[k]+3*f[k-1]-f[k-2])/h^3

(7)

d2fde2f:=proc(h)(f[k+2]-2*f[k+1]+f[k])/h^2;end proc:

d2fde2f(h);

(f[k+2]-2*f[k+1]+f[k])/h^2

(8)

d2fde2b:=proc(h)(f[k]-2*f[k-1]+f[k-2])/h^2;end proc:

d2fde2b(h);

(f[k]-2*f[k-1]+f[k-2])/h^2

(9)

 

dfdef:=proc(h)(f[k+1]-f[k])/h;end proc:

dfdef(h);

(f[k+1]-f[k])/h

(10)

h:=xmax/(n-1)

6/59

(11)

stencil:=subs(diff(f(eta),eta$3)=d3fde3(h),f(eta)=f[k],diff(f(eta),eta$2)=d2fde2,ode);

(205379/216)*f[k+1]-(205379/72)*f[k]+(205379/72)*f[k-1]-(205379/216)*f[k-2]+f[k]*(diff(diff(f[k], eta), eta)) = 0

(12)

bcEqs:=[subs(k=0,dfdef(h))=rhs(bc1),subs(k=0,d2fde2f(h))=rhs(bc2),
subs(k=n-1,d2fde2b(h))=rhs(bc3)];

[(59/6)*f[1]-(59/6)*f[0] = 1.0, (3481/36)*f[2]-(3481/18)*f[1]+(3481/36)*f[0] = 0, (3481/36)*f[59]-(3481/18)*f[58]+(3481/36)*f[57] = 2]

(13)

eqs:=Vector(n-2):
cnt:=0:

for k from 1 to n-2 do
    cnt:=cnt+1:
    eqs(cnt):=stencil;
end do:

eqs:

eqs := [op(convert(eqs, list)), op(bcEqs)]; vars := [seq(f[k], k = 0 .. n-1)]; map(print, eqs)

(205379/216)*f[2]-(205379/72)*f[1]+(205379/72)*f[0]-(205379/216)*f[-1] = 0

 

(205379/216)*f[3]-(205379/72)*f[2]+(205379/72)*f[1]-(205379/216)*f[0] = 0

 

(205379/216)*f[4]-(205379/72)*f[3]+(205379/72)*f[2]-(205379/216)*f[1] = 0

 

(205379/216)*f[5]-(205379/72)*f[4]+(205379/72)*f[3]-(205379/216)*f[2] = 0

 

(205379/216)*f[6]-(205379/72)*f[5]+(205379/72)*f[4]-(205379/216)*f[3] = 0

 

(205379/216)*f[7]-(205379/72)*f[6]+(205379/72)*f[5]-(205379/216)*f[4] = 0

 

(205379/216)*f[8]-(205379/72)*f[7]+(205379/72)*f[6]-(205379/216)*f[5] = 0

 

(205379/216)*f[9]-(205379/72)*f[8]+(205379/72)*f[7]-(205379/216)*f[6] = 0

 

(205379/216)*f[10]-(205379/72)*f[9]+(205379/72)*f[8]-(205379/216)*f[7] = 0

 

(205379/216)*f[11]-(205379/72)*f[10]+(205379/72)*f[9]-(205379/216)*f[8] = 0

 

(205379/216)*f[12]-(205379/72)*f[11]+(205379/72)*f[10]-(205379/216)*f[9] = 0

 

(205379/216)*f[13]-(205379/72)*f[12]+(205379/72)*f[11]-(205379/216)*f[10] = 0

 

(205379/216)*f[14]-(205379/72)*f[13]+(205379/72)*f[12]-(205379/216)*f[11] = 0

 

(205379/216)*f[15]-(205379/72)*f[14]+(205379/72)*f[13]-(205379/216)*f[12] = 0

 

(205379/216)*f[16]-(205379/72)*f[15]+(205379/72)*f[14]-(205379/216)*f[13] = 0

 

(205379/216)*f[17]-(205379/72)*f[16]+(205379/72)*f[15]-(205379/216)*f[14] = 0

 

(205379/216)*f[18]-(205379/72)*f[17]+(205379/72)*f[16]-(205379/216)*f[15] = 0

 

(205379/216)*f[19]-(205379/72)*f[18]+(205379/72)*f[17]-(205379/216)*f[16] = 0

 

(205379/216)*f[20]-(205379/72)*f[19]+(205379/72)*f[18]-(205379/216)*f[17] = 0

 

(205379/216)*f[21]-(205379/72)*f[20]+(205379/72)*f[19]-(205379/216)*f[18] = 0

 

(205379/216)*f[22]-(205379/72)*f[21]+(205379/72)*f[20]-(205379/216)*f[19] = 0

 

(205379/216)*f[23]-(205379/72)*f[22]+(205379/72)*f[21]-(205379/216)*f[20] = 0

 

(205379/216)*f[24]-(205379/72)*f[23]+(205379/72)*f[22]-(205379/216)*f[21] = 0

 

(205379/216)*f[25]-(205379/72)*f[24]+(205379/72)*f[23]-(205379/216)*f[22] = 0

 

(205379/216)*f[26]-(205379/72)*f[25]+(205379/72)*f[24]-(205379/216)*f[23] = 0

 

(205379/216)*f[27]-(205379/72)*f[26]+(205379/72)*f[25]-(205379/216)*f[24] = 0

 

(205379/216)*f[28]-(205379/72)*f[27]+(205379/72)*f[26]-(205379/216)*f[25] = 0

 

(205379/216)*f[29]-(205379/72)*f[28]+(205379/72)*f[27]-(205379/216)*f[26] = 0

 

(205379/216)*f[30]-(205379/72)*f[29]+(205379/72)*f[28]-(205379/216)*f[27] = 0

 

(205379/216)*f[31]-(205379/72)*f[30]+(205379/72)*f[29]-(205379/216)*f[28] = 0

 

(205379/216)*f[32]-(205379/72)*f[31]+(205379/72)*f[30]-(205379/216)*f[29] = 0

 

(205379/216)*f[33]-(205379/72)*f[32]+(205379/72)*f[31]-(205379/216)*f[30] = 0

 

(205379/216)*f[34]-(205379/72)*f[33]+(205379/72)*f[32]-(205379/216)*f[31] = 0

 

(205379/216)*f[35]-(205379/72)*f[34]+(205379/72)*f[33]-(205379/216)*f[32] = 0

 

(205379/216)*f[36]-(205379/72)*f[35]+(205379/72)*f[34]-(205379/216)*f[33] = 0

 

(205379/216)*f[37]-(205379/72)*f[36]+(205379/72)*f[35]-(205379/216)*f[34] = 0

 

(205379/216)*f[38]-(205379/72)*f[37]+(205379/72)*f[36]-(205379/216)*f[35] = 0

 

(205379/216)*f[39]-(205379/72)*f[38]+(205379/72)*f[37]-(205379/216)*f[36] = 0

 

(205379/216)*f[40]-(205379/72)*f[39]+(205379/72)*f[38]-(205379/216)*f[37] = 0

 

(205379/216)*f[41]-(205379/72)*f[40]+(205379/72)*f[39]-(205379/216)*f[38] = 0

 

(205379/216)*f[42]-(205379/72)*f[41]+(205379/72)*f[40]-(205379/216)*f[39] = 0

 

(205379/216)*f[43]-(205379/72)*f[42]+(205379/72)*f[41]-(205379/216)*f[40] = 0

 

(205379/216)*f[44]-(205379/72)*f[43]+(205379/72)*f[42]-(205379/216)*f[41] = 0

 

(205379/216)*f[45]-(205379/72)*f[44]+(205379/72)*f[43]-(205379/216)*f[42] = 0

 

(205379/216)*f[46]-(205379/72)*f[45]+(205379/72)*f[44]-(205379/216)*f[43] = 0

 

(205379/216)*f[47]-(205379/72)*f[46]+(205379/72)*f[45]-(205379/216)*f[44] = 0

 

(205379/216)*f[48]-(205379/72)*f[47]+(205379/72)*f[46]-(205379/216)*f[45] = 0

 

(205379/216)*f[49]-(205379/72)*f[48]+(205379/72)*f[47]-(205379/216)*f[46] = 0

 

(205379/216)*f[50]-(205379/72)*f[49]+(205379/72)*f[48]-(205379/216)*f[47] = 0

 

(205379/216)*f[51]-(205379/72)*f[50]+(205379/72)*f[49]-(205379/216)*f[48] = 0

 

(205379/216)*f[52]-(205379/72)*f[51]+(205379/72)*f[50]-(205379/216)*f[49] = 0

 

(205379/216)*f[53]-(205379/72)*f[52]+(205379/72)*f[51]-(205379/216)*f[50] = 0

 

(205379/216)*f[54]-(205379/72)*f[53]+(205379/72)*f[52]-(205379/216)*f[51] = 0

 

(205379/216)*f[55]-(205379/72)*f[54]+(205379/72)*f[53]-(205379/216)*f[52] = 0

 

(205379/216)*f[56]-(205379/72)*f[55]+(205379/72)*f[54]-(205379/216)*f[53] = 0

 

(205379/216)*f[57]-(205379/72)*f[56]+(205379/72)*f[55]-(205379/216)*f[54] = 0

 

(205379/216)*f[58]-(205379/72)*f[57]+(205379/72)*f[56]-(205379/216)*f[55] = 0

 

(205379/216)*f[59]-(205379/72)*f[58]+(205379/72)*f[57]-(205379/216)*f[56] = 0

 

(59/6)*f[1]-(59/6)*f[0] = 1.0

 

(3481/36)*f[2]-(3481/18)*f[1]+(3481/36)*f[0] = 0

 

(3481/36)*f[59]-(3481/18)*f[58]+(3481/36)*f[57] = 2

(14)

sol := fsolve([op(eqs)])

{f[-1] = 74076407.16, f[0] = 74076407.19, f[1] = 74076407.29, f[2] = 74076407.42, f[3] = 74076407.63, f[4] = 74076407.95, f[5] = 74076408.39, f[6] = 74076408.95, f[7] = 74076409.58, f[8] = 74076410.32, f[9] = 74076411.18, f[10] = 74076412.19, f[11] = 74076413.34, f[12] = 74076414.66, f[13] = 74076416.09, f[14] = 74076417.69, f[15] = 74076419.41, f[16] = 74076421.28, f[17] = 74076423.28, f[18] = 74076425.45, f[19] = 74076427.75, f[20] = 74076430.17, f[21] = 74076432.77, f[22] = 74076435.56, f[23] = 74076438.51, f[24] = 74076441.69, f[25] = 74076445.02, f[26] = 74076448.54, f[27] = 74076452.24, f[28] = 74076456.15, f[29] = 74076460.29, f[30] = 74076464.65, f[31] = 74076469.16, f[32] = 74076473.82, f[33] = 74076478.70, f[34] = 74076483.79, f[35] = 74076489.05, f[36] = 74076494.52, f[37] = 74076500.21, f[38] = 74076506.15, f[39] = 74076512.33, f[40] = 74076518.79, f[41] = 74076525.57, f[42] = 74076532.68, f[43] = 74076540.10, f[44] = 74076547.80, f[45] = 74076555.85, f[46] = 74076564.23, f[47] = 74076572.94, f[48] = 74076581.93, f[49] = 74076591.18, f[50] = 74076600.60, f[51] = 74076610.20, f[52] = 74076620.03, f[53] = 74076630.05, f[54] = 74076640.28, f[55] = 74076650.64, f[56] = 74076661.19, f[57] = 74076671.90, f[58] = 74076682.68, f[59] = 74076693.50}

(15)

``


 

Download FDM1.mw

 

Hello,

      I've been using frontend in conjuction with pdsolve to handle a very large system of PDEs; namely the system has many irrelevant functions that can be frozen with frontend, allowing pdsolve to solve it much quicker.

     However, I ran into a strange case, which I've included in the attached file. Namely, for this particular system of equations, the system is a PDE with respect to t, so I freeze functions of x. However, doing so produces incorrect results (labelled bad) compared to the unfrozen case (labelled good). The frontend command is working as expected (this can be verified by uncommenting the frontend/print commands); it seems that pdsolve is treating the frozen and unfrozen cases differently.

     Any idea why this behavior is occuring? (The obvious solution is to simply not use frontend here; again, I'm using this same code for much larger PDEs and frontend speeds up exceution by an order of magnitude).

Thanks!

MWE.txt

I have a system of nonlinear ODE and I solved them numerically using rkf45. the solution is in time domain and the variables are x, y and z.

I want to convert this solution from time domain to frequency domain. I know that I should do FFT, but I do not know how to do this. 

I tried to do this, but I found that I have to get the solution of x, y and z in the form of vector with respect to time. I am not sure if I understant this problem corectly.

Thanks in advance.

A sphere, radius one unit with centre at the origin of the x, y and z axes is cut along the planes x=0, y=0 and z=0 yielding 8 total pieces, none of which are cubes.

For a sphere radius 2, cut along the planes x=2,y=2,z=2, x=-2,y=-2,z=-2, you get  64 pieces of which 8 are cubes.

Derive an expression for the number of  pieces you will get with a sphere radius integer R, cut along the planes x,y,z=1, x,y,z=-1, x,y,z=2,…     x,y,z=R-1, x,y,z=1-R  

How many of those pieces will be cubes?

The question arose from slicing onions!

This is the final installment in a series of three articles outlining new features of Maple's command line (TTY) interface. Today we'll cover improvements to ImageTools:-Preview for use from a terminal.

Character based terminals are not well suited for displaying graphics, although the earliest Maple plotting support was specifically for such devices because better options were not widely available. But for text-based work such as writing code and documentation, many developers still prefer to work in a terminal, where everything is just a keystroke or two away. A problem arises when working on projects involving graphics. Obviously, it's easy to open an appropriate image viewer for such tasks, but for quick previews where details aren't important, a terminal-based solution can be convenient.

As a sample image for the first few examples, we'll use this well known public domain test image, commonly referred to as the baboon, although it is actually a mandrill:

The ImageTools:-Preview function has always been able to render output in a terminal. The output is akin to what one might have seen hanging on a data center wall in the 1970s:

> interface(screenheight=40,screenwidth=72,plotdevice=char):
> with(ImageTools):
> img := Read("../../Pictures/baboon.png");
                     [ 1..512 x 1..512 x 1..3 3-D Array ]
              img := [ Data Type: float[8]              ]
                     [ Storage: rectangular             ]
                     [ Order: C_order                   ]

> Preview(img);
oO*O*o++==**+o+=+-+=*o**=++=+*++++o*++~=o===*****==+===+++--~~=~~~+*
@o*++++~=+~++++++=++**oO*oOOooOOOOOOoo*++ooo*+++====+*++====~~~-==+*
Ooo++===+==+***o*oo***oooOo*++==**==~~=*oO****ooooooooo***++=~~~~~+*
@o*+=+~===*+oOo@@@@@@@@@@@@@@oooOOO*oO@@OOO@@@@@@@@@@@@@o*+===~-=++*
O**==~+=~=+*O@O@@@@@@OO@@O@@@@@@@OOO@@o*o@+=**=+@ooOOOoo+=+==~~~~=++
o++++=-~~~=++*oOO**O@*=**+o@Oo@@@@@@@o*O@@o===+*@+~+o*+++~===~~=~++*
+*++==~~==~=+=++*+=o@@@@@@@@ooo@@@@OO*Ooo@@@@OO*+=*oo*+==~~~~--=~++o
o*+=+~=~~=~~++++*****oo*+**=+O@OOO*o+*oo+++*+=~+*oo**+*+~=~~-~~~~=+=
O*=*=~=~~===~==+****OOOooooOOOO+O*=+*+Oo=~-~~=OOo**+*++=~~~-~-~-~+=+
O+++~~+~=~~+==+o**oo@@*~-----O*=@o++=o@=   -~~=*ooo*o+====~~~~-~~+=+
*o**++===+~=+=*+OOOOo=-~~   -o*=o*=++=o     -~==+oo**o++~~~----~~~++
o*oo*===+==+=*oo*oO=-=-  -  -*=+o+=++=+    -----=**+++*+~~==~-~-=+~*
*o**+*=++=~==~=+**O~- ~     -+=+*+=++==       ~~-~++=+~=~~~~-~~~+==+
ooo*o***+++~+==+oo==-  -    -+=++=+++==      -- -~+=+~~~~~~~=~~===+*
oo*o*==*+=====oooo-~-  -    -==*+==++==         --~*++=~=--~-=====**
*oooo*+*+===++=*@*--~-      ~=+*+==++==         ~--+*==+=~~~-=~+++**
oOOoOo**+*+=+=+O@=- ~-      ~=+*+~~=++~        -- -*o*+====~=+=+*++*
++*ooooOo+**+*OoO~~ -~      ~=+*+-~+++~-      -~  ~ooo+=~=~=+=******
*o+OO@@ooOooO@O@@~=- --     ==++=~~+++~       ~  -+Oo*==++=*+**+***+
*++*ooOOOO@OOO@@@=-=- -     =+++=-~+++~      ~   -*o***++=++*o*oo*oo
~===++**oOOO@@@@@@-~-  -    ~***=- =++-     -   -~oOo**o*oooo***oooo
~~~=~~==+O@@@@@@@@=-=  -  - -++*=-~=++     --   ~+@OO*******o**o*OOO
=~-~-=+oO@@@@@@@@@*~--  -    =+*+==+*~  -  -   -~O@@o*ooo*ooooooooOO
----~==+o@@@@@@@@@o+-~  -  - ~**+=++*- -  -- ---=@@@OO**oooooo*ooooo
-~~~~=+**o@@@@@@@@@+~~~-=- --=**+==++- ~  + -~~~*OOOOoo*ooooo***oOOO
---~====*@@@@@@@@@@O+~+=~= -~+*++=+++-~- =+~~~++*oOOOOoooooooo**oooo
---~--~=O@@O@@O**oOO++*+~+--++++==+++=~ -+~~=*=***oOoOoooOOOoooooo*o
-    --+**oo+===*Oooo**+~=++++++==++++=~~~~+++o*+**oOo****oOOoooo*o*
      ~++oO+-~~~+@Oo***+====+++===+++=====+=+++******++**++*oOooo***
-     ~+***=~~--=ooo**+++oo*~~~~~~~~~+*+===+++=***+++*+++****oo***++
      -=***=~---~+oOo*+++==*o=+=~==+*+===+++**+***+**+=====+oo**+++=
   - --~**===~~-~~=*O*++===++*+===+==+++++++******o**=~~~===+**++++=
 -   --~+====- --~~=+*+++++++++==++==++++++++*****~=+=~~---=+**++===
-    --~======~~-~~ -===+++++**=++++++++++++=+++~=~~+=-----~=***+===
   -----~~+=*=~-~-~+- --~=++++++++++++++++=+-~- +=++~--~~-~==++*+===
-----~-~======~~-~~~~--   ~~~~~~==~===~=~~- --=~=o=~~~~~~~=++++++=++
~~--~--~~~==+++==~-- ~=-~--~~=~~~---~-~~-~-~~=+*=+=~~~-===++***+++=+
-~~~~~~~~~==++=++=--    -~~=++++===+=~==+==~**=+=~==~~=+*++****+++++
~~=~~~~~~~==++***+=--     --~=====++=~===+~~+~--~~~=++++****o*+****o
=====~~~~===+***oo*+-        - --------  --     -~=++*o*ooooo*+*oooO

If you squint really hard, you can almost discern the image. As of Maple 2018.1, ImageTools:-Preview now uses color output if interface(ansi) is set to true and interface(plotdevice) is set to colorchar:

> interface(plotdevice=colorchar):
> Preview(img);
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@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@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

In addition to providing quick previews of image files, this feature can also be used to get more information about plots. For example, consider the following 3D plot generated using Maple's color character plot driver:

> plot3d([1,x,y],x=0..2*Pi,y=0..2*Pi,coords=toroidal(10));

                                                                        
                              ------------                              
                        ----------||-|----------                        
                     --------\-\\-||-|-//-/--------                     
                   ---------\\\\\|||-||/-///---------                   
                 --/-//-----\\\\||||-|||/////---\\\-\--                 
                -/-//-//-/-\\\\\||||||||//-/--\\\\-\\---                
               --|-||-||-|--\\\\||||||||////--|/||-||-|--               
              /--|-\-\-\\---\\\||||||||||///-////-/-/-|--\              
             //-----\------\\\\\||||||||////-------/-----\              
             //////--/--------\||||||||||/--------\--\\\\\\             
            /////// //// /-/--/-/-|-|||\-\--\-\ \\\\ \-\\\\\            
            |/////-////-/-//-/-/-|--|-|-\-\-\\-\-\\\\-\ \\\|            
            |//|////-/-// / /--|-|--|-|-|--\ \\-\-\ \\\\|\\|            
            ||| |-/-/  |-/--|-|--|  | | -|-|--\-|| \-\-| |||            
            |||-||| /-|--| |  | -|--|-|- |  | |--|-\ ||-||||            
            |||| |-|  | |--|--|--|  | |--|--|--| |  |-| ||||            
             |||-| |-||-|  |  |  ---|-|  |  |  |-||-| |-|||             
              ||-|-| | -|--|--|  |  | || |--|--|- | |-|-||/             
              \||| |-|- |  |  ---|--|--|--| |  | -|-| |-|/              
               \-|-| | -|--|-|| |   |  |  | |--|--| |-|//               
                \|||||- |  |-|--|---|--|--|-|  | -|-|||/                
                 \|\|-|-|--|--| |   |  |  |-|--|-|-|-|/                 
                   \\\|-|- |  |--|--|--|-|  | -|-|-//                   
                     --\-\-|--|--|--|-|--|--|-/-/--                     
                        ----\-|--|--|-|--|-/----                        
                              -\-|--|-|-/-                              
                                                                        

The output shows the general shape of the plot, but unless you already know what it looks like, it can be hard to visualize, especially since the character drivers don't support shading. One can glean additional insight by generating a high resolution bitmap version of the plot, and then Preview-ing that:

> interface(plotdevice="bmp",plotoutput="plot.bmp");
                          colorchar, terminal

> plot3d([1,x,y],x=0..2*Pi,y=0..2*Pi,coords=toroidal(10));
# Revert to colorchar or Preview won't generate a textual preview.
> interface(plotdevice="colorchar",plotoutput=terminal);
                             bmp, plot.bmp

> img := Read("plot.bmp");
                     [ 1..360 x 1..480 x 1..3 3-D Array ]
              img := [ Data Type: float[8]              ]
                     [ Storage: rectangular             ]
                     [ Order: C_order                   ]

> Preview(img);
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@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@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

By default, Preview uses the extended xterm 256 color mode. The image is resized to fit within the current settings of interface(screenwidth) and interface(screenheight), and then each pixel is plotted using an "@" character over a colored background. The foreground and background colors are chosen so that their weighted average comes as close as possible to the actual RGB value of the pixel. Since this rarely produces exactly the right color, Preview also performs dithering, taking the error from the current pixel and distributing it over surrounding pixels. In effect, this uses spatial resolution to make up for the lack of color resolution.

ImageTools:-Preview has two keyword options, dither and sixteen, that let you override this behaviour. Passing the option dither=false will tell Preview not to dither. Passing sixteen=true (or just sixteen) will result in Preview using only the sixteen standard colors, of which only eight are used for the background.

The following examples are based on this Maple logo image:

By default, ImageTools:-Preview renders this with 256 colors and dithering as follows:

> img := Read("../../Pictures/logo.png");
                     [ 1..428 x 1..459 x 1..3 3-D Array ]
              img := [ Data Type: float[8]              ]
                     [ Storage: rectangular             ]
                     [ Order: C_order                   ]

> Preview(img);
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@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@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

If we render it without dithering, the result is sharper, but the subtle gradient from lighter to darker blue turns into a series of very obvious concentric rings, as there are not enough distinct colors in the terminal's palette to render it accurately:

> Preview(img,dither=false);
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@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@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

In sixteen color mode, the palette is severely reduced, and as a result, the dithering is much more pronounced as the per-pixel errors are larger:

> Preview(img,sixteen);
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@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@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

One thing to note is that Maple has no way of knowing what the sixteen "standard" colors of your terminal actually look like, since many terminals let you change the palette. Maple assumes you are using the 16-color VGA palette, since that is close to the actual default palette on most terminals. If you are using a different palette (for example, Solarized), 16-color images will look worse than they are shown above.

A := <<1|2|3>,<0|4|5>,<0|0|6>>;

V :=<1,2,3>;

c :=MatrixVektormutiply(A,v);

 

i want to create a vector for example from 0 to 20 by 0.5 step.and use it in my function would you please suggest me a way for do it.

Thanks All!!!!!!!

Dear Users!

Hope you would be fine. I want to construct system of equations by comparing the likes powers of x^i*y^j*t^k1*exp(k2*eta) for an expression H1 present in attached file. Please see the fix my problem. I shall be very thankful for your kind help. 

Help.mw

I would like to use Gröbner's method to study polynomial systems (with equality or (and) inequalities) in the case where the variables are REAL. It is known that in general the problem is much more complicated than in the complex case; in particular it is necessary to use gradient methods.
In Maple, we can use the patch "Raglib" (Lip6 laboratory). However "with (RAG)" does not work very well, even for "simple problems" like this one: the $ 9 $ real unknowns are $ X = [x_ {i, j}] \ in M_3 (\ mathbb {R} $. The  system to satify is $ X ^ TX = I_3, x [1,1] <1 / 2,3 / 10 <x [2,3] $, that is, $6$ polynomial equations and $2$ inequalities; clearly, a particular solution is a permutation of the canonical basis. The "HasRealSolutions" command does not provide any result after 2 hours 15 minutes of calculation. The "PointsPerComponents" command indicates that there are no solutions... 
It seems to me that we can also use "RegularChains" but I am not familiar with this library.

  Have you any ideas on these questions? Thank you in advance.
 

From  time to tiime Malel emits a sort of "Boiing" noise when I make a keyboard error. I am not sure exaclty when it does this, but it is loud. Is it possible to turn it off? I have looked quite extensively and cannot find out anything.

Hi all you out there.

I have an UNSORTED sequence  L of floats with elements in the range [a, b > a].
Let c some number such that c < b.
I want to find the smallest k such that L[k] > c.

This problem is related to the search of the "First Hitting Point" (or "First Passage Time") of a random process.
The attached file provides a notional example.
It contains a procedure named FirstHittingPassage which doesn't satisfies me for it is based on an unsmart  "confusion" between an Array and a list.

Would you have a smarter way to proceed ?

Thanks in advance

FirstHittingTime.mw

 

I need help with writing the code, I have this for part a but I dont think it is correct

   with(Student[Calculus1]);
   Tangent(2/(1+exp(-x)), x = 0, output = plot);
 


(a) Find an equation of the tangent line to the curve
                                 2    
                        y = -----------
                            1 + exp(-x)
 at (0,1). 
(b) Graph the curve and the tangent line on the same axes.
(c) Use animate to show how the tangent line to the curve changes as we move along the curve between x=-5 and x=5.
 

Having trouble with starting off the three ways to complete this question.

Give three ways to plot the unit circle?

Hi everybody,

I'm facing that strange and blocking situation:

I was in a Maple 2018 worksheet "W"   (Windows 7, worksheet mode, not document mode) when, probably from some spurious keys combination, the small vertical bar that materializes the position of the mouse disappeared, rendering any further writting impossible.
In the same Maple session I had a few other worksheets  where the this same bar was still present: so it was not a Windows problem (this bar appeared in Word documents too).

I quitted Maple and ran it again. The result is still the same: among all the worksheet I load, only the worksheet  "W"  does not exhibit the location of the mouse.
This problem still persists after rebooting my working station.

Does anyone have any idea to fix this ?

Thanks in advance

First 782 783 784 785 786 787 788 Last Page 784 of 2217