Carl Love

Carl Love

28055 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@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.

@tomleslie I see no way of answering your quiz II questions without knowing what the expressions are. Since it's the same group of five commands in each group, it's clearly impossible to answer.

Most of your frustration is simply due to your not knowing the correct command for proving the mathematical equality of symbolic expressions over the complex numbers: is. Unfortunately it's poorly documented: Its help page being lumped together with assume, one might be misled into thinking that it only pertained to expressions to which assumptions apply. So replace all your simplifyexpand, etc., with is(A=B), which uses trivalent logic, returning true, false, or FAIL. Without seeing your expressions t1,...,t7, I bet that it'll return true in every case.

I find absurd the idea that the necessarily kernel-level statement "if A=B ..." would do anything other than a simple identity check (although I do appreciate your frustration with not knowing that there is a simple mathematical-level equality checker). How would one program the higher-level equality checks such as is without the existence of lower-level checks? How would one check whether an expression needed to be rearranged or simplified?

Regarding IsMatrixShape(..., symmetric): It can be extended to use is-level checking by a one-liner:

`IsMatrixShape/IsSymmetric`:= A-> A::'Matrix'('square') and andmap(is, A=~A^%T):

A:= <0, x*(x+1); x^2+x, 0>:
IsMatrixShape(A, IsSymmetric);

     true

@Alex Smith Thanks for the update. Is there an analogous situation with "surface integral" vs. "flux integral" that would explain the OP's difficulties?

Looking through a few calculus textbooks and several online references, it was difficult to verify what you said. I did ultimately find one source on the web that backs up what you said (17calculus.com). So, my preliminary survey suggests that for most modern authors the direction matters in a path integral.

@zia9206314 

The word plot is in a text field. If you change that to executable code, the command works as is.

Your wording suggests that you intended for there to be some code accompanying your Question, but there is no code. You can enter or cut-and-paste code as plaintext or use the green uparrow tool (last item on the second row of the toolbar in the MaplePrimes editor) to upload a worksheet.

@tomleslie You wrote:

M1:= < <0, x*(1+x)> | <0, 0> >:
M2:= < <0, 0> | <x+x**2, 0> >:
M1+M2; # whatever Maple says, this matrix is symmetric!

Whether it's symmetric depends on whether x*(1+x) is equal to x+x^2 and that depends on the domain of discourse. If the domain is complex numbers, then they're equal. If the domain is abstract symbolic expressions, then they're not equal.

IsMatrixShape( M1+M2, symmetric);

This will return false because x*(1+x) is not identically equal to x+x^2. (Note that x^2 is identically equal to x**2.)

IsMatrixShape( simplify(M1+M2), symmetric);

This will return false because simplify neither expands nor factors, so it causes no change to M1+M2.

IsMatrixShape( simplify(M1)+simplify(M2), symmetric);

Once again, simplify has no effect on these expressions, so this will return false.

IsMatrixShape( simplify~(M1)+simplify~(M2), symmetric);

Ditto: false.

IsMatrixShape( simplify~(M1+M2), symmetric);

Ditto: false.

IsMatrixShape( expand(M1+M2), symmetric);

Since expand does not automatically map over Matrices, this will return false.

IsMatrixShape( expand(M1)+expand(M2), symmetric);

Ditto: false.

IsMatrixShape( expand~(M1)+expand~(M2), symmetric);

Since expand changes x*(1+x) to x+x^2, the expressions are now identical, and this will return true.

IsMatrixShape( expand~(M1+M2), symmetric);

Ditto: true.

Upon grading my quiz in Maple 2015, I see that I got them all right.

 

 

 

 

 

@Guy1 But how can you get to the next line so that you can enter a chevron without first pressing Shift+Enter?

@bfathi 

You just need to enter the code for dsnumsort, which appears at the end of the section 25.5.1. Omit the read command.

What's a .wm file? I use Maple 2015 with .mw files and 1D input, and I have no trouble entering multi-line commands. I use Shift-Enter to continue a line.

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