Carl Love

Carl Love

28010 Reputation

25 Badges

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

MaplePrimes Activity


These are answers submitted by Carl Love

Is this the type of bar chart that you want?

p1:= 0.2:  p2:= 0.5:  p3:= 1-p1-p2:  n:= 20:
M:= Matrix(
   (n+1)$2, 
   (i,j)-> combinat:-multinomial(n, i-1, j-1, n-i-j+2)*p1^(i-1)*p2^(j-1)*p3^(n-i-j+2)
):
plots:-matrixplot(
    M, cellstyle= discrete, 
    labels= ["Cat. 1", "Cat. 2", "Prob."], labelfont= [times, bold, 14],
    axis[1,2]= [tickmarks= [seq](x+1.5= x, x= 0..n)],
    view= [(1..n+2)$2, default]
);

If it were that easy to change your email address, then actual spammers would use that to continue spamming after the first address was banned from MaplePrimes!

Generally on the Internet, your email address or your mobile phone number is your identity (rather than, say, your fingerprint, DNA, facial photo, or some government-issued key), and you can no more easily change it than you can easily change those other forms of ID.

@Alfred_F  I have three unrelated points here.

1: Quantifications used by is and coulditbe;
It's not contradictory; the distinction between coulditbe and is is that they are checking existential or universal quantification, respectively.

coulditbe:
Do there exist values of n and t allowed by the current assumptions such that term1 = term2? Yes, n=1, t=0 works, so it returns true.

