Maple 2018 Questions and Posts

These are Posts and Questions associated with the product, Maple 2018

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?

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

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]              ]
                     [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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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@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

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.

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!!!!!!!

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 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

I was trying the solution given in 

https://www.mapleprimes.com/questions/225083-Maple-Command-To-Find-Domain-Of-Function

Which works fine for some functions, but fail for some reason for other functions.

restart;
f:=x*ln(y);
solve(evalc(Im(f)), {x,y});

But fails on 

restart;
f:=sqrt(x)*ln(y);
solve(evalc(Im(f)), {x,y});

Using Maple 2018.1 with Physics 

`2018, July 3, 20:10 hours, version in the MapleCloud: 78, version installed in this computer: 74`

Why this error happen on some functions? Is there a way around it?

One way to workaround it I found, is to use solve for one variable at a time. Now Maple do not give an error

restart;
f:=sqrt(x)*ln(y);
solve(evalc(Im(f)), {x});
solve(evalc(Im(f)), {y});

Strange it failed when using {x,y} at same time on this one, but not on the first one. But the above answer is wrong. For "x", it should be x>=0 and not x=0. If I remove the "y" now it gives correct answer

restart;
f:=sqrt(x)*ln(y);
solve(evalc(Im(f)), {x});

f:=sqrt(x);
solve(evalc(Im(f)), {x});


 

This makes no sense to me.

I am finding too many bugs in Maple making it not useable and having to keep coming with workarounds. 

Maybe it should be tested more thoroughly before release.

how I can dsolve these equations?

thanks.

Boundary conditions are:

u(0) = 0, u(0.1e-2) = 0, w(0) = 0, w(0.1e-2) = 0, (D(w))(0) = 0, (D(w))(0.1e-2) = 0

error masseage:

Error, (in dsolve/numeric/bvp/convertsys) unable to convert to an explicit first-order system
 

error.mw
 

dsys3 := {1.857142857*10^11*(diff(u(x), x, x)), 1.547619048*10^10*(diff(w(x), x, x, x))-1.300000000*10^11*(diff(w(x), x)), -1.300000000*10^11*(diff(w(x), x, x))+3.541600000*10^(-13)*(1.082793750-81250.00*w(x))/(1.019000000*10^(-6)-w(x))^2+1.040549102*10^(-32)/(1.019000000*10^(-6)-w(x))^4-2.124960000*10^(-15)*(1.082793750-81250.00*w(x))*(diff(w(x), x))^2/(1.019000000*10^(-6)-w(x))^4+1.151020000*10^(-10)*(diff(w(x), x))^2/(1.019000000*10^(-6)-w(x))^3-7.083200000*10^(-16)*(1.082793750-81250.00*w(x))*(diff(w(x), x, x))/(1.019000000*10^(-6)-w(x))^3+2.877550000*10^(-11)*(diff(w(x), x, x))/(1.019000000*10^(-6)-w(x))^2-2.081098205*10^(-34)*(diff(w(x), x))^2/(1.019000000*10^(-6)-w(x))^6-4.162196410*10^(-35)*(diff(w(x), x, x))/(1.019000000*10^(-6)-w(x))^5, u(0) = 0, u(0.1e-2) = 0, w(0) = 0, w(0.1e-2) = 0, (D(w))(0) = 0, (D(w))(0.1e-2) = 0, ((D@@2)(w))(0) = 0, ((D@@2)(w))(0.1e-2) = 0}; dsol5 := dsolve(dsys3, numeric, abserr = 0.1e-1, output = array([.5]))

Error, (in dsolve/numeric/bvp/convertsys) unable to convert to an explicit first-order system

 

``

 

Download error.mw

 

is there a way to have output left justified, instead of centered?

in other words, i want this:

 

4-1

3

 

not the normal

4-1

                                                                 3

 

thanks

 

When I run a proc, I get an error

Error, (in SolveTools:-Inequality:-Piecewise) piecewise takes at least 2 parameters


But when I do restart; and then run the same command where the error was generated from inside the proc, but outside the proc, I get no error.

So I did not understand why it fails inside the proc, as I am typing the same exact command.

It turned out that an internal symbol _Z1 must have got messed up due to earlier calls made in the proc. It seems to have assumptions on it. To show this, here is screen shot. Only when I cleared the assumptions on _Z1, did it work. I do not use _Z1 any where in my code. This came back from a Maple call.

 

 

Now to proof this:

restart;
assume(_Z1::integer);
solve({x <> (  (1/2)*Pi+_Z1*Pi ), x < infinity, -infinity < x},{x})

 

I never set _Z1 myself in my code. This was done by Maple internally somewhere and caused this error. In my proc, I made call to singular and to solve only. And noticed this problem. 

What should I do to avoid this problem? Why Maple fails above when its own _Z1 symbol is assumed integer? Is this a bug?


As a workaround for now, I could do this

_Z1:='_Z1'; #when I clear this, the error goes away. Why?
sol:=solve({x <> (1/2)*Pi+_Z1*Pi, x < infinity, -infinity < x},{x}):
simplify(sol) assuming _Z1::integer;

ofcourse,  I do not know that Maple will use _Z1 all the time, since I have to hardcode this in the code for now to pass through this problem. So this is a temp. solution for me.


 

 

 

 

This is a new question came up from a follow up to https://www.mapleprimes.com/questions/225083-Maple-Command-To-Find-Domain-Of-Function

Does Maple have support for removing points from an interval automatically? An example will make this clear. This is all on the real line. No complex domain.

Given one interval,. say real_domain :=  x>-infinity and x<infinity: and now I want to remove from this interval, another interval. This second interval can be defined as single point(s) or as interval(s) itself. 

I will give an example of both.

when the singularity interval to remove is defined as one or more single points, here is an example using one point:

real_domain :=  x>-infinity and x<infinity:
singlarity_pt := 1/2:

So I want Maple to give me automatically the new interval as   {x>-infinity and x<1/2} , {x>1/2 and x<infinity}:

Becuase the singularity point was "removed" from the real domain. I tried solve, but it did not work

solve(x<>singlarity_pt and real_domain,{x})
                         

I know I could probably code this by hand, and add logic to figure it if the singularities are points. But this can get complicated if the real domain itself has many sub intervals itself. I thought Maple should be able to do this. fyi, In Mathematica, this is done as follows

singularity = 1/2;
realDomain = -Infinity < x < Infinity;
Reduce[x != singularity && realDomain , x, Reals]

Here is second example where now the singulartiy interval to remove, is not single point, but an interval itself. I found that in this case, solve did the right thing

real_domain :=  x>-infinity and x<infinity:
singlarity_domain := x>-1/2 and x<1/2:

Now the final domain should be   -infinity<x<-1/2 , 1/2<x<infinity, 

solve( not(singlarity_domain) and real_domain,{x})

The question is, why it worked when the singulaity is an interval, but it did not work when it is a specific point? And how can one make it work for single points? Is there a different command to use other than solve for this?

In general, singularities can contain single points and also intervals, but single points is more commin. So I need it to work for both cases.

This has to be done non-interactivally and without plotting or such, as it will be part of a script. 

Thanks for any hints

 

int(int(x,y^4..16),y=0..2);


yields the output $\int_0^2\int_{y^4}^{16} x(x) dx dy$.

 

I can't final an equivalent to Mathematica's Flatten for sets. I know Maple has ListTools:-Flatten for lists.   

For example, given set r:={a,{b,c},d,{e,f,{g,h}}}; How to convert it to  {a,b,c,d,e,f,g,h}; 

does one have to convert each set and all the inner sets to lists, then apply ListTools:-Flatten to the result? How to map convert(z,list) for all levels?

     map(z->convert(z,list),r);

does not work, since it only maps at top level, giving {[a], [d], [b, c], [e, f, {g, h}]}

So doing

   ListTools:-Flatten(convert(map(z->convert(z,list),r),list));

Gives [a, d, b, c, e, f, {g, h}] 

 

     

In attempting to store procedures in a table to create an extensible module, I used the following procedure to test whether a procedure could be queried from the table and executed.

proc() print("Metric is default") end proc;

The result was proc () print("Metric is default") end proc

I have checked the statement with mint in the code editor, but it reports no errors. I get the same result when I use an eval statement around the procedure.  I would be very interested in understanding what is wrong with the procedure as defined.

 


 

I can't figure out why this pattern is failing

restart;
r:= y=3;
patmatch(r,y=z::integer,'la');
patmatch(r,identical(y)=z::integer,'la');
patmatch(r,y::anything=z::anything,'la');

What Am I doing wrong?

 

 

First 50 51 52 53 54 55 56 Last Page 52 of 62