Carl Love

Carl Love

28055 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@Kitonum The assignment r:= table() creates an empty table. This is necessary to obtain correct output in case there are no twin primes between a and Lim. It also makes it clear that r is a table

@Kitonum Here's a modification with proper return-value output.

twinprimes:= proc(a::realcons, Lim::realcons)
local
     a0:= `if`(a::prime, a, nextprime(a)),
     b:= nextprime(a0),
     r:= table(),
     n
;
     for n while b <= Lim do
          if b-a0 = 2 then r[n]:= [a0,b] end if;
          (a0,b):= (b,nextprime(a0))
     end do;
     convert(r, list)
end proc:

 

@Ronan There's no problem at l=1 or n. Maple understands the concept of an empty sum.

How is it that dsolve doesn't catch the square-bracket error? In this case dsolve produced normal-looking output, and it's by using that output that an error is produced.

@Vrbatim 

That's because sqrt(2) is algebraic and is a subpart of 2.0*sqrt(2). But, even though is algebraic, numeric complex constants don't "contain" as a subpart. The only operands of 2.+3.*I are 2. and 3., no I. The is used to input a numeric complex constant, but it's not stored as part of that constant. 

If you want to express the principal square root of -1 as an algebraic number, it'll be safer to use RootOf(_Z^2+1, index=1). It'll be more convenient if you set an alias to this.

@tomleslie Note that if you remove the return from your procedure, it'll produce exactly the same result: all five solutions. The significant difference between yours and the OP's isn't the return; it's the use of commas instead of semicolons.

Here's a perhaps-irrelevant code shortening: The entire procedure can be replaced by

LTTS:= solve0||(1..5)@~(rhs-lhs);

 

@Markiyan Hirnyk It's a partial solution because you supplied the simplified value, 0, rather than Maple coming up with it by itself.

@nMaple 

Apparently the conversion from Heaviside form to abs form doesn't work in Maple 17, no matter what assumptions I make. But a conversion to piecewise form does work, and int is able to integrate it. So, for Maple 17 (and probably earlier), use

convert(int(convert(f(t-q)*g(q), piecewise, t), q = -2 .. 10), Heaviside);

Regarding the integral's value for t < -2 and t > 10: Yes, the integral is for t < -2, but it has a constant value of 45 for t > 10.

Regarding copy-and-pasting in plaintext: There are several ways, but my recommended way is to code in plaintext in the first place. This means using character style Maple Input rather than 2D Input. The character style is the leftmost pull-down on the last row of toolbars. You can set this style as your default by using the Tools -> Options menu (any many of the oldtimers here on MaplePrime would recommend that you do so).

@vv Your English is good, and I didn't suspect that you weren't a native speaker.

I think that the intended meaning of "the number 123 has three distinct digits" is clear to anyone who uses base-10 arithmetic by default---which means any native English user since our number words are base ten---and such usage would be unlikely to raise an eyebrow except perhaps from the nuns at my elementary school. However, I believe that such usage is technically incorrect. Some corrected versions include

  • The numeral 123 has three distinct digits.
  • The number 123 has three distinct digits in its base-10 representation. 

The key distinction to me is that a number is an abstract entity which exists regardless of whether it's written down or spoken. A numeral is a symbol representing a number. (So one hundred twenty-three123, and CXXIII are all numerals for the same number.) A digit is one of the symbols used for the coefficients in a positional arithmetic system. A Hindu-Arabic digit is one of the specific symbols 0, 1, ..., 9.

 

@H-R I agree wholeheartedly with vv on this matter. In particular, 

  • Attempting to write a CAS restricted to the real-number system but which still has all the power of Maple for working within the real numbers seems to me to be a momumental task, if it's possible at all.
  • Ignoring complex numbers is pedagogically unsound. For example, teaching that int(1/x, x) = ln(abs(x)) is an abomination. And I would've mentioned vv's arctangent example had they not done so already.

However, I see no problem with wanting to assume that variables are real! That's a different issue. The heart of the problem in this Question is that RealDomain ignores additional assumptions. My guess is that it wouldn't be so difficult to modify the package so that it would allow additional assumptions.

In Maple, any assumption where a variable appears on one side of a directional inequality automatically assumes also that that variable is real. In this Question, it's essential to assume u > 1 for the desired simplification to occur. Thus there's no need to assume that is real---that's done automatically.

I do appreciate that you'd like to assume that all user variables are real without having to list them all. I think that that would be an easy thing for Maple to implement. It'd be something different from the RealDomain package.

There are several contexts already in Maple where it's assumed that all user variables are real. Two general ones are evalc and assuming real. You can append the phrase assuming real to any command without mentioning any specific variables.

In English, there are the words numbernumeral, and digit---which have distinct definitions. The number 3 occurs only once in the sequence of positive integers from 1 to 1000. The digit 3 occurs 300 times in the base-10 numerals for that sequence. Of those numerals, 271 contain the digit 3.

So I suspect that the usages of number in the Question need to be adjusted.

@nMaple If you upload an executed worksheet showing my command not working, then I may be able to suggest an adjustment. Please start your worksheet with the commands

restart;
kernelopts(version);

You can upload a file by using the fat green uparrow on the toolbar of the MaplePrimes editor. Rouben's admonishment about pictures versus plaintext doesn't apply to uploaded worksheets.

@tomleslie wrote:

...but assuming that 'classic' gives the same functionality....

That assumption is really, really far from reality. There is no Tools menu. The equivalent of Options is File->Preferences. It has no Interface tab. There is no Large Toolbar Icons checkbox.

@H-R You can do computations with reals in Maple. The way to do it is (generally) to use assume and assumingnot RealDomain. I think that the problem with RealDomain is simply its name, which makes people think that its purpose is to restrict computations to the reals. It should be named Student:-Precalculus:-RealDomain. Had it been named thus, you wouldn't have used it, right?

@vahid65 Try copy-and-pasting my code rather than retyping it. I think that you missed a comma between t= -6*Pi..Pi and thickness= 3. If you encounter any more errors, you'll need to upload an executed worksheet showing the error message. Use the fat green uparrow to upload a file.

First 438 439 440 441 442 443 444 Last Page 440 of 709