## 3073 Reputation

20 years, 18 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`

## implementing C-order matrix creation...

I am not aware of a built-in way to make this change, but it's not difficult to do manually:

`A := [ \$1..6 ];                           A := [1, 2, 3, 4, 5, 6]Matrix( 3, 2, A );                                   [1  2]                                   [    ]                                   [3  4]                                   [    ]                                   [5  6]Transpose( Matrix( 2, 3, A ) );                                   [1  4]                                   [    ]                                   [2  5]                                   [    ]                                   [3  6]`

To make this a little more consistent with the traditional Matrix command you might define:

`Matrix_C := ( r, c, M ) -> Transpose( Matrix( c, r, M ) );     Matrix_C := (r, c, M) -> LinearAlgebra:-Transpose(Matrix(c, r, M))`

Then, your matrix is obtained with:

`Matrix_C(3,2,A);                                   [1  4]                                   [    ]                                   [2  5]                                   [    ]                                   [3  6]`

You could get fancier, but I'll stop here with the hope that either this meets your needs or you will let us know if you need anything more.

Doug

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

## I concur!...

Let me second Erik's response. In situations like this, "assuming t::real" is better than simplify( ...., symbolic ).

Also, I note that your definition of the curve, r, is not quite what you probably expect it to be. Instead of

`r(t) := <t | t^(2) | t^2/2 >;`

you should have used

`r:= t-><t | t^(2) | t^2/2 >;`

I hope this has been helpful,

Doug

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

## Matrix-valued matrix...

Like this?

`restart;with( LinearAlgebra ):interface( prettyprint=1 );                                      2for i from 1 to 3 do  for j from 1 to 3 do    X||i||j := Matrix(2,2,x||i||j)  end do;end do;M := Matrix( 3, 3, (i,j)->X||i||j );     [[x11(1, 1)  x11(1, 2)]  [x12(1, 1)  x12(1, 2)]  [x13(1, 1)  x13(1, 2)]]     [[                    ]  [                    ]  [                    ]]     [[x11(2, 1)  x11(2, 2)]  [x12(2, 1)  x12(2, 2)]  [x13(2, 1)  x13(2, 2)]]     [                                                                      ]     [[x21(1, 1)  x21(1, 2)]  [x22(1, 1)  x22(1, 2)]  [x23(1, 1)  x23(1, 2)]]M := [[                    ]  [                    ]  [                    ]]     [[x21(2, 1)  x21(2, 2)]  [x22(2, 1)  x22(2, 2)]  [x23(2, 1)  x23(2, 2)]]     [                                                                      ]     [[x31(1, 1)  x31(1, 2)]  [x32(1, 1)  x32(1, 2)]  [x33(1, 1)  x33(1, 2)]]     [[                    ]  [                    ]  [                    ]]     [[x31(2, 1)  x31(2, 2)]  [x32(2, 1)  x32(2, 2)]  [x33(2, 1)  x33(2, 2)]]`

I changed the prettyprint level to be able to display the matrix in this response. To reset the prettyprint level to its original setting, I'd do:

`interface( prettyprint=_PP );                               1`

Note that a restart would not affect the prettyprint level.

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`

## two solutions...

Here are two solutions to the original question:

`mylist:=[1,2,3,25];                         [1, 2, 3, 25]map( convert, mylist, binary );                        [1, 10, 11, 11001]convert~(mylist,binary);                       [1, 10, 11, 11001]`

The first approach has been seen in previous posts, but not the second one.

Doug

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

## all in one step...

If you want to do this in one step, and without use of %, here's a possibility:

`Qd := x=60;Qs1 := y=40;                             x = 60                             y = 40e1 := fsolve( {Qd,Qs1}, {x,y} );                       {x = 60., y = 40.}eval( 'plot'([ [x,y] ], style=point, symbol=solidcircle, symbolsize=20), e1 );`

