Michael

217 Reputation

11 Badges

19 years, 177 days

MaplePrimes Activity


These are questions asked by Michael

Hi:

In a plot title, I want  A^(1)(x) to appear - that is, the first derivative of the function A(x) with the "1" enclosed in brackets because that is the standard notation for derivatives of the special function A.

Alternatively, I'll be happy to use A'(x) - and I know that there are calculus characters on the pallet that are supposed to do that, but they all just become Diff and that is no good for other reasons.

So, here is the closest I've come:

Test:=plots[textplot]([3,3,typeset(A^[1],"(x)")]);

and that almost works, except if I change the [1] to (1), Maple tries to evaluate it as an expression and it disappears. If I change 1 to 2 it works fine, except I want the first derivative.

I've tried quotes, uneval, backquotes and all I get is an error or the quotes showing up as text.

Does anyone know how to do this?

Thank you.

Hi:

I am using solve(...,allsolutions)

and Maple is giving me the default "_Z1~" as part of the solution. No problem.

But when I go back and run the same statement again without a restart, it gives me "_Z2~" and my program fails because it is looking to substitute a value for "_Z1".

How do I reset the naming convention without restarting so I can get the same output each time I run the same statement. (BTW: The same thing happens with Veil where it increments the indices of the Veil symbol each time you run the same statement)..

Thank you.

I have an expression of the form X=a/f^b where a and b are both numeric. How do I elegantly extract the numerical values of "a" and "b" given X? See below for my kludge solution.

Problem: extract two numerical values from an expression. Surely there is a more elegant way?
Here is the form of the expression.

restart;
X:=a/f^b;

a/f^b

(1)

Find a and b when they are numbers.
X1:=subs(a=1.234,b=6.789,X);

1.234/f^6.789

(2)

indets(X1);
fterm:=op(2,%);
log(fterm);This sometimes works and yields 6.789*log(f) but I've never been able to figure out when it is going to work and when it won't work.
#log(fterm,f);This never works

{f, 1/f^6.789}

 

1/f^6.789

 

ln(1/f^6.789)

(3)

b:=-op(2,fterm);

6.789

(4)

a:=X1*f^b;

1.234

(5)

Isn't there a better way? This requires that the "op" indices won't ever change and that is asking a lot if this is embedded in a larger program.


 

Download Extract.mw

 

In Hansen's book "A table of Series and Products" there is an unsourced listed identity 43.6.1:

S1 := Sum(2^k*tanh(2^k*x), k = 0 .. n - 1) = 2^n*coth(2^n*x) -   coth(x)

It appears to be to be numerically correct, and can be obtained from a second identity

S6:=Sum(2^(-k)*tanh(2^(-k)*x), k = 1 .. n) =- 2^(-n)*coth(2^(-n)*x) + coth(x)

by "summing in reverse order". S6 is also numerically correct.

Starting from S1 and reversing the order, gives

S2 := Sum(2^(n - k - 1)*tanh(2^(n - k - 1)*x), k = 0 .. n - 1) = 2^n*coth(2^n*x) - coth(x)

Then shifting the index gives

 S3 := Sum(2^(-k)*tanh(2^(-k)*x), k = -n + 1 .. 0) =  2^n*coth(2^n*x) - coth(x)

both of which test OK numerically since n>0. Now it begins to get strange.

In S3, let n->-n (highly illegal) to obtain

S4 := Sum(2^(-k)*tanh(2^(-k)*x), k = n + 1 .. 0) = 2^(-n)*coth(2^(-n)*x) - coth(x)

and, surprisingly Maple tests S4 to be correct numerically.

Here's how that happened. The lower limit of the S4 sum exceeds the upper limit, so there are three possible ways to interpret this:

1. In standard mathematical usage, this is usually set to zero by caveat;

2. In a practical sense, one might expect the order of summation to be irrelevant so S4 is the same as

S5:= Sum(2^(-k)*tanh(2^(-k)*x), k = 0 .. n + 1) = 2^(-n)*coth(2^(-n)*x) - coth(x)

but that fails numerically.

3. Maple has a built-in algorithm (see the help page on "Sum") that interprets

Sum(f(k), k = m .. n) = -Sum(f(k), k = n + 1 .. m - 1)

when m exceeds n and that is why S4 works numerically and, when applied to S4 gives the result S6.

So where did Maple's prescription come from, and what is it's justification?

Thank you

I want to know the exponent of one particular factor of an integer. For example:

k:=24;

ifactor(k) = (2)^3(3)

and I want to write a module to extract the exponent of (3) for any arbitrary k.

I can't select for the presence of 3 because it will pick up the factor (2)^3 and then it gets complicated to decide that I don't want this factor anyway.

If I somehow manage to select the factor (3) using "op" and scanning through each factor in turn, then substitute 3=x, it turns out that degree(%,x) doesn't work because the factor x is enclosed in brackets; similarly trying

log(%,3) fails for the same reason.

There has to be a simple way, but I just don't see it.

Any suggestions are appreciated.

1 2 3 4 5 6 7 Page 1 of 8