## 5800 Reputation

16 years, 62 days

## Wait for 2019.3 - 2019.2 flawed - Maples...

Maple 2019

I'm only just hearing (haven't experienced) about some serious issues with the 2019.2 updates.  I would recommend waiting for Maplesoft to release an emergency 2019.3 fix update - Maplesoft can NOT leave the last update of 2019 in this state.

## macro vs. subs...

Maple

macros can be made to work like subs, you just need to know a few tricks to get it to work the same way.  macros just works in a slightly different manner and we can make it useful.

The difference is with subs, one has to keep specifying the substitution with each equation you want subbed, whereas macro will already have it defined.  As an example:

a := v^2*z^3 - 34/(5*x^2*sin(y*v^2)) + 36*v^2 - b*v^2 + 3^(v^2 - cos(v^2 + g))

If we want to substitute h for v^2, then we would normally do this using subs

subs(v^2=h,a)

however, we can also use macro

macro(v^2=h)

now it doesn't just automatically substitute those values so we need to coax maple a little bit.  We can do that by converting the equation to a string and parsing it.

parse(convert(a,string))

so as you see we arrive at the same result.  Now there is a caveat using macro, if you've already defined a variable in a macro, subs will not work using the same variable sustitution - you first need to reset the variable in the macro back to itself.

subs(v^2=h,a)
#doesn't work since the variable is defined in a macro

macro(v^2=v^2) #reset the variable in the macro

subs(v^2=h,a)
# now it works

we could also define a little procedure to simplify our typing, to have the macro variable work on our equation.

mvs:=proc(a) #macro variable substitution
parse(convert(a,string));
end proc:

macro(v^2=h)
mvs(a)

now if we had some other existing equation before defining the macro
aa:=exp(v^2-sin(theta))+v^2*cos(theta)-1/x^sin(v^2-g)

we just have to simply apply our proc on the equation to apply the variable substitution
mvs(aa)

## Dataframes - Looking for a new flashligh...

Maple 2018

Just a simple use of DataFrames.  Looking for a new flashlight, I decided to compile a small selection of flashlights for comparison.

Note:The values for cost used is in Canadian dollars, and the stores for the prices taken were from the following - MEC, Lowes, Canadian Tire and Amazon.ca

 (1)

 (2)

 (3)

 (4)

No surprise that the cheapest and lowest light outputs were incandescent flashlights.  The list isn't very large so lets add a few more flashlights to our list

 (5)

 (6)

 (7)

 (8)

Interesting to note that Police Security generally seems to be the cheapest.

 (9)

 (10)

 (11)

 (12)

Now lets select just the Maglite models

 (13)

Or select the flashlights that have a burn time longer than 100 minutes

 (14)

## Maple 2019 wishlist...

Starting the Maple 2019 wishlist.  Anything in particular users would like to see added or upgraded to maple can add it here.

## World Cup 2018 simulation...

vv if you could please help adjust your code.  I've adjusted the start of the eurocup code to match the world cup however I haven't decoded your coding and probably won't be able to have time before the world cup starts.  I've got as far as adding the teams, flags and ratings of each team.

Let me just say while copying and pasting the flag bytes to the code, Maple became a bitch to work worth (pardon my language) but I became so frustated because my laptop locked up twice.  The more I worked with Maple the slower it got, until it froze right up.  Copying and pasting large data in maple is almost to near IMPOSSIBLE.  .. perhaps this could be a side conversation.

Here's the world cup file so far.

2018_World_Cup.mw