is: 
Does term1 = term2 for all values of n and t allowed by the current assumptions? No (for example, they're clearly different for n=1t=Pi/6 (term1 = (1+sqrt(3))/2, term2 = sqrt(3)-1)) so it's false.


2: infinity as upper bound:
A great many of the problems that you post involve products, sums, or integrals with an upper bound of infinity, You almost always use a variable upper bound and then take the limit as that variable approaches infinity. I don't see any good reason to do that. You could simply use infinity as the upper bound in the first place. I'm not sure, but it's possible that this is more likely to work than limit in some cases. On the other hand, I've never seen a case where limit got the answer and using infinity as an upper bound did not.

Of course, this won't work when the integrand, summand, etc., contains the upper bound; however, that's not your usual case.


3: Elimination of the transcendental cos.
Let T(k) be a function that returns the kth term in any of your recent products. By using half-angle formulas, etc., T(k+1) can be expressed as a purely algebraic function of T(k). Thus, only the cos in the first term needs to be evaluated. This helps for writing a fast function for the numerical evaluation of the infinite product for any t, if you're interested in that.

Make a Post from the account that you wish to delete. Use your main account to read that Post. Click the Spam button at the bottom of it. Then click Delete.

This will only work if the account has reputation 10 or less, but that seems likely for the account you describe.

From the Tools menu, select Options. Go to the Display tab. The first item is "Input display". Is it set to "Maple Notation"? If so, change it to "2-D Math". Then click Apply Globally. Then start a new worksheet.

Reading through the code of SolveTools:-Linear, it's clear that the method's keyword name is SolveTools:-Polynomial rather than Polynomial. If you do with(SolveTools), then those names become the same because Polynomial is an export of SolveTools. However, without using with you could just do method= SolveTools:-Polynomial.

Both Maple 2023 and 2025 handle this immediately:

sum(cos(k*Pi/(2*n+1))^4, k= 1..n);

(3/8)*n-(1/2)*cos((n+1)*Pi/(2*n+1))^4+((1/4)*cot(Pi/(2*n+1))+(1/8)*sec(Pi/(2*n+1))*csc(Pi/(2*n+1)))*cos((n+1)*Pi/(2*n+1))*sin((n+1)*Pi/(2*n+1))+((1/2)*cot(Pi/(2*n+1))-(1/4)*sec(Pi/(2*n+1))*csc(Pi/(2*n+1)))*cos((n+1)*Pi/(2*n+1))^3*sin((n+1)*Pi/(2*n+1))+(1/2)*cos(Pi/(2*n+1))^4-((1/4)*cot(Pi/(2*n+1))+(1/8)*sec(Pi/(2*n+1))*csc(Pi/(2*n+1)))*cos(Pi/(2*n+1))*sin(Pi/(2*n+1))-((1/2)*cot(Pi/(2*n+1))-(1/4)*sec(Pi/(2*n+1))*csc(Pi/(2*n+1)))*cos(Pi/(2*n+1))^3*sin(Pi/(2*n+1))

combine(simplify(%));

(3/8)*n-5/16+(1/16)*cot(Pi/(2*n+1))*sin(4*Pi*n/(2*n+1))+(1/4)*cot(Pi/(2*n+1))*sin(2*Pi*n/(2*n+1))+(1/16)*cos(4*Pi*n/(2*n+1))+(1/4)*cos(2*Pi*n/(2*n+1))-(1/16)*sin(4*Pi*n/(2*n+1))*csc(2*Pi/(2*n+1))

 

Download cos4sum.mw

The factor Pi/(2*n+1) is just obsfuscation: you could simply do

eval(sum(cos(k*x)^4, k= 1..n), x= Pi/(2*n+1));

The ConsistencyTest command is in the package PDEtools, not DEtools. If you try to use the command in your case, it will object because you essentially have both n and n+1 as independent variables of the system. While that might make sense mathematically (I don't know whether it makes sense; I haven't thought about it), Maple doesn't consider these to be PDEs. They're functional equations (or perhaps delay PDEs), which is a more-complicated species. Maple can handle some delay ODEs, but only for numeric solution.

Do you intend for n to be an integer variable rather than a real one? Thus, you're attempting to define sequences of ODEs with the single independent variable t? That would be okay, but Maple requires different syntax for that in order to recognize them as ODEs. For example, you must change your 
p[1](n+1, t) to something like 
p__1[n+1](t). There are a few allowed possibilities for ways to change it, but in all cases t must be the only thing in the parentheses.

You've used both p[1] and p1 as functional variables, I think unintentionally; I think that you meant for them to be the same. Pick one of either p1 or p__1 and use it consistently. I'd avoid using p[1] (it's allowed, but I think it's easier to make an error with it).

Define the following procedure before generating the table. The name of the procedure must be exactly as specified. The procedure will operate in the background, so there's no need to explicitly use it.

`print/≡`:= proc(L,R)
uses T= Typesetting;
    T:-mrow(T:-Typeset(L), T:-mo("≡"), T:-Typeset(R))
end proc:

By making a tiny and purely syntactic correction to your dsolve command, I get the correct symbolic solution:

restart:

kernelopts(version);

`Maple 2025.0, X86 64 WINDOWS, Feb 24 2025, Build ID 1902177`

de:= Diff(a(x)*Diff(u(x),x),x) = -1:

bc:= u(-1)=0, u(1)=0:

sol:= dsolve({de,bc});

sol:= dsolve({de,bc}, u(x));

u(x) = Int((-_z1+RootOf(Int((-_z1+_Z)/a(_z1), _z1 = -1 .. 1)))/a(_z1), _z1 = -1 .. x)

u(x) = value(eval(rhs(sol), a= 1+2*Heaviside));

u(x) = -(1/2)*x^2+(1/3)*x^2*Heaviside(x)-(1/4)*x+(1/6)*x*Heaviside(x)+1/4

 

Download HeavisideBVP.mw

Acer's methods require that the Sum be initially constructed with an inert form as its summand. While I think that that's a fine way of doing it, I came up with another procedural way (while Acer was writing his) that works with a Sum the way that it's ordinarily entered.

EvalSum:= proc(S::Sum(algebraic, name= range(integer)))
uses T= Typesetting, IF= InertForm;
local i:= op([2,1], S), k, x:= op(1,S);
    T:-mrow(
        IF:-Display(S, inert= false), T:-mo("="),
        (IF:-Typeset@`%+`)(
           seq(subs(i= T:-mn(sprintf("%d", k)), x), k= op([2,2], S))
        ),
        T:-mo("="), IF:-Typeset(value(S))
    )
end proc
:
EvalSum(Sum(i^2, i= 1..5));

Sum(`%^`(i, 2), i = 1 .. 5) = `%^`(1, 2)+`%^`(2, 2)+`%^`(3, 2)+`%^`(4, 2)+`%^`(5, 2) and `%^`(1, 2)+`%^`(2, 2)+`%^`(3, 2)+`%^`(4, 2)+`%^`(5, 2) = 55

It's possible to achieve the effect of all of these at the same time: adjointing, pre- and post-multiplication by the antidiagonal, and flattening.
restart
:
AdjointThingy:= proc(A::Matrix(square))
uses C= combinat, LA= LinearAlgebra;
local m:= op(1,A)[1], AT:= A^%T, U:= C:-choose(m,m-1), c, r;
    <seq(`<|>`(seq(LA:-Adjoint(AT[U[-[c,r]][]])^%T, c= 1..m)), r= 1..m)>
end proc
:
A:= Matrix(3, symbol= a):
AdjointThingy(A);


 

Download Adjoint.mw

Here's an exmaple of doing it, using your integral. The displayed quiz is in the worksheet; MaplePrimes won't display it.

restart:

PDEtools:-declare(u(s,t), p(s,t));

u(s, t)*`will now be displayed as`*u

p(s, t)*`will now be displayed as`*p

J:= InertForm:-Display(
    Int(diff(u(s,t),t), s= A..E) + 1/2 %* u__g^2
    + Int(1/`&varrho;` %* diff(p(s,t),s), s= A..E)
    + `&varphi;__E` = 1/2 %* u__A^2 + `&varphi;__A`,
    inert= false
);

Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-msubsup(Typesetting:-mstyle(Typesetting:-mo("&int;", Typesetting:-msemantics = "inert")), Typesetting:-mi("A"), Typesetting:-mi("E")), Typesetting:-mfenced(Typesetting:-mfrac(Typesetting:-mrow(Typesetting:-mo("&PartialD;"), Typesetting:-mi("u", fontstyle = "normal", Typesetting:-msemantics = "function")), Typesetting:-mrow(Typesetting:-mo("&PartialD;"), Typesetting:-mi("t")), Typesetting:-msemantics = "deriv")), Typesetting:-mspace(width = "0.3em"), Typesetting:-mstyle(Typesetting:-mo("&DifferentialD;", Typesetting:-msemantics = "inert")), Typesetting:-mi("s")), Typesetting:-mo("&plus;"), Typesetting:-mcomplete(Typesetting:-mrow(Typesetting:-mfrac(Typesetting:-mn("1"), Typesetting:-mn("2")), Typesetting:-mo("&sdot;"), Typesetting:-msup(Typesetting:-mi("u__g"), Typesetting:-mn("2"))), Typesetting:-_Hold([`%*`(1/2, u__g^2)])), Typesetting:-mo("&plus;"), Typesetting:-mrow(Typesetting:-msubsup(Typesetting:-mstyle(Typesetting:-mo("&int;", Typesetting:-msemantics = "inert")), Typesetting:-mi("A"), Typesetting:-mi("E")), Typesetting:-mcomplete(Typesetting:-mrow(Typesetting:-mfrac(Typesetting:-mn("1"), Typesetting:-mi("&varrho;")), Typesetting:-mo("&sdot;"), Typesetting:-mfenced(Typesetting:-mfrac(Typesetting:-mrow(Typesetting:-mo("&PartialD;"), Typesetting:-mi("p", fontstyle = "normal", Typesetting:-msemantics = "function")), Typesetting:-mrow(Typesetting:-mo("&PartialD;"), Typesetting:-mi("s")), Typesetting:-msemantics = "deriv"))), Typesetting:-_Hold([`%*`(1/`&varrho;`, diff(p(s, t), s))])), Typesetting:-mspace(width = "0.3em"), Typesetting:-mstyle(Typesetting:-mo("&DifferentialD;", Typesetting:-msemantics = "inert")), Typesetting:-mi("s")), Typesetting:-mo("&plus;"), Typesetting:-mi("&varphi;__E")), Typesetting:-mo("&equals;"), Typesetting:-mrow(Typesetting:-mcomplete(Typesetting:-mrow(Typesetting:-mfrac(Typesetting:-mn("1"), Typesetting:-mn("2")), Typesetting:-mo("&sdot;"), Typesetting:-msup(Typesetting:-mi("u__A"), Typesetting:-mn("2"))), Typesetting:-_Hold([`%*`(1/2, u__A^2)])), Typesetting:-mo("&plus;"), Typesetting:-mi("&varphi;__A")))

