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

On the surface it seems correct to be using sum to implement this function. But, it has to be remembered that Maple provides two different ways to work with a sum of terms: sum and add.

sum is for symbolic sums; ones that you expect to be replaced with another expression.

add is for the (numeric) sum of several terms.

In this case, since Maple does not recognize the inner sum as one that it recognizes, you should be using add. Here's how I would do this (with the corrected sums):

restart:
with(plots):
f:=n->add(add((-1)^(k-j)*binomial(k,j)*j^(n), j=1..k ), k=1..n):

As for generating the plot, there's no need to resort to PLOT or POINTS. Here are two ways to use Maple's basic plot command:

plot( [seq([n,f(n)],n=4..10)], style=point );
plot( f, 4..10, numpoints=7, style=point, adaptive=false );

Each creates the same plot as has appeared previously in this thread.

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

In your case it's not difficult to parameterize this curve. The second equation tells us the points x and y are on the circular cylinder x^2+y^2=25. Use polar coordinates to describe the circle (in the x-y plane) and then compute z according to the formula. That is,

x=5*cos(theta)
y=5*sin(theta)
z=25*sin(theta)*cos(theta)

where 0<=theta<=2*Pi .

This curve can be plotted using Maple's spacecurve command:

with(plots):
spacecurve( [5*cos(t),5*sin(t),25*sin(t)*cos(t),t=0..2*Pi], axes=box );

Just another way to attack this problem. Hopefully it's of some use to you, or someone else,

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

In your case it's not difficult to parameterize this curve. The second equation tells us the points x and y are on the circular cylinder x^2+y^2=25. Use polar coordinates to describe the circle (in the x-y plane) and then compute z according to the formula. That is,

x=5*cos(theta)
y=5*sin(theta)
z=25*sin(theta)*cos(theta)

where 0<=theta<=2*Pi .

This curve can be plotted using Maple's spacecurve command:

with(plots):
spacecurve( [5*cos(t),5*sin(t),25*sin(t)*cos(t),t=0..2*Pi], axes=box );

Just another way to attack this problem. Hopefully it's of some use to you, or someone else,

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

The warning says something about being undefined in the interval. At the least, this should get you thinging about where this function is defined.

Let's see, we can't divide by zero and we can't take the square root of a negative number. So, we need 2*x-x^2>0:

solve( 2*x-x^2>0, x );
                         RealRange(Open(0), Open(2))
 

You asked Maple to plot this function for x=0 and for x>=2. Maple can't evaluate this function (as a real-valued function) at any of these points. So, to get Maple to plot your function, try restricting the domain to where the function is defined, say:

plot( 1/sqrt(2*x-x^2), x=0..2 );

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

 

The warning says something about being undefined in the interval. At the least, this should get you thinging about where this function is defined.

Let's see, we can't divide by zero and we can't take the square root of a negative number. So, we need 2*x-x^2>0:

solve( 2*x-x^2>0, x );
                         RealRange(Open(0), Open(2))
 

You asked Maple to plot this function for x=0 and for x>=2. Maple can't evaluate this function (as a real-valued function) at any of these points. So, to get Maple to plot your function, try restricting the domain to where the function is defined, say:

plot( 1/sqrt(2*x-x^2), x=0..2 );

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 say the IVP you are interested in is

IVP := A -> {diff(u(t),t$2)+u(t)=A/(1-u(t))^2, u(0)=1, D(u)(0)=1};

This problem has trouble right from the start, because u(0)=1 (unless A=0). Once you get this worked out, why don't you make use of Maple's dsolve?

U := A -> dsolve( IVP(A), u(t), numeric );

The solution for a specific value of A is now easily obtained:

u1 := U(0.0000);

You can evaluate this at a specific value of x:

u1(0.01);    
 [                                          d                             ]
 [t = 0.01, u(t) = 0.00999983366050915916, --- u(t) = 0.999950000438838304]
 [                                          dt                            ]

or generate a plot:

plots[odeplot]( u1, [t,u(t)], t=0..5 );

To make it easier to create a plot for a specific value of A:

P := A -> plots[odeplot]( U(A), [t,u(t)], t=0..5 );
P(0);
P(0.001);

You can create an animation of these solutions manually by constructing the sequence of frames:

with( plots ):
Frames := seq( odeplot( U(A), [t,u(t)], t=0..5 ), A=-0.002*[$0..4] ):
display( Frames, insequence=true );

or by using the animate command:

animate( odeplot, [U(A), [t,u(t)], t=0..5], A=-0.009..0, frames=10 );

To avoid the singularity with u(0)=1, I tested all of this for the problems with u(0)=0, not u(0)=1.

I will close by noting that the dsolve,numeric now has a more formal approach to specifying parameters (see ?dsolve,numeric,parameters). Unfortunately, my initial experiments with this were not very successful.

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 say the IVP you are interested in is

