zenterix

310 Reputation

4 Badges

3 years, 97 days

MaplePrimes Activity


These are questions asked by zenterix

Is there a way to write a function definition that involves multiple cases so that it looks nice with braces as one would write on paper. 
For example, the function $f(x)=|x|$ which is $f(x)=x$ if $x>0$ and $f(x)=-x$ if $x<0$.

First of all, I'd like to be able to write this out with braces in non-executable math in my worksheet. This would already be great.

Then, is it possible to actually define a function this way (ie, not just display the braces in non-executable, but actually run in executable math and have a defined function)?

Let's say we have a velocity vector v := c _i + d _j, where _i and _j are the i hat and j hat Cartesian basis vectors as present in the Physics[Vectors] package.

When we integrate this velocity vector relative to t, the result in maple is the position vector (c _i + d _j)t.

I guess that is correct.

My question is: is there am in-built way to specify an initial position vector for the integration? Ie, can I specify constants in the integration?

Right now I am just doing 

s0 := sx _i + sy _j

s:= int(v, t) + s0

I've been trying to figure out what i_  means in Maple. In what follows is some experimentation and then my questions.

Just a few initial experiments without loading any packages.

i_

i_

(1)

i_ = i_NULL

_i

_i

(2)

_i = _iNULL

D(_i)

D(_i)

(3)

f := proc (t) options operator, arrow; _i end proc

proc (t) options operator, arrow; _i end proc

(4)

D(f)

0

(5)

f := proc (t) options operator, arrow; t*_i end proc

proc (t) options operator, arrow; t*_i end proc

(6)

D(f)

proc (t) options operator, arrow; _i end proc

(7)

D(t*_i)

D(t)*_i+t*D(_i)

(8)

Impression: _i is treated like an algebraic basis vector when the result of a function; but not in an expression.

NULL

with(Physics)

_i

_i

(9)

_i = _iNULL

D(_i)

D(_i)

(10)

f := proc (t) options operator, arrow; t*_i end proc

proc (t) options operator, arrow; Physics:-`*`(t, _i) end proc

(11)

D(f)

proc (t) options operator, arrow; _i end proc

(12)

Nothing really seemed to change with the Physics package being used. However, if we use the following package

with(Physics[Vectors])

_i

_i

(13)

i_

i_

(14)

_i = _iNULL

i_ = i_NULL

In the middle of v__0 := v__x0*_i = v__x0*_i text. Doesn't work as expected.

In the middle of v__0 = v__x0*_i = v__x0*_i = v__x0*_i text.

 

NULL

My question is: is the symbol _i somehow special by default? Where can I find it in the documentation?

Note the second-to-last line in the Maple document pasted above: "Doesn't work as expected". The difference between this line and the next one is simply the presence of a := instead of an =. The assignment makes the vector notation differ. Is this difference a bug or some feature I am unaware of?

Here is yet another behavior that seems kinda weird to me. Given the function f defined above, D(f) gives us the expected result but D(f(x)) does not. Yet, int(f) gives an error, and we have to use int(f(x))

EDIT: a little more research indicates there is a difference between the operator and the function diff. 

Download PhysicsVectors.mw

Reading another question today I discovered that I can use syntax like

a := 2 _i + 3 _j

b:= _i - _j

a+b  

Maple computes the sum by vector component. This is very useful, and it prompted me to start reading the Multivariate Calculus Study Guide. I am still going through it but haven't seen this particular notation yet. When I check the type of above I get a result that sort of looks like `+` but actually it seems to be tilted to the right (so I guess it is italicized and represents some symbol).

What is this type?

I don't find much searching online, and I did see this page that says 

"Any symbol beginning with an underscore (_) is effectively reserved for use only by library code. It is not available to users. Failure to observe this rule can lead to unexpected results."

Edit: After a bit more looking, looks like my example code is using notation available from the Physics package, which I am now reading a bit about (but it is not clear to my why this package is used since I am not importing it explicitly).

I noticed something that seems to be new to my usage of Maple.

As I am typing in an expression in a Maple Worksheet (Document Mode), it seems Maple goes into "Evaluating" for a split second on every new keystroke.

For context, I have my own worksheet open and also the Maple Study Guide open for Multivariate Calculus. But just now I closed it and restarted Maple. A brand new worksheet has this same behavior. 

Did I just miss this before or is it normal for Maple to show "Evaluating" for a split second on every keystroke (instead of just "Ready")?

4 5 6 7 8 9 10 Last Page 6 of 15