Preben Alsholm

13728 Reputation

22 Badges

20 years, 243 days

MaplePrimes Activity


These are replies submitted by Preben Alsholm

@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.

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

@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.

@Carl Love That is very nice!

@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.

@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)

@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);
add(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


 

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

@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.

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.

@ I tried method=Parts on both examples in Maple 2023.2 as mentioned by Igor Proskurin.
Specifically:
 

res:=int(integrand,t,method=Parts):
res2:=int(integrand2,t,method=Parts):
simplify(integrand-diff(res,t)); # 0
simplify(integrand2-diff(res2,t)); # 0

 

@Preben Alsholm The seven points remained as I feared.
Any reference to the question seems to be gone, which is a good.
 

@C_R I thought of that, but I was afraid that the undeserved points would remain.
It is worth trying though. If the points remain then that exposes a flaw in MaplePrimes.
I can live with 7 undeserved points.

As seen (until tomorrow)  in my answer to my own test question "How to determine if 2+2 = 4?" I'm able to select my own answer as the best answer. It ought not be possible in my view! I received 7 points. Nobody is able to give himself 5 points by giving the answer a vote up. Why should it be different for selecting the best answer?
I shall remove my question and my 7 points tommow morning (Sunday).

@Carl Love Thanks, I shall remove the whole thing, including the points, tomorrow morning.

First 8 9 10 11 12 13 14 Last Page 10 of 230