IVP := A -> {diff(u(t),t$2)+u(t)=A/(1-u(t))^2, u(0)=1, D(u)(0)=1};

This problem has trouble right from the start, because u(0)=1 (unless A=0). Once you get this worked out, why don't you make use of Maple's dsolve?

U := A -> dsolve( IVP(A), u(t), numeric );

The solution for a specific value of A is now easily obtained:

u1 := U(0.0000);

You can evaluate this at a specific value of x:

u1(0.01);    
 [                                          d                             ]
 [t = 0.01, u(t) = 0.00999983366050915916, --- u(t) = 0.999950000438838304]
 [                                          dt                            ]

or generate a plot:

plots[odeplot]( u1, [t,u(t)], t=0..5 );

To make it easier to create a plot for a specific value of A:

P := A -> plots[odeplot]( U(A), [t,u(t)], t=0..5 );
P(0);
P(0.001);

You can create an animation of these solutions manually by constructing the sequence of frames:

with( plots ):
Frames := seq( odeplot( U(A), [t,u(t)], t=0..5 ), A=-0.002*[$0..4] ):
display( Frames, insequence=true );

or by using the animate command:

animate( odeplot, [U(A), [t,u(t)], t=0..5], A=-0.009..0, frames=10 );

To avoid the singularity with u(0)=1, I tested all of this for the problems with u(0)=0, not u(0)=1.

I will close by noting that the dsolve,numeric now has a more formal approach to specifying parameters (see ?dsolve,numeric,parameters). Unfortunately, my initial experiments with this were not very successful.

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

The range is largely up to the discretion of the definer. If you are working only in the real numbers, then there is no way to define, say, the square root of a negative number. But, you can talk about the function f(x)=sqrt(1-x) with domain x<=1 or the function g(x)=sqrt(x) with domain, say, -1<=x<=1. Even though these functions are given using the same rule, their domains are different and so they are different functions. Oftentimes you can talk about the "natural domain" of a function. This is the largest set on which the function is defined.

 

The range, or codomain, of a function is the set of values that the function can attain. This is very closely tied to the domain. In the examples above, the range of f (with domain x<=1) is the set of all non-negative numbers. On the other hand, the range of the function g (with domain -1<=x<=1) is the interval [0,2]. This example is easy because the function is monotone (increasing). In general, it's much more difficult to compute the range of a function - even if the domain is explicitly known. Maple has troubles here because the domain is not explicitly specified when a function is defined. (And, Maple's defaults are to work in the complex domain, not the real domain.) So, while it seems this is a pretty simple request for a system like Maple, in actuality it's quite difficult.

I hope this has been 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

The range is largely up to the discretion of the definer. If you are working only in the real numbers, then there is no way to define, say, the square root of a negative number. But, you can talk about the function f(x)=sqrt(1-x) with domain x<=1 or the function g(x)=sqrt(x) with domain, say, -1<=x<=1. Even though these functions are given using the same rule, their domains are different and so they are different functions. Oftentimes you can talk about the "natural domain" of a function. This is the largest set on which the function is defined.

 

The range, or codomain, of a function is the set of values that the function can attain. This is very closely tied to the domain. In the examples above, the range of f (with domain x<=1) is the set of all non-negative numbers. On the other hand, the range of the function g (with domain -1<=x<=1) is the interval [0,2]. This example is easy because the function is monotone (increasing). In general, it's much more difficult to compute the range of a function - even if the domain is explicitly known. Maple has troubles here because the domain is not explicitly specified when a function is defined. (And, Maple's defaults are to work in the complex domain, not the real domain.) So, while it seems this is a pretty simple request for a system like Maple, in actuality it's quite difficult.

I hope this has been 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

No.

Your example involves only x and y. This is a curve in the 2D plane.

Maple can display an implicitly defined surface in 3D. For this, use the implicitplot3d command. As before, the online help for implicitplot3d contains examples that will show you how to use this command.

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

No.

Your example involves only x and y. This is a curve in the 2D plane.

Maple can display an implicitly defined surface in 3D. For this, use the implicitplot3d command. As before, the online help for implicitplot3d contains examples that will show you how to use this command.

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

How can you plot an expression that includes random constants?

I suppose you could treat the random constants as parameters, but then what do you do with the t?

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

How can you plot an expression that includes random constants?

I suppose you could treat the random constants as parameters, but then what do you do with the t?

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

Sandor,

The URL is correct. The publisher has not yet created this page. I will use your message as my latest reminder that they need to do this ASAP.

Thanks for your patience,

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

What, exactly, are you asking Maple to do with your truncated Fourier series?

What additional benefits do you expect to realize by adding 8 more terms? What's special about 8?

If you can provide us with some details of your needs, and attempts, I'm confident someone will be able to suggest some ways to speed up your calculations -- or explain why they are so computationally intensive.

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.ed
First 28 29 30 31 32 33 34 Last Page 30 of 76