A:= Array():

A(1):= Grading:-Quiz(
    "This is the question.", 1, [J],
    'style'= 'multiplechoice', 'output'= `module`
):

Grading:-Quiz(
    A, 'numberformat'= 'lowercaseroman', 'numberprefix'= "Frage 1.",
    border
);

NULL

Download Quiz.mw

Since the series is alternating, I decided to pair consecutive terms to make it a series of positive terms:

restart
:

a:= k-> (-1)^(k+1)/((10*k+(-1)^k-5)/4);

proc (k) options operator, arrow; (-1)^(k+1)/((5/2)*k+(1/4)*(-1)^k-5/4) end proc

simplify(a(k)+a(k+1)) assuming k::odd;

12/(25*k^2-9)

sum(subs(k= 2*k-1, %), k= 1..infinity);

(1/5)*Pi*cot((1/5)*Pi)

 

Download AltSum.mw

I don't know why my output doesn't display the normal way. It looks normal in the worksheet. I tried creating-from-scratch and uploading the worksheet 3 times.

It can be done by applying a small command to the plot after the VennDiagram command:

V:= VennDiagram(...): #exact same command that you had before

(`&<`, `&>`, `&[`):= (curry, rcurry, ()-> index &> args):
fl:= s-> (thisproc(s):= try parse(s[..-2]) catch: s end try):

subsindets(
    V,
    And(string, "%" &under &[(-1), float &under fl),
    sprintf &< "%4.1f%%" @ fl
);


 

1 2 3 4 5 6 7 Last Page 1 of 394