## Bragan's Brainstorm

by: Maple

Attached (sim.mpl) is a simple game simulation with data from last years World Series champion Red Sox. Bump up infolevel to see what's going on during a game (as shown below). In the "Maple Baseball" post I wanted to see if the number of runs our team was scoring was appropriate. Obviously, the rule of thumb, 3-hits = 1 run is poor at best. What I really want to find out is if there is a way to improve our scoring chances. The standard baseball batting-order uses the following heuristic:

• lead off with someone with a high on-base percentage (and who can maybe steal a base)
• next 2 are good contact hitters
• batter 4 is your "clean-up" hitter; someone with power
• etc.

## print dsolve[numeric] result to file?...

Hi, All, I'm a Maple primer. I want to solve an ODE numerically and then save the data to file. I use: dsol := dsolve({deq,ic}, numeric, range=0..100); or dsol := dsolve({deq,ic}, numeric, range=0..100, output=operator); then how can I print the formated data for some specified t (=1..100, for example) to a data file? Thanks. David

## missing symbol...

I need the symbol for the partial derivative (something like @) in a .mws worksheet. Well, I found this feature as an operator on the new .mw platform, but I need it as a symbol. If I write a name (say PartialD) in the worksheet I want to get the symbol similar to @ at the screen.

What can I do?

Florian

## working with tensors in maplet...

I would like to construct a maplet to evaluate different objects in general relativity, say for example , metric,covaliant derivative and so on. Please help me with the procedure or a sample maplet.

## generate code for numerical integral...

Is it possible to generate C or Fortran code for a numerically evaluated integral (ie. evalf(Int(...)) )? with(CodeGeneration): and either C(..) or Fortran(...) yield the error message: Warning, the function names {Int} are not recognized in the target language (a similar error message occurs for an int(..) expression) Alejandro

## An animation of 2 curves

Maple
```f:=sin(t)*x*(1-x);
g:=cos(t)*x*(1-x);
plots[animate](plot,[[f,g],x=0..1],t=0..2*Pi);``` This blog entry was created essentially for a possibility to post pictures in comments (where attachments are not allowed.)

## multiple animations...

A student in my PDE class asked about having two functions in animation at the same time. Here is how I suggested doing this: > f:=(t,x)->sin(t)*x*(1-x); > g:=(t,x)->cos(t)*x*(1-x); > N:=50; > for n from 0 to N do J[n]:=plot([f(2*Pi*n/N,x),g(2*Pi*n/N,x)],x=0..1): od: n:='n': > plots[display]([seq(J[n],n=0..N)],insequence=true); Is there a simpler way? Jim Herod

## Why won't assume and assuming work consistently?...

I am trying to determine when one inequality implies another inequality and I am finding that assume and assuming aren't working consistently for me. I've put the code for my test run below. It seems to work the first time through when I assume mylist, but when I assume mylist it always returns false. If I explicitly test is(x>-4) it returns true as it should but if I ask it to determine is(mylist) (which is x>-4 once mylist is overwritten) it returns false? Is there a reason for this? I'm eventually going to need to put it all into a loop that works for any list--is there a way that will guarantee that it will work consistently?

## Friday test of Maple HTML

by: Maple
OK, in posting a new blog, there is an "Attachment" section... So I could add the three GIFs. They don't show up in the preview, but they did come out when I actually posted...

 > sum((-2)^k, k=1..infinity); > _EnvFormal := true; ## Why Maple 10?

by: Maple
As moderator of the How Do I?? (Newbies) forum, I thought I would post some information for my viewers. As a somewhat "Newbie" to Maple myself, I thought I'd boast about how amazing I think Maple 10 is (and no... this is not just because I work for Maplesoft ;). My first experience using Maple was a year ago, when I started with Maple 9.5. As expected, like any scientific software, there was a learning curve that I had to conquer.

## Why don't these structured types work?...

Why don't these structured types work? > type(Pi, symbol); > evalb(Pi::symbol); > type(Pi, constant); > evalb(Pi::constant); > type(x, symbol); > evalb(x::symbol); > type(x, constant); > evalb(x::constant); > type(Pi, symbol and not constant); > evalb(Pi::(symbol and not constant)); > type(x, symbol and not constant); > evalb(x::(symbol and not constant)); I know we can do it using TypeTools[AddType]( variable, t->evalb(t::symbol and not t::constant) ); but why doesn't the simple version work? Phil

## How to color a region

Maple
Wen-Xiu Ma recently asked in the maple-assist group,
```How to color the following region?
a:=plot([t^2,t^3-1,t=-3..3):
b:=plot([t^3+1,t^2-3,t=-3..3):
c:=plot([t^2+2,t^5-4,t=-3..3):
display([a,b,c],view=[0..5,-3.5..11]);```