Doug Meade

 

Doug

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

MaplePrimes Activity


These are replies submitted by Doug Meade

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

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

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

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

Sales := (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.000000000

Tsales := 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.

As you provide more information, we can provide additional pointers about how to reach your goals for this project.

Doug

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

Sales := (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.000000000

Tsales := 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.

As you provide more information, we can provide additional pointers about how to reach your goals for this project.

Doug

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

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

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)] );

I hope this is helpful,

Doug

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

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)] );

I hope this is helpful,

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
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

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.edu
Phone: (803) 777-6183 URL: http://www.math.sc.edu

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.edu
Phone: (803) 777-6183 URL: http://www.math.sc.edu

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.edu
Phone: (803) 777-6183 URL: http://www.math.sc.edu

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

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

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

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

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

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu
5 6 7 8 9 10 11 Last Page 7 of 76