Note that it is necessary to use single quotes (') to delay the evaluation of the plot command until after the values of x and y are substituted into the first argument.

The same result could also be obtained with

`plot([ eval([x,y],e1) ], style=point, symbol=solidcircle, symbolsize=20);`

Hoping these are of interest to someone,

Doug

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

## Hmmm. I thought I knew a solution to thi...

Hmmm. I thought I knew a solution to this, but what I thought would work doesn't.

Before I get into my failed solution, it would be helpful to know if you are working in a worksheet or document and if you expect to have any Maple inputs/outputs embedded in your work.

My first thought was to look at the Show/Hide Contents popup under the View menu. I expected to see a radio button for "text regions", but there is not.

Another, rather brute force approach would be to put each block of text in a section and to have the input/output/graphics in a different section. Then, just collapse all of the sections that contain text. Maybe this will work for you, at least in some cases.

Let us know if you can give a more precise description of your exact needs. An example might be helpful.

Good luck,

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`

## WolframAlpha and complex exponentials...

This is the type of question my students like to submit to WolframAlpha. So, I gave it a try just to see what it would do. Sure enough, it gives the antiderivatives, nicely explains the functions, shows some plots, expansions, and other information it thinks someone might want to see.

In the upper right hand corner of the top frame there is a Show Steps link. Clicking this expands that section to show one approach to this problem. Their approach is to convert both sinh and sin to exponentials (complex-valued). The antiderivatives are then easy to find, but there is some algebra to re-express the answer in terms of real-valued functions. The result is consistent with that found by integration by parts.

A direct link to the WolframAlpha page should be http://www.wolframalpha.com/input/?i=+int%28+-1%2F3*sinh%282*x%29*sin%283*x%29%2C+x+%29

The moral of this story is that algorithms that are effective for humans are not always effective for computers. It takes knowledge and experience to know how to apply integration by parts, but the conversion to exponentials requires no knowledge - but flawless algebra skills.

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`

## Ideas for avoiding division errors...

Instead of trying to solve expr1/expr2 = C, have you considered solving expr1=C*expr2?

The solutions should be the same, except when expr1=expr2=0. These cases could be the source of your problem, as simplify(expr1/expr2) could remove a 0/0 singularity.

From my experience, I find Maple might do a better job of solving simplify(expr1-C*expr2)=0 than the form in my first line.

Assuming you have an explicit numeric value for C, you can also plot expr1 and C*expr2 to see where they cross.

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`

## using odeplot to plot expressions involv...

You'll probably find the odeplot (?plots/odeplot) command most useful here.

You will need to express everything in terms of x, y(x), and diff(y(x),x). But, with the use of the ODE, that's not difficult. Here's one way to do it:

restart;
with( plots ):

deq := (diff(y(x), x, x))*y(x)-1+x*y(x)^2 = cos(x);
sol := dsolve({deq, y(0) = 1, (D(y))(0) = 1}, numeric);
/ d  / d      \\                  2
|--- |--- y(x)|| y(x) - 1 + x y(x)  = cos(x)
\ dx \ dx     //
proc(x_rkf45)  ...  end;
my_expr := diff( y(x), x,x ) + diff( y(x), x )*cos(x);
/ d  / d      \\   / d      \
|--- |--- y(x)|| + |--- y(x)| cos(x)
\ dx \ dx     //   \ dx     /
my_expr2 := eval( my_expr, isolate( deq, diff(y(x), x,x ) ) );
2
cos(x) + 1 - x y(x)    / d      \
-------------------- + |--- y(x)| cos(x)
y(x)           \ dx     /
odeplot( sol, [x,my_expr2], x=0..1 );

Does this seem reasonable?

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`

## One way to approach this is to use ?imp...

One way to approach this is to use ?implicitplot (from the  ?plots package):

`with( plots ):eqn := exp((1/6)*kappa*R^2-0.5000000000e-1/R)*sqrt(x)-1+          (1/2)*kappa*exp((1/6)*kappa*R^2-0.5000000000e-1/R)/(sqrt(x)*(1+coth(exp((1/6)*kappa*R^2          -0.5000000000e-1/R)*sqrt(x))))-(1/6)*kappa*(exp((1/6)*kappa*R^2-0.5000000000e-1/R))^2         +0.5000000000e-1/exp((1/6)*kappa*R^2-0.5000000000e-1/R) = 0.;implicitplot( [eval(eqn,R=1),eval(eqn,R=2),eval(eqn,R=3)], x=0..10, kappa=-10..10, color=[red,blue,green], grid=[50,50], legend=["R=1","R=2","R=3"] );`

Or, you can create the plots separately and then combine them with the ?plots/display command.

It would also be very easy to create an animation showing these graphs for different values of R:

animate( implicitplot, [ eqn, x=0..10, kappa=-10..10, grid=[50,50] ], R=0..5, frames=21 );

I hope these give you some ideas about how you can get the pictures you desire.

Doug

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

## implicit differentiation cautions and in...

Your desired equation is simply the reciprocal of your first implicit differentiation. This is not always a valid operation.

From your original relationship: W = R/R0,  you can find that diff(W,R)=1/R0 and diff(R,W)=R0. To get any of these in Maple you need to tell Maple all of the dependencies.

Doug

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

## contact Technical Support...

Without seeing exactly what the Calculus Study Guide's EpsilonDelta maplet looks like, it's very difficult to answer this question. As the Calculus Study Guide is something you (I assume) purchased from Maplesoft, my recommendation is to contact their Technical Support.

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`

## First ideas for 3D plotting of points an...

Nick,

I do not have access to Maple on this computer, but can offer you some advise. First, you should not be using PLOT3D. This is the low-level command (data structure) that Maple uses to render the plots. It is not intended for users to use it to create their plots.

What you should be using is the plot3d command and other commands from the plots package. For example:

HomeplatePlot := polygonplot3d( [[0, 0, 0], [.7083, .7083, 0], [.7083, 1.4167, 0], [-.7083, 1.41666667, 0], [-.7083, .7083, 0]], color=red ):

For the plot of the points in the matrix, I'd use ?plots/pointplot3d .

If others have not responded by the time I get back to a computer with Maple, I'll give more explicit hints. Until then, I suggest looking at Maple's online help. (I just wish the MaplePrimes interface would display the help pages I want to include in this message.)

Doug

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

## complex plots - one at a time...

complexplot behaves this way because it treats the [ sin(I), cos(I) ] as a request to create a single point plot. This uses the first color in the list - red.

While the (real-valued) plot commands accept lists of lists of points, e.g.,

ptlist1 := [ [1,2], [3,4], [5,-1], [7,-8] ];
ptlist2 := [ [1,3], [2,-4] ];
plot( [ ptlist1, ptlist2 ], style=point, color=[red,green] );

complexplot only accepts a single list of points (see ?plots,complexplot and ?plot).

So, to create your plot with the points in different colors, here's what I would do:

complexplot([f(x,y)], x=-2..2,y=-2..2, color=red, style=point, symbolsize=24):
complexplot([g(x,y)], x=-2..2,y=-2..2, color=green, style=point, symbolsize=24):
display( %,%%, axes=boxed );

Doug

NOTE: When inserting a plot into a post the final step is a choice between inserting a thumbnail and the full image. That there are two links here is not clear from the way the words appear in the popup window. All I see are the five words: Insert Thumbnail Insert Full Image with no space to indicate that there are two links - or that these even links. I'm sure you can fix this without much trouble. Thank you!

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

## working with 3d plots...

To plot a level surface, f(x,y,z)=L, I would use implicitplot3d (?plots,implicitplot3d)

To plot a list of 3D points, [ [a,b,c], [d,e,f] ], I would use pointplot3d (?plots,pointplot3d)

To combine several plots into on plot, I would use display (?plots,display)

For example,

`restart;with( plots ):p1 := implicitplot3d( x^2+y^2+z^2=1, x=-1..1, y=-1..1, z=-1..1, grid=[20,20,20], transparency=0.5, style=surfacecontour ):p2 := pointplot3d( [ [1,1,1], [1,0,0], [-1,-1,-1] ], color=red, symbolsize=36 ):display( [p1,p2], axes=boxed );`

Note that there is no need to use display3d, it's really just a wrapper for display.

To see some of the optional arguments that you can use to customize your plot, see ?plot3d,options .

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