Carl Love

Carl Love

28020 Reputation

25 Badges

12 years, 300 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@C_R That's correct: simplify is executed first, and then convert. That's true whether or not the simplify is specified as a separate command. What made you think that there was a difference?

@mmcdara I don't think that a recurrence obtained using a finite number of specific coefficients can be considered a "proof". I used FormalPowerSeries instead of taylor so that I could work with arbitrary coefficients and thus get a genuine proof; specifically, (-1)^k/(2*k+1)! for sin(x) and (-4)^k/(2*k+1)! for sin(x)*cos(x). Those are the coefficients of the nonzero terms. To make them correspond to the degree d of the term, I substituted k= (d-1)/2 (note that d is always odd).

@Carl Love The 2nd part of Acer's Answer shows a better way to do the above.

@Ronan Algsubs is chaos and can't be compared to simplify with side relations which is using a well-studied bona fide algorithm called Groebner bases/Buchberger's algorithm. Like all true algorithms, it has a well-defined stopping criterion. However, its performance is very sensitive to the "monomial order" used. There are several paragraphs about this on the help page ?simplify,siderels.

@Ronan In the example that you posted, I don't understand the order (or stopping criterion) that simplify is using. Your final polynomial implicitly contains the degree-2 monomial c__2*c__3. To my mind, this should've been reduced to degree-1 by eq4. But that's not done if you don't use mindeg or call simplify again using a smaller set of equations as 2nd argument. 

@The function You're misinterpreting the plot command. Consider the command

plot([f(t), g(t), t= a..b], ...)

where the list in the 1st argument necessarily has 3 members. This command is not meant to plot f(t) and g(t) as separate functions. Rather, it plots the parametric curve {x = f(t), y = g(t), a <= t <= b}. This is a convenient way to represent curves (such as circles) that aren't properly functions.

@The function No, there is no need that the function have a real root. Consider:

eq:= (x-2)^2+(y-2)^2 = 1:
f:= solve(eq, y)[1];
plot(f, x= 1..3, scaling= constrained, view= [(0..3)$2], gridlines);


This could be rotated around the x-axis just as easily as your original.

@rcorless The integral hides a very simple conditionally convergent alternating series (shown below) akin to an alternating harmonic series. That makes a Psi representation seem quite plausible to me.

Using assuming in the above Answer wasn't necessary; option continuous handles the assumptions.

I made that derivation a bit more automatic:

restart:
#Convert F(G(g1,gk),fk) to G(F(g1,fk),gk)
SwitchOps:= (F::And(function, function &under curry(op,1)))->
local `&<`:= rcurry(op, F);
    (&<[1,0])((&<0)(&<[1,1], &<(2..)), &<[1, 2..])
:
J:= n-> Int(1/(1+x^n), x= 0..1, continuous):
S:= thaw(applyop(convert, 1, subs(x^n= freeze(x^n), J(n)), FPS));
                    /  infinity              
                   | 1  -----                
                   |     \               k   
                   |      )        k / n\    
                   |     /     (-1)  \x /  dx
                   |    -----                
                  /     k = 0                
                   0                         

S2:= SwitchOps(S);
                 infinity                     
                  -----  /  /1               \
                   \     | |             k   |
                    )    | |       k / n\    |
                   /     | |   (-1)  \x /  dx|
                  -----  \/                  /
                  k = 0    0                  

S3:= applyop(value, 1, S2);
                        infinity       
                         -----         
                          \          k 
                           )     (-1)  
                          /     -------
                         -----  k n + 1
                         k = 0         

F:= unapply(simplify(value(S3)), n);
      n-> (Psi(1/2/n + 1/2) - Psi(1/2/n))/2/n

#Verification (only valid for n > 0):
evalf(F(9) = J(9));
                  0.9320304240 = 0.9320304242

value(limit(F(n), n= 0, right) = J(0));
                             1   1
                             - = -
                             2   2

 

@hieudeptrai Enter ?DEplot at a command prompt to get to the help page.

@pazduha Then do

xk = eval(xk, solve({eq||(1..3)}, {xk, xdot, xdot2}));

@Anthrazit The problem with your example procedure is that parse can't create or access local names. Thus, the ab, and c returned by test (use eval(test()) to see them) are globals. (In this case, that eval is needed to expand a table's name to see its contents (see ?last_name_eval). This only applies to named tables, procedures, and modules, not to rtables.)

Here are two alternatives. I think that the 2nd one is closer to what you're hoping for. There, the abc are indeed local to (and exported from) the Record. But in test1 they are global, so this is risky, and I only show it for the sake of example.

test1:= ()-> table((parse@lhs = rhs)~(["a"=1, "b"=2, "c"=3])):
test2:= ()-> Record("a"=1, "b"=2, "c"=3): 

result:= test1();
             result := TABLE([b = 2, c = 3, a = 1])

result[a];
                               1

result:= test2();
             result := Record(a = 1, b = 2, c = 3)

result:-a;
                               1

 

@hieudeptrai If you do the search that Tom Leslie suggests, then by extraordinarily good luck the following will happen:

  • You'll get only 5 search results. Only one of these is a Maple command: DEtools,DEplot. If you take that link and go to the first example (in the section labeled Examples), the example shown is almost exactly Problem 1 from your assignment; you'd just need to change a few numbers. 

@mmcdara Vote up, but I want to mention some mostly philosophical rather than mathematical issues:

1. You say that your implementation is "very simple". You've implemented an exact test, so I don't see how it could be improved (assuming that the n test subjects are sampled from an essentially infinite population).

2. You mention the possibility of a "continuity correction". Wouldn't that only make sense if one were using a continuous distributiuon (such as Normal(n*p, sqrt(n*p*(1-p)))) to approximate Binomial(n,p)?

3. A lack of sufficient evidence for a hypothesis shouldn't be claimed to be evidence for its opposite (and I'm not saying that you claimed that it was). Thus, we never "accept" the null hypothesis; rather, we "fail to reject" it or, better yet, say that the evidence is "insufficient". For a scientifically sophisticated audience, this distinction likely makes little difference. But when test results are presented to the general public, one should be careful to avoid language that may cause people to draw unwarranted conclusions from a lack of evidence.

@John2020 

The mathematical concept constant has several definitions as a noun, some of which partially contradict others. For example, compare the Wikipedia articles "Mathematical constant" and "Constant (mathematics)". In Maple (as well as in all other computer languages that I know of that have a concept of constant) a constant is more akin to a mathematical constant---a symbol or name that has a definite and unchanging value. Your has an unchanging value, but it's indefinite. 

If you attempt to change what Maple means by constant, I think it's very likely that this will cause some future bug, and there's a good chance that this bug will be difficult to track down. There are countless lines of deeply buried Maple code that check for the presence of constants in expressions.

Yes, I realize that your totally fulfills one of the definitions of constant given in that second Wikipedia article, but that is not the definition that Maple is using.

Another reason to use for PDE boundary conditions is that it's the most commonly used method.

@syntax I strongly advise you to use the unapply method shown in Preben's Answer rather than anything based on a modication of your original y:= t-> ... method.

There is a variety of different syntaxes in Maple for creating procedures, but semantically they fall into two categories:

  1. Evaluation before invocation (this includes unapply): Whatever processing (usually symbolic), simplification, evaluation, etc., that is possible to do before the arguments are given is in fact done, and it's done only once.
  2. Evaluation only after invocation (this includes the arrow -> and proc(...)): Those steps are not done until invocation (i.e., when arguments are supplied for the parameters), and they're redone at each invocation.
First 111 112 113 114 115 116 117 Last Page 113 of 708