Preben Alsholm

13471 Reputation

22 Badges

20 years, 253 days

MaplePrimes Activity


These are replies submitted by Preben Alsholm

@vv Yes, but that is to be expected since [0.3333] will remain [0.3333] after evaluation, whereas the evaluation of [0.3333]+[0] will involve doing 0.3333 + 0, which (with Digits=3) will result in 0.333.

@vv I see! Thank you.
It is important for this example that u is a name assigned to 0.3333 (when Digits=3).
When you take the number itself:

[0.3333+0] = [0.3333] + [0];

you get 0.333 = 0.333.

To make automatic simplification come first on both sides in the name assigned case we can do
 

'[u+0]' = '[u] + [0]';

which evaluates to [u] = [u]  and after %; to .3333 = .3333.
 

@vv Sorry, I don't get it.
Can you shows us such an example?

I'm not able to explain everything here, but will just mention two points that play a role:
1. The input of a floating point number alone as in 1.23456;  leaves all decimals even though Digits < 6. Only if arithmetic with floats come into play as in 1.23456 + 0; is Digits respected.
2. Automatic simplification kicks in here before arithmetic with floats:
 

1.23456;
%+0;

and here:
 

u:=1.23456;
u+0;

Thus the output as a consequence of point 1 is 1.23456 in both cases.

@gkokovidis It appears that in this case replacing the upper limit 5 by 5.0 doesn't actually give a result coming from numerical integration.
What happens is that numerical integration is indeed tried, but it fails after a valiant attempt, so it falls back on exact integration using method = ftoc (as it happens).
Try the following code and you will see this statement printed near the end:

" int: Numeric integration routines did not produce an answer, falling back to exact integration. "

restart;
infolevel[int]:=5:
g :=  sqrt(1/(1-x^2));
CodeTools:-Usage(int(g, x = 0 .. 5.0));

Using L:=int( g, x = 0..5)  followed by evalf(L)  is in this case much faster because time is not wasted trying to integrate numerically.
This fails because it doesn't fall back on exact integration (as designed).
 

restart;
g :=  sqrt(1/(1-x^2));
evalf(Int(g, x = 0 .. 5));
#int(f,x=0..5, numeric); # This is just an alternative syntax

 

I never tried those two buttons before. But they surely don't work for me either.
I'm using the exact same: Firefox 58.0.1 under Windows 10 (64 bit).

@acer Thanks for the explanation.
Just for the record, on my 64 bit Maple on Windows 10 I get the error
Error, (in Optimization:-LPSolve) invalid input parameter to external routine
for the 4 examples in your worksheet using hardware floats combined with method=activeset.

 

@tomleslie I wonder what your system is. I'm using Maple 2017.3 64 bit on Windows 10.
I checked the Maple versions 17.02, 18.02, 2015.2, 2016.2, and 2017.3 for problems with the examples in their respective help pages for LPSolve (which is being used by Maximize).
All but Maple 17.02 had critical failures (and at the end resulting in a crash) unless Digits:=16 (or above)!

Use
op(0,a);

But what is your purpose in doing
a:=0.312[1];

@tomleslie The usual meaning of linearity of the function f from one vector space to another is that f satisfies
(1) f(x+y) = f(x)+f(y) for all vectors x and y
(2) f(t*x) = t*f(x)  for all vectors x and scalars t.

Thus the expression 21+a*x considered as a function of a is not linear.

@AndrewG You probably meant:
" so it essentially does what Rouben Rostamian has done without using the weights option" .

@AndrewG Even using weights=<1,1,10^15,1,1,1> appears to do fine.

You need 8 boundary conditions since your system has two dependent variables of highest order 4.
Also you didn't give us the values of p and L.

@mmcdara You must have had a concrete positive integer n, e.g. 20.
It doesn't matter because what you see is just ToInert working on f(x,y,n) evaluated!
But when n=20 (e.g.) you get
f(x,y,n);
with output sqrt(x)*sqrt(y) so you just see the result of
ToInert(sqrt(x)*sqrt(y));
 

Your system is huge you say, but couldn't you give us a (very) simplified version containing the apparently problematic procedure proc(f(x,y), a, b, c, etc...)  (also simplified if possible).
In particular it would help if we knew the relation of the independent variable 't' to f(x,y) and a, b, c, ... ?
And what is the output of the procedure?

First 44 45 46 47 48 49 50 Last Page 46 of 225