C_R

3982 Reputation

21 Badges

6 years, 350 days

MaplePrimes Activity


These are questions asked by C_R

I could not figure out why Maple does not return tanh. Instead a complex valued function for real arguments is returned. This is not recent. I tried down to Maple 2020.  Is that correct?

 

D(tanh);
plot(%)

-tanh^2+1

 

 

int(D(tanh)(x),x);# I expected tanh
plot(%);# ok, no plot for real valued x

x+tanh(x)+(1/2)*ln(tanh(x)-1)-(1/2)*ln(tanh(x)+1)

 

Warning, unable to evaluate the function to numeric values in the region; complex values were detected

 

int(D(tanh)(x),x=0..infinity);# this result seems to be known in advance and fits to the above plot

1

(1)

int(D(tanh)(x),x=a..b);
eval(%,[a=0,b=infinity]);# I expected 1 from (1)
eval(%%,[a=0,b=50.]);# retruns complex for small values

-a-tanh(a)-(1/2)*ln(tanh(a)-1)+(1/2)*ln(tanh(a)+1)+b+tanh(b)+(1/2)*ln(tanh(b)-1)-(1/2)*ln(tanh(b)+1)

 

Error, (in ln) numeric exception: division by zero

 

-Float(infinity)-((1/2)*I)*Pi

(2)

evalf(int(D(tanh)(x),x=0..50))

1.000000000

(3)

Let's try integrating the identical expression sech^2

 

tanh(x)

(4)

is((sech^2=1-tanh^2)(x));# check identity

true

(5)

int(sech(x)^2,x);# what I expected

tanh(x)

(6)

Download Integrating_D_tanh.mw

After starting Maple

I then tried simpler prompts like "Hello", simplify(x),...

For all prompts I get the same error message.
I am not a frequent AI user but this is the first time I see that.
Has anybody else experienced the same?

Can someone send me a prompt that should work?

(Model type was Simple.)

Update:

It seems that this error occurs, when a second instance of Maple 2026.1 is started and AI is consulted in this instance. 

To D(ln@cosh) I have to add an argument to make it work (Edit: no output returned):

D(ln@cosh)(x);
                            sinh(x)
                            -------
                            cosh(x)

According to ?D I expected output according to this

I am only occasionally using Maple versions with the new ribon user interface and noticed about 2 weeks ago that I cannot interrupt for loops under these interfaces. For example this one

for i to 1000 do
    i^i;
end do

I re-run the code today (after installing windows updates) and could interrupt before the screen was filled with output but not after executing the code a second time (without restart).

Is that reproducible on other installations?

Are there other commands that cannot be interrupted? 
If that is known, are there workarounds?

Update:
I have restarted Maple and have two worksheets open with the same code. I can repeatedly interrupt in one worksheet but not in other

Given is a list of equations where the lhs is a name and the rhs an expression (i.e. list(name=algebraic).

I want to pass that list to a procedure and then assign locally the names to the values on the rhs. Similar to passing options in Maple commands (e.g. plot option numpoints=n).

The below, the example throws an error

restart;
foo := proc(params) 
local names; 
names := lhs~(params)[]; 
#local op(names);
print([names]):
assign(params); 
print(b, c, d); end proc;

foo([b = 2, c = 3, d = 4]);
foo([b = 2, c = 3, d = 4]); #  error because the assignement was done to global names

How to fix that and/or avoid assignements to global names

1 2 3 4 5 6 7 Last Page 1 of 56