Carl Love

Carl Love

28100 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@ANANDMUNAGALA There is no file. Please try uploading again.

@NicholasMarrone Your worksheet failed to attach. Please try again.

The OP's Question is specifically about cutting and pasting code from Maple IDE to plaintext. Maple IDE is a separately sold GUI to Maple for large-scale code development (see http://www.maplesoft.com/products/toolboxes/IDE/). So, the OP's Question has nothing to do with cutting and pasting from Maple's Standard GUI (in 1D- or 2D-input form) or Classic GUI. 

I ask the OP: Why do you want to copy to Notepad? Doesn't the IDE provide everything that you need for editing plaintext Maple files?

I don't use the IDE so I don't know the following: Does the IDE have an Export to plaintext command? Does it store your Maple code files in plaintext form? 

The MaplePrimes's Question headers should be updated to include Maple IDE as one of the product choices.

 

@bogo No, evalhf is not what you need; fnormal is what you need. With evalhf you have no control over the magnitude below which numbers become zero.

evalhf(1e-87);

fnormal(1e-87, 50);

     0.

The 50 is to set the precision. With this setting, any value with magnitude lower than 1e-48 is set to zero.

The only reason that I brought up evalhf was to explain that some small numbers would be automatically converted to zero.

@Markiyan Hirnyk Your advice about interface(displayprecision= ...) needs a proviso/warning: This only affects the way that the numbers are displayed; it does not change the way that they are stored or how they are used in computations. The other command, fnormal, does change the way that a number is stored and used.

@acer Don't read too much intention into the while condition in my ad hoc code. What happened was that I first decided to look for all the roots in 0..10000, regardless of how many. Then I changed my mind and decided to look for the first 20, to compare with Kitonum's list. But I forgot to remove the while condition.

Needing to use a finite maxdistance is annoying, but not as annoying as using fsolve's avoid.

@tomleslie The command verify(A, B, simplify) is (I believe) equivalent to evalb(simplify(A-B)=0). (Can someone who knows more verify that?) I do not deny that this is a very powerful technique for proving expressions equivalent---much more powerful than your earlier attempts with (effectively) evalb(simplify(A) = simplify(B)). And when that verify command returns true, I am prepared to believe it 100%: and B are mathematically equal for all complex number substitutions for which they are defined. I am more skeptical when it returns false. I am skeptical because I don't believe that it can ever return FAIL. (Certainly it can never return FAIL if it is indeed equivalent to the evalb that I gave.) Yet is(A=B) can return FAIL. Even so, I can fairly easily create an expression which is mathematically identically zero but such that is(A=0) returns false. (This of course indicates a bug in is.) So, I am even skeptical when is returns false, but less skeptical than for verify(..., simplify). Hence I like to verify false results by finding an explicit substitution of variable values that show the expressions are not equal.

@bfathi You say "as you can see in picture", but I can't see it---the pictures are too small. Please upload a worksheet using the green uparrow that is the last item on the second row of the toolbar in the MaplePrimes editor.

@YURIKANG When I use the boundary and initial conditions that you gave in the original Question, I get an error message saying that there are too many boundary conditions. Expecting 3, got 4, I don't know enough about PDEs to help further. When pdsolve says that there are the wrong number of conditions, I tend to believe it.

In the floating-point environment in which these PDEs are solved numerically, your exp(-40000) and exp(-10000) are going to be interpretted as identically 0.

@Preben Alsholm Yes, my apologies, I forgot to mention that I did indeed have Digits set to 15. It's easy to forget that because it's my default setting.

@Kitonum The command fsolve only guarantees that the root is in the interval; it doesn't guarantee that it's the first root in the interval. Your code missed a root at 1494.264151.

@Muhammad Usman 

I cut-and-paste the above plaintext code directly into both 1D and 2D input and it worked fine. But here's a worksheet anyway.


A := proc (M) options operator, arrow; `<,>`(`<|>`(Matrix(M), -`<,>`(seq(1/k, k = M .. 1, -1)), Matrix(M, proc (i, j) options operator, arrow; `if`(i+j = M+1, 1/j, 0) end proc)), Vector[row]([`$`(1, M), Pi, `$`(1, M)]), `<|>`(Matrix(M, proc (i, j) options operator, arrow; `if`(i+j = M+1, 1/i, 0) end proc), `<,>`(seq(1/k, k = 1 .. M)), Matrix(M)))/Pi end proc:

A(4)

Matrix([[0, 0, 0, 0, -(1/4)/Pi, 0, 0, 0, (1/4)/Pi], [0, 0, 0, 0, -(1/3)/Pi, 0, 0, (1/3)/Pi, 0], [0, 0, 0, 0, -(1/2)/Pi, 0, (1/2)/Pi, 0, 0], [0, 0, 0, 0, -1/Pi, 1/Pi, 0, 0, 0], [1/Pi, 1/Pi, 1/Pi, 1/Pi, 1, 1/Pi, 1/Pi, 1/Pi, 1/Pi], [0, 0, 0, 1/Pi, 1/Pi, 0, 0, 0, 0], [0, 0, (1/2)/Pi, 0, (1/2)/Pi, 0, 0, 0, 0], [0, (1/3)/Pi, 0, 0, (1/3)/Pi, 0, 0, 0, 0], [(1/4)/Pi, 0, 0, 0, (1/4)/Pi, 0, 0, 0, 0]])

A(0);

Matrix([[1]])

A(1);

Matrix([[0, -1/Pi, 1/Pi], [1/Pi, 1, 1/Pi], [1/Pi, 1/Pi, 0]])

 


Download Pi_matrix.mw

@Kitonum I wish that I could give this Answer more than one vote up. Or I wish that there was a "Best of MaplePrimes" that I could select it for. I implore anyone reading this to vote up this Answer.

@Alex Smith 

You are correct that the prettyprinted form of the two triple integrals is identical. You can never trust that the prettyprinted form of any expression reveals the true way that it's stored. For that, either apply lprint to the expression or set interface(prettyprint= 0). Furthermore, cutting and pasting the prettyprinted output to input also does not reveal the true form. However, if (in Standard) you use the context menu on output, then select Conversions -> String, it'll do it correctly.

Note that there are some commands that manipulate integrals (such as PDEtools:-dchange) that will only take the Int(Int(...)) form.

@acer Perhaps your version(s) of `IsMatrixShape/symmetric` could check the value of _EnvTry, and if it's hard then do the full-scale check of mathematical equality.

Note that if you change `IsMatrixShape/symmetric` itself to use higher-level equality checking, then you can't safely use it to decide whether a Matrix can be stored with shape= symmetric. That's why I prefer creating an `IsMatrixShape/some_other_name`; however, I do appreciate your points about there already being a type check for symmetric Matrices and there being Is in the name.

First 498 499 500 501 502 503 504 Last Page 500 of 709