13613 Reputation

19 years, 258 days

Worksheet...

@Hahn Hahn Could you please upload a worksheet?

Pi and sqrt(2)...

@mmcdara I would replace Pi and sqrt(2) by evalf(Pi) and sqrt(2.), respectfully.
Then I don't get any errors of any kind in running your worksheet.

I use kernelopts(floatPi=false). If you use the default, which is floatPi=true, you may not need the first replacement;
you will, however, need the second.

Using allvalues as Axel Vogt suggested, but also add, which is suited for adding finite sums:

```restart;
ode:=diff(y(x),x) = (x*y(x)+x^3+x*y(x)^2+y(x)^3)/x^2;

rts:=[allvalues(RootOf(27*_Z^3-9*_Z+29))];
sol:=exp(3*add(1/(9*j^2-1)*ln((-j*x+y(x)-1/3*x)/x),j = rts))-c__1*exp(x) = 0;

indets(sol,function(name));
#odetest(sol,ode); # Does it ever finish?

ode2:=diff(u(x),x)-1/2*(2*a*u(x)^3+u(x)+2*b)/x = 0;

rts2:=[allvalues(RootOf(2*_Z^3*a+_Z+2*b))];
sol2:=2*add(1/(6*j^2*a+1)*ln(u(x)-j),j =rts )-1/2*ln(x)-_C1 = 0;

indets(sol2,function(name));
#odetest(sol2,ode2); # Does it ever finish?
```

No complaint when actually trying odetest.
Your original version run in Maple 2024 Beta has the same error when using odetest:

Error, (in simplify/RootOf) too many levels of recursion
One might prefer that error message to a process that runs forever.

Doesn't work in Maple 2023.2...

@sand15 It doesn't work in Maple 2023.2, but works in Maple 2024.0 Beta.

That said, I think it is better to use add than sum in cases where the limits are numeric values.
In the present case I'm assuming that S(N,x) will only be applied if N is of type numeric.

assume comment...

You are first making assumptions on a sequence of names (about them being real).
Then in the next line you are again making assumptions about those names, this time involving inequalities.
The first assumptions are wiped out totally by the second, but in your case your second assumptions, being inequalities, imply that the names are assumed real.
Try about(gamma); after the second assume.
Then try commenting out the first assume, and then run the lines from restart to 'about'.
The about(gamma) message is in both cases:

Originally gamma, renamed gamma~:
is assumed to be: RealRange(0,infinity)

See ?assume, where you will find the following lines:

When the assume function is used to make an assumption about an expression x, all previous assumptions on x are removed. For example, if you enter assume(x>0) then assume(x<0), there is no contradiction.  Similarly, assume(0<x) followed by assume(x<1) is not equivalent to assume(0<x, x<1).

The benefit of using the same integratio...

@mmcdara Thanks for your explanation. I think I understand your situation.

I will here give some rather arbitrary examples of algebraic expressions where the same integral appears several times, but with different names for the integration variable.

```restart;
J1:=Int(f(x),x=0..1)/Int(f(y),y=0..1);
simplify(J1);
J2:=sin(Int(f(x1),x1=0..1))/Int(f(y1),y1=0..1);
simplify(J2);
J3:=G(Int(f(x2),x2=0..1))/H(Int(f(y2),y2=0..1));
simplify(J3);
J1*J2*sqrt(J3);
simplify(%);
inds:=indets(J1*J2*sqrt(J3),specfunc(Int));
simplify(inds); # No change. inds is a set, so not of type algebraic
```

My guess is that in code handling algebraic expressions involving several integrals that are actually equal except for appearance, it could save time because only one integral need be computed.

PS. I'm glad that a name like you mention _t123 is not introduced.

Thanks again...

@Carl Love It is good to have other options. I prefer 'thistype' though.

More work to be done...

@dharr I guess that kencom1 uses inf as a substitute for infinity.
For inf:=3
odeplot(S1,[y,u[1](y)],0..inf);
gives us:

and for inf:=10 we get:

Thus kencom1 has more work to do.

Thank you...

@Carl Love That is very nice!

N is defined as op...

@C_R acer simply defined N as op. Try this:

```restart;
`print/op`:=()->Typesetting:-Typeset(args):

mass := %op(1) * Unit(m);
value(mass);

mass2 := %op(1) * Unit(cm);
mass + mass2;
simplify(value(%));
```

Any procedure p becomes inert if preceded by %:
Simple example:

```p:=proc(x) x*sin(x) end proc;
p(t);
%p(t);
value(%);
```

See the help page ?%inert, where it says:

You can also make any Maple function inert by prefixing it with the % symbol.

By 'function' is meant a procedure like sin, whereas sin(x) is not. sin(x) is, however, of type function in Maple. Confusing, yes, but it has been the lingo in Maple forever.

local i and the if operator...

@C_R In 1D (aka Maple notation), but NOT in 2D, you can use:

```f:= k -> local i; add({seq(ifelse(floor(k/i)=k/i,i,0),i=1..k-1)});
f(945);```

This works in recent releases, e.g. also in Maple 2021.
In Maple 12 I just tried ? `if`. Up came the help page The Selection (Conditional) Statement and Operator.
About the if operator it says:

if operator
`if`(conditional expression, true expression, false expression)

Making your version clear...

@C_R You could do like this to make your version perfectly clear:

```restart;
g:= k -> {seq(ifelse(floor(k/i)=k/i,i,NULL),i=1..k-1)};

g(945);
```

ifelse doesn't exist in Maple 13, but `if` certainly does.
Here is a version that works in Maple 12 and therefore surely in Maple 13:

```restart;
g:= k ->seq(`if`(floor(k/i)=k/i,i,NULL),i=1..k-1);

g(945);
`+`(g(945));  #not using add
```

Thank you...

@dharr Thanks to you for pointing to the right place.
Now I'm logged in.

The effect of _EnvLinalg95...

@sursumCorda My guess is the opposite: With _EnvLinalg95:=true some use may be made of the old linalg package in computing output from some LinearAlgebra commands.

How did you come to know about the existence of _EnvLinalg95?
I never heard of it before.

A wild guess...

Could _EnvLinalg95 have something to do with the old linalg package? The number 95 could refer to the year 1995.
So setting _EnvLinalg95:=true could mean that you now work in an environment where use is made of that old and deprecated package.
If you try with(linalg);  you get the contents. There doesn't seem to be any command like EigenConditionNumbers, thus the LinearAlgebra version is used.

 First 6 7 8 9 10 11 12 Last Page 8 of 229
﻿