Carl Love

Carl Love

28100 Reputation

25 Badges

13 years, 104 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@ Your objective procedure f needs to have four parameters---not a a single parameter x which you subscript as x[1], x[2], etc. You might as well name the four parameters x1, x2, etc.

@sunit It appears that you are trying to change the number of parameters/arguments of a function after the differentiation operator has been applied to it. The operator (either D or diff) doesn't know what to make of that, and neither do I. What do you intend for it to mean? Why not first change the arguments, and then take the derivative?

For example, while it's true that the derivative of sin(x) is cos(x), it doesn't follow that the derivative of sin(2*x-y) is cos(2*x-y). Indeed, the latter derivative isn't even properly specified until we say the variable with respect to which the derivative is taken.

@sunit And what do you want it changed to?

@MortenZdk There's no need to load the Units package to do what you want to do. If you don't want to clobber the arithmetic operators, then just do:

restart:
eq:= 2.*Unit(m) + d = 5.*Unit(m);
solve(eq, d);

No knowledge of units is required to solve this equation. It's just pure algebra. And Maple will return the result with the units that you expect.

The purpose of overloading the arithmetic operators by loading Units:-Standard is that you may want to enforce unit consistency, you may want to do dimensional analysis, you may want to use equivalent yet differently presented units, etc.

As for units being a gimmick: The package's knowledge of unit systems seems comphrehensive, and there are many hooks for incorporating new knowledge.

 

@John Fredsted Just a wild guess: The OP's form explicitly shows that the function has the symmetry f(w) = f(1/w).

@taro No problem. The delay for the vote up button to respond is amazingly long. You often think that you haven't actually clicked it, so you click it again, which negates the first click!

Thank you for reminding me of the shorter (Diff = diff) form.

@MortenZdk I'm sorry that that didn't work for you. What Maple version are you using? I tested it in Maple 2016.

Obviously you intended for the above to be a Reply to Joe Riel's Answer to your previous Question: 'trasfer funtion plot tmdumper". Please copy it there.

@Vic You asked:

Do you think having them as lists is a bad idea?

Yes, given that you have millions of them.

should I use Array?

No, there's a better way.

Is there away that I could get the cartesian products one at a time and work on them without them taking up huge memory space?

Yes, indeed. It's called an iterator. In Maple 2016, it is handled by package Iterator. In Maple 2015, it can be done with a minor modification of the code I have above:

L:= convert(A, listlist):
J:= combinat:-cartprod(L):
to mul(nops~(L)) do

     j:= J[nextvalue]();
     if CheckCondition(j) then
          do_whatever(j)
     end if
end do;
 

 

@acer 

A difference between the subs method and the unapply method is shown when g depends on f and f depends on z. Both methods are immune to changes of f, but only the unapply method is also immune to changes of z, if z has an assigned value when g is defined.

Example:

z:= 1:
f:= (x,y)-> x+y+z:
g:= subs(_dummy= eval(f), x-> _dummy(x,1)):
G:= unapply(f(x,1), x):
(g,G)(1);

     3, 3

z:= 2:
(g,G)(1);

     4, 3

@acer Yes, I'd like to see your evalr and shake, though I think that the following pretty much tells the whole story:

f:= x-> (1+1/x)^x:
for n from 10 to 15 do
     Digits:= n;
     Range:= op(evalr(f(shake(31536000.))));
     print(evalf[10](Range), 'Digits'=n)
end do:

            2.658111700 .. 2.743273694, Digits = 10
            2.717442509 .. 2.726025763, Digits = 11
            2.717442510 .. 2.718299617, Digits = 12
            2.718213894 .. 2.718299617, Digits = 13
            2.718273900 .. 2.718282473, Digits = 14
            2.718281615 .. 2.718282473, Digits = 15

@acer Yes, it's 15-16 digits; I was wrong saying that it was 17-18. Specifically 53*log[10](2) = 15.95..., the 53 being the number of bits of "significand" that are stored.

@taro Every calculus textbook that I've ever used (and there have been many) has divided the FToC into the two parts, although which is considered the first part and which the second varies from book to book. My favorite calculus textbook is Thomas'.

I wonder why someone removed the vote up that they had given me for this Answer.

@taro 

One part of the FToC, usually called the first part, says, essentially, that the derivative of the definite integral (with appropriate limits) is the original function. The other part, usually called the second part, says, essentially, that the definite integral of the derivative is the original function (evaluated between the limits of integration).

@Kitonum 

Can you confirm that your reformulation of the computation has any beneficial effect? I believe that all that's significant is that you've set Digits to 20, which I wouldn't call a "workaround" because it's the issue.

First 406 407 408 409 410 411 412 Last Page 408 of 709