## 3063 Reputation

19 years, 274 days

Doug

`---------------------------------------------------------------------Douglas B. Meade  <><Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.eduPhone:  (803) 777-6183         URL:    http://www.math.sc.edu`

## convert to array...

I, too, wonder what the original poster is hoping to gain by eliminating the separators in the list. My approach comes back to the basic definitions of a list and other objects in Maple.

A list is a comma-separated collection of objects. So, to remove the commas from the list means that you no longer have a list. What is this new object? A vector or an array. Now, in Maple, vectors and arrays (actually, Vector and Array) are different objects. In general, vectors are used for linear algebra manipulations and arrays are more general.  I don't want to go into all of the details here (you can read the online help for a more complete discussion).

`ANS := [1,a,0,c/a];                          [         c]                          [1, a, 0, -]                          [         a]convert( ANS, array );                          [         c]                          [1  a  0  -]                          [         a]`

I hope this is useful,

Doug

```---------------------------------------------------------------------
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu
```

## Maple Player for Windows, Mac, and Linux...

@frank1234 The Maple Player does exist and is available for Windows, Mac, and Linux. See http://www.maplesoft.com/TeacherResource/aboutthemapleplayer.aspx?c=1&cha=1 .

This is not particularly new, but there is not yet much content for the Maple Player. At present only Maplesoft can create the .mwz files that the Player requires. The Teacher Resource Center on the Maplesoft website is the primary source for Player-ready content.

The comments in Laurent's blog suggest that this might be changing. I just hope "ultimately" is soon. As usual, I am excited by the progress but frustrated at its limitations. Not knowing what's involved in the process of preparing .mwz files, I'm not criticizing Maplesoft for the current state of affairs. Rather I am hoping others might second my encouragement to see continued developments in this direction.

## piecewise and procs...

@hisasugi8338

I am not completely sure what you are trying to do. In particular, I do not understand where you will be getting values of a, b, p, and gamma to know how to compute CM. The following code defines Sales and CM as functions and then the definition of Tsales is almost exactly as you wrote in your last post. (I put the t>0 test first as this should be slightly more efficient as neither Sales nor CM will be computed if t<=0.)

`restart;unprotect( gamma );   # allow use of gamma as a name, not he built-in constantSales := (t,p,gamma) -> (-100+p)*(1-exp((-1)*.11*t))/(-1+gamma)/(10.00000000*exp((-1)*.11*t)+1):CM := (a,b,p,gamma) -> a+b*p/gamma:CM0 := CM(1,1,0.5,0.1);                          6.000000000Tsales := piecewise( t>0 and Sales(t,25,0)<CM(a,b,p,gamma), Sales(t,25,0),                                                                                         Sales(t,50,0.1) ):a,b,p,gamma := 1,1,.5,0.1:plot( Tsales, t=-1..10 );`

Now, if you want to make Tsales a function of t (or t, a, b, p, and gamma), that can be done.

`Tsales2 := unapply( Tsales, t ):plot( Tsales2, -1..10 );`

You could also make a function that takes these parameters and an interval for t and produces the plot as it's value.

Doug

## piecewise and procs...

@hisasugi8338

I am not completely sure what you are trying to do. In particular, I do not understand where you will be getting values of a, b, p, and gamma to know how to compute CM. The following code defines Sales and CM as functions and then the definition of Tsales is almost exactly as you wrote in your last post. (I put the t>0 test first as this should be slightly more efficient as neither Sales nor CM will be computed if t<=0.)

`restart;unprotect( gamma );   # allow use of gamma as a name, not he built-in constantSales := (t,p,gamma) -> (-100+p)*(1-exp((-1)*.11*t))/(-1+gamma)/(10.00000000*exp((-1)*.11*t)+1):CM := (a,b,p,gamma) -> a+b*p/gamma:CM0 := CM(1,1,0.5,0.1);                          6.000000000Tsales := piecewise( t>0 and Sales(t,25,0)<CM(a,b,p,gamma), Sales(t,25,0),                                                                                         Sales(t,50,0.1) ):a,b,p,gamma := 1,1,.5,0.1:plot( Tsales, t=-1..10 );`

Now, if you want to make Tsales a function of t (or t, a, b, p, and gamma), that can be done.

`Tsales2 := unapply( Tsales, t ):plot( Tsales2, -1..10 );`

You could also make a function that takes these parameters and an interval for t and produces the plot as it's value.

Doug

## information on Getting Started with Mapl...

Nice summary. This is helpful as I have thought about teaching a course with some of these elements.

