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

Christopher,

I have "flagged" the other copies of this thread. They will be reviewed by the moderator (on Monday?). Assuming he agrees with the flagging, they will be deleted. Until then, I do not believe there is anything you can do.

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

Christopher,

I have "flagged" the other copies of this thread. They will be reviewed by the moderator (on Monday?). Assuming he agrees with the flagging, they will be deleted. Until then, I do not believe there is anything you can do.

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

Thank you for supplying the additional details. Let's see if this gets you closer to what you are trying to do.

I do not see that you can get BodePlot to total the three magnitudes, or phases, but I can construct this without too much trouble from the data that BodePlot will provide and then make my own plot.

Replace your call to BodePlot with the following:

M1,M4,M5 := BodePlot(sys, decibels = false, subsystem = [[1, 1], [1, 4], [1, 5]], output=[magnitudedata])[][]:

This defines the three magnitudes, which can be summed with:

Mtot := Vector( 100, i -> M1(i,2)+M4(i,2)+M5(i,2) );

The vector of frequencies is:

Freq := M1[1..100,1];

from which we can now create a new matrix of magnitude data:

pts := < Freq | Mtot >;

This data can be plotted on a log-log scale with:

plots:-loglogplot( pts, gridlines=true, labels=["Freq [rad/s]", "Magnitude [dB]"] );

The result looks pretty good - to my non-expert eyes.  You could do something similar with the phases if that is also desired.

I'll close by noting that, by default, you won't see any of these matrices or vectors, just placeholders. To see the full contents of each vector or matrix, you need to increase the rtablesize setting:

interface( rtablesize=100 );

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

Thank you for supplying the additional details. Let's see if this gets you closer to what you are trying to do.

I do not see that you can get BodePlot to total the three magnitudes, or phases, but I can construct this without too much trouble from the data that BodePlot will provide and then make my own plot.

Replace your call to BodePlot with the following:

M1,M4,M5 := BodePlot(sys, decibels = false, subsystem = [[1, 1], [1, 4], [1, 5]], output=[magnitudedata])[][]:

This defines the three magnitudes, which can be summed with:

Mtot := Vector( 100, i -> M1(i,2)+M4(i,2)+M5(i,2) );

The vector of frequencies is:

Freq := M1[1..100,1];

from which we can now create a new matrix of magnitude data:

pts := < Freq | Mtot >;

This data can be plotted on a log-log scale with:

plots:-loglogplot( pts, gridlines=true, labels=["Freq [rad/s]", "Magnitude [dB]"] );

The result looks pretty good - to my non-expert eyes.  You could do something similar with the phases if that is also desired.

I'll close by noting that, by default, you won't see any of these matrices or vectors, just placeholders. To see the full contents of each vector or matrix, you need to increase the rtablesize setting:

interface( rtablesize=100 );

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

