## 152 Reputation

17 years, 105 days

## How to fix a piecewise function that is ...

Maple

I have created a simple piecewise function to represent the radius r(x) of a circular cylinder of length 2a and radius b with ellipsoidal end caps of length e << a and e << b to get a smooth transition of r(x) at the two ends for use in slender body theory. The piecewise function does not behave as I had expected, and this is the first time that I have used a piecewise function. What am I doing wrong? The attached (I hope) Maple worksheet shows both my expected behavior and the actual behaviort. Any help will be greatly appreciated. Thanks.

Neill Smith

Piecewise_Cylinder_Geom.mw

## How to get prime derivative notation at ...

Maple 2019

Prime_Derivative_Notation_for_Explicit_X_Values.mwPrime_Derivative_Notation_for_Explicit_X_Values.mw

## I hope this works. I can't seem to paste my MW file in this window in a readable format.

## How to keep math expressions in Text blo...

Maple 2019

My Maple Worksheets (not Maple Documents) have lots of explanetory Text blocks [..... surounding executable Math blocks ([> ..... I often insert mathematical symbols, most commonly subscripted variables, in these Text blocks.  For a simple example, consider the text block entered as

[This is a test of a subscripted variable "CTL-R" h__0 "CTL-T" in a text block.

The "CTL-R" (quotes are not actually entered) is the short cut to go into math mode, and "CTL-T" exits math mode and returns to text mode and the double underscore produces an atomic subscripted variable.

The text block actually will look like

[This is a test of a subscripted variable h0 in a text block.

The problem occurs when I reexecute the worksheet. The Text block actually produces output labeled with an equation number. For my simple example above the Text block becomes

[This is a test of a subscripted variable h0 in a text block.

[                                              h0                                                   (1)

where the two lines started by [ are actually merged with one expanded [ for the Text block with its output. To get rid of the unwanted output, I have to put my curser over the h0 that is in the Text body (not the output h0) and hit "Shift-F5". The output h0 with its equation number disappears.  If there are a number of simple math expressions in a text block, I have to process them one at a time with "Shift-F5". This takes up a lot of time. With earlier Maple versions (~2015 or earlier) I used to fly through Text blocks using the shortcuts "Ctl-R" and "Ctl-T" and these Text blocks produced no output when the worksheet was reexecuted.

Starting with Maple 2016 I could enter math expressions in Text blocks using the shortcuts, but I could not copy and paste  a Text block with inline math expressions without the expressions becoming "live" in the copied block.  Starting with Maple 2017 all my Text boxes with math expressions began executing the math and producing output.

I gave up on Maple 2017 and 2018.  I have finally made the jump from Maple 2016 to Maple 2019, in part, because I finally discovered the "Shift-F5" trick to make math expressions in a Text block inactive.

Does anyone know how to make the default behaviour of Maple with math expressions in a Text block to be "Don't execute the math and produce output in the Text block"?

I would post an actual example worksheet, except I have never been successful whenever I have tried to upload a worksheet. I hope my description above is adequate.

Any help will be greatly appreciated.  Neill Smith

## How to display an unevaluated cross prod...

Maple 2016

I am using the LinearAlgebra package to do dynamics between a rotating Cartesian coordinate system and a fixed Cartesian coordinate system. The VectorCalculus package is not what I need.

Since I can't seem to get my test worksheet to paste into this post, I will manually enter an "approximation" to it. I assume that the notation [x, y, z] represents a column vector. I also assume that x represents the cross product operator from the operator pallete.

I just want to get any one of the three ways of doing a vector cross product (see below) to simply display in math notation as R x V. What I get from the three methods below for an unevaluated cross product is "ugly".

Any help or advice will be greatly appreciated.

> restart

> with(LinearAlgebra):

> R := Vector(3, [x, y, z])

R := [x, y, z]

> V := Vector(3, [u, v, w])

V := [u, v, w]

>R x V

[-vz + wy, uz - wx, -uy + vx]

>'R x V'

Typesetting:-delayCrossProduct(R,V)

>CrossProduct(R, V)

[-vz + wy, uz - wx, -uy + vx]

>'CrossProduct(R,V)'

LinearAlgebra:-CrossProduct(R,V)

> R &x V

[-vz + wy, uz - wx, -uy + vx]

'R &x V'

LinearAlgebra:-&x(R,V)

## How to "flip" equations for use in subs ...

Maple

I often run into this problem. Say I have defined a new variable in terms of some old variables:

Eq1 := NewVar = OldVar1 + OldVar2

Then suppose I have an expression in terms of the old variables:

Eq2 := OldVar6 * OldVar5 = OldVar3 * (OldVar1 + OldVar2)

If I want to substitute Eq1 into Eq2 I have to either type

subs(OldVar1 + OldVar2 = NewVar1, Eq2)

or I can do this

 1 2 Page 1 of 2
﻿