Thank you for the kind words about the book I co-authored with Mike May, C-K Chung, and G. E. Keough: Getting Started with Maple, 3rd ed., Wiley, 2009.

Doug

```---------------------------------------------------------------------
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu
```

## Replace the do-loop with select...

You can replace the loop with a single call to select (or replace). For example:

`ODE := diff(x(t), t)+3*exp(x(t))+(diff(x(t), t))*x(t): POL := eval(ODE, [diff(x(t), t) = a, x(t) = b]);LODE := select( T->evalb( is(T,polynom) and degree(T,a)+degree(T,b)<=1 ), POL );LODE := eval( LODE, [a=diff(x(t),t),b=x(t)] );`

The last two lines can be combined into:

`LODE := eval( select( T->evalb( is(T,polynom) and degree(T,a)+degree(T,b)<=1 ), POL ),              [a=diff(x(t),t),b=x(t)] );`

Doug

```---------------------------------------------------------------------
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu
```

## Replace the do-loop with select...

You can replace the loop with a single call to select (or replace). For example:

`ODE := diff(x(t), t)+3*exp(x(t))+(diff(x(t), t))*x(t): POL := eval(ODE, [diff(x(t), t) = a, x(t) = b]);LODE := select( T->evalb( is(T,polynom) and degree(T,a)+degree(T,b)<=1 ), POL );LODE := eval( LODE, [a=diff(x(t),t),b=x(t)] );`

The last two lines can be combined into:

`LODE := eval( select( T->evalb( is(T,polynom) and degree(T,a)+degree(T,b)<=1 ), POL ),              [a=diff(x(t),t),b=x(t)] );`

Doug

```---------------------------------------------------------------------
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu
```

@Britzel Please attach your worksheet within your response to MaplePrimes. That should make it easier for me to see exactly what you are trying to do.

Doug

@Britzel Please attach your worksheet within your response to MaplePrimes. That should make it easier for me to see exactly what you are trying to do.

Doug

## missing comma...

The syntax error in your plot3d command is a missing comma after the second point:

`plot3d([-2, 0.7], [0.7, 3], orientation = [-90,0], grid = [250,250],          style = patchnogrid, scaling = constrained, colour = mandelbrot);`

But, this won't produce a plot of the Mandlebrot set - or of anything. It's not a valid plot3d command. The first response to your question contains a valid way to produce the plot that you desire.

Doug

`---------------------------------------------------------------------Douglas B. Meade  <><Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.eduPhone:  (803) 777-6183         URL:    http://www.math.sc.edu`

## stiff IVPs...

I concur with Joe Riel.

It's likely you will need to use a different ode solver, or find an alternate formulation of your problem that is not so "stiff".

Along these lines, do you know what makes your system so "stiff" that it needs to use such small timesteps? Is it possible the IVP can be restated in a different form (possibly dimensionless) that would be more computationally feasible?

Without seeing the exact system you are using, it's difficult to say much more.

Doug

`---------------------------------------------------------------------Douglas B. Meade  <><Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.eduPhone:  (803) 777-6183         URL:    http://www.math.sc.edu`

## stiff IVPs...

I concur with Joe Riel.

It's likely you will need to use a different ode solver, or find an alternate formulation of your problem that is not so "stiff".

Along these lines, do you know what makes your system so "stiff" that it needs to use such small timesteps? Is it possible the IVP can be restated in a different form (possibly dimensionless) that would be more computationally feasible?

Without seeing the exact system you are using, it's difficult to say much more.

Doug

`---------------------------------------------------------------------Douglas B. Meade  <><Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.eduPhone:  (803) 777-6183         URL:    http://www.math.sc.edu`

## details?...

Is there a way to find out more about the specific changes that have been made in Maple 14.01?

Are there any examples to illustrate the enhancements or new features?

A list of bugs that have been fixed?

Without anything more than the list of generic changes, this is a huge inverse problem. Just do enough testing until you find differences in the output. This might turn up a few places where something has changed, but is very unlikely to ever find all of the changes.

Doug

```---------------------------------------------------------------------
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu
```

## it works!...

This is what I thought I was trying to do.

When I was putting together my response to tell you how this did not work - it worked!

I don't know what I am now doing differently, but all is now working as it should.

Thanks for your support and patience as I came to this realization.

Doug

```---------------------------------------------------------------------
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu
```

## it works!...

This is what I thought I was trying to do.

When I was putting together my response to tell you how this did not work - it worked!

I don't know what I am now doing differently, but all is now working as it should.

Thanks for your support and patience as I came to this realization.

Doug

```---------------------------------------------------------------------