In your original post you never told us the initial value for n. I think it needs to be 0 for your loop to have a chance of working. (Your approach is very natural but it is very inefficient. Because you did not tell Maple how large to make X and P, it allocates new memory everytime you assign a new value to it. It's not a big deal for 50 points, but it can be an issue with more points or more complicated structures.

Maple provides much easier ways to create your list of points to plot. See below:

F := x -> x*2+3*x^2;
pts := [ seq( [i/10,F(i/10)], i=1..50 ) ];
plot( pts, style=point );

Define the function that you are looking at.

The seq command collapses your loop to a single command. You see how the x values are computed by dividing the index by 10 and the y values by plugging this x value into the function F. Then, just plot the points. The style=point tells Maple to just plot the points. If this is omitted Maple connects the dots - play with this as desired.

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

In your original post you never told us the initial value for n. I think it needs to be 0 for your loop to have a chance of working. (Your approach is very natural but it is very inefficient. Because you did not tell Maple how large to make X and P, it allocates new memory everytime you assign a new value to it. It's not a big deal for 50 points, but it can be an issue with more points or more complicated structures.

Maple provides much easier ways to create your list of points to plot. See below:

F := x -> x*2+3*x^2;
pts := [ seq( [i/10,F(i/10)], i=1..50 ) ];
plot( pts, style=point );

Define the function that you are looking at.

The seq command collapses your loop to a single command. You see how the x values are computed by dividing the index by 10 and the y values by plugging this x value into the function F. Then, just plot the points. The style=point tells Maple to just plot the points. If this is omitted Maple connects the dots - play with this as desired.

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

This is clearly an assignment. Does the class use Maple at all?

I think the first thing to do is to read

http://www.mapleprimes.com/forum/studenthelpcentercodeconductpleasereadfirst1

particularly the last line.

If you can show us what you have been able to do so far, you might be more likely to get additional information about the problems. At present, however, it appears as though you are simply asking for someone else to do all of your work.

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

This is clearly an assignment. Does the class use Maple at all?

I think the first thing to do is to read

http://www.mapleprimes.com/forum/studenthelpcentercodeconductpleasereadfirst1

particularly the last line.

If you can show us what you have been able to do so far, you might be more likely to get additional information about the problems. At present, however, it appears as though you are simply asking for someone else to do all of your work.

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

Thanks for correcting me.

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

Thanks for correcting me.

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

Partial derivatives are no more complicated than partial derivatives. If u is a function of x and y, then the two partial derivatives of u are diff( u(x,y), x ) and diff( u(x), y ). The second-order derivatives are diff( u(x,y), x,x ), diff( u(x,y), x,y ), diff( u(x,y), y,x ), and diff( u(x,y), y,y ). Note that Maple does not assume  the two mixed derivatives are equal.

Also, see the online help for diff, pdsolve (not pdesolve, which is deprecated), and PDEtools.

We're here if you have more questions as well.

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

Partial derivatives are no more complicated than partial derivatives. If u is a function of x and y, then the two partial derivatives of u are diff( u(x,y), x ) and diff( u(x), y ). The second-order derivatives are diff( u(x,y), x,x ), diff( u(x,y), x,y ), diff( u(x,y), y,x ), and diff( u(x,y), y,y ). Note that Maple does not assume  the two mixed derivatives are equal.

Also, see the online help for diff, pdsolve (not pdesolve, which is deprecated), and PDEtools.

We're here if you have more questions as well.

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

The equations in the original posting are in terms of differentials, not derivatives. To convert to a differential equation, divide by dx or dy. Dividing by dy gives the equations in Scott's response. This will lead to x as a function of y. If, instead, you'd prefer y as a function of x, divide your equation by dx.

Scott's suggestion to right click on the output applies in either case. If you are more inclined to use explicit commands, then you should look at the online help for dsolve. It contains many examples that should show you exactly how to get the type of result you want.

For graphical output I recommend the DEplot command in the DEtools package and odeplot from the plots package.

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

The equations in the original posting are in terms of differentials, not derivatives. To convert to a differential equation, divide by dx or dy. Dividing by dy gives the equations in Scott's response. This will lead to x as a function of y. If, instead, you'd prefer y as a function of x, divide your equation by dx.

Scott's suggestion to right click on the output applies in either case. If you are more inclined to use explicit commands, then you should look at the online help for dsolve. It contains many examples that should show you exactly how to get the type of result you want.

For graphical output I recommend the DEplot command in the DEtools package and odeplot from the plots package.

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

I think you want to be using unapply:

F := unapply( OVM(3,7,2), [alpha,gamma,beta] );

One difference between unapply and -> is that -> does not evaluate its arguments. So, when you wrote (alpha,gamma,beta)->OVM(3,7,2), Maple never saw the output to OVM. But, unapply does evaluate its arguments.

Is this like what you have in mind?

OVM := (i,j,k) -> alpha^i*gamma^j*beta^k;
                  i      j     k
(i, j, k) -> alpha  gamma  beta 
OVM(3,7,2);
                                  3      7     2
                             alpha  gamma  beta 
f := unapply( OVM(3,7,2), [alpha,gamma,beta] );
                             3      7     2
(alpha, gamma, beta) -> alpha  gamma  beta 
f(1,2,3);
                                    1152
F := (alpha,beta,gamma) -> OVM(3,7,2);
(alpha, beta, gamma) -> OVM(3, 7, 2)
F(1,2,3);
                                  3      7     2
                             alpha  gamma  beta 

This does not produce the error message you indicated, but you do see that the alpha, beta, and gamma in OVM and the variables with the same name at the top level are not the same variables. (Those in OVM are local only to OVM.)

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 29 30 31 32 33 34 35 Last Page 31 of 76