Doug Meade

 

Doug

---------------------------------------------------------------------
Douglas B. Meade <><
Math, USC, Columbia, SC 29208 E-mail: mailto:meade@math.sc.edu
Phone: (803) 777-6183 URL: http://www.math.sc.edu

MaplePrimes Activity


These are replies submitted by Doug Meade

Are you seeking a numerical solution or an analytic solution?

You mention using dsolve, so I'm assuming you are computing an approximate numerical solution. In this case, what steps are you hoping to see?

If you are looking for an analytic solution, I doubt you're going to find what you are seeking. Maple is likely to have many more classifications than you would encounter in a typical course. The methods that we learn are not always the easiest or most efficient to implement in general.

But, maybe the ODE Analyzer would be of some assistance to you? See the online help page at https://www.maplesoft.com/support/help/Maple/view.aspx?path=worksheet%2Finteractive%2Fdsolve or ask for help for dsolve[interactive].

If this is not helpful, please give us a better idea of exactly what you are hoping to see.

You are correct that the oscillations you see are an example of Gibbs' phenomenon. These oscillations occur at discontinuities in the function being approximated. But, in your case you say the function is periodic. If so, there should not be any discontinuties. I'd wonder if you aren't using an incorrect formula for the Fourier coefficients.

I'm guessing your data is collected on [ 0, 2*Pi ]. Might you be using data from outside this interval when computing the coefficients? By periodicity, for x in [ -2*Pi, 0 ], f(x) = f(x+2*Pi) and for x in [ 2*Pi, 4*Pi ], f( x ) = f(x-2*Pi). If you use these facts, your approximation should be periodic and you won't see these oscillations.

It might help if you shared exactly what you are doing so that we might be able to better answer your question. Right now, I'm just guessing.

Let us know if this works.

Doug

@Scot Gould I think the OP wants to have the results saved with the worksheet/document, so that when re-opened they can pick up exactly where the previous session ended.

If I'm correct, this is a little harder to do, and generally is not a good practice - because you can have multiple worksheets/documents accessing the same (or different) Maple kernels. This means that the current state of the current kernel might not be completely set by what's in any single worksheet/document.

The way I deal with this is to use the !!! button in the header to re-execute everything in the current worksheet.

Oh, and I habitually delete all output from worksheets before saving so that I'm reminded that I have to re-execute the commands before doing anything more in that worksheet.

@Karishma Worked much better at home, on what I would this is a more complicated expression (integral). Could the poor wifi signal in my office be a factor in the troubles I had yesterday?

All excited by this new tool!

I'm teaching linear algebra, so pulled out the textbook to see how what the app could read.

First tried a system of 3 linear equations in 3 unknowns. Had trouble with network connection - but that's not unusual for my office. Changed signals but appears to be unable to read multiple lines of equations.

Next, turned to section on properties of vectors. The double vertical bars for norms appear to cause the scan to stop. Similar behavior when it got to a surd (square root symbol). App scan stops part way across the selection window before jumping back to the left-hand side of the window and reports "Error cropping image".

The app would read the matrix <<1,1>|<1,1>> but it came out as "1 1". Other times on the same matrix simply end with "Sorry, we had trouble with that one."

Most handwritten expressions int x^n = x^(n+1)/(n+1) + C" or "d/dx e^x" also end with "Error cropping image". I used the handy button to send these errors directly to the support team.

Looking forward to having more success soon!

Doug

This discussion reminds me of a video in the Veritasium series. The direct link to the YouTube video is https://www.youtube.com/watch?v=vKA4w2O61Xo.

Enjoy! Don't blame me if you spend too much time watching other Veritasium videos.

@Stuartm12345 What do you mean by transpose? Transposing terms from one side of an equation to the other? Transposing a linear system? ???

I assume you meant to write that the "final sequence doesn't OUTPUT a number".

In your procedure definition, the first command (after local) refers to inputData, which is not one of the arguments to the procedure. Maybe it's a global variable? The rest of the procedure seems to be working with data extracted from inputData. Can you provide your full worksheet, not just the procedure definition? Even save the worksheet with the output that you expect.

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu

@Preben Alsholm As I recall, I use a few iterations of Newton's method (or variant thereof) to solve the systems that I produce. In my original design, I had hoped to allow users to specify their own solution method, but I don't think that was ever completed. It really would be nice if Maple's dsolve command could be expanded to support the numerical solution of boundary value problems.

@Preben Alsholm Yes. This is my "shoot" package (available from the Application Center). It's pretty dated now, but the basic idea still works. It does not try to catch and handle many problems. If the problem is properly posed, it works pretty well.

Sometimes it's easier to simply create a Maple function that takes the (dummy) initial values as input and returns the distance between the desired and computed boundary (non-initial) conditions. Then, all you have to do is solve (fsolve) for the function is zero - or minimize the function. The problems are likely to be solving the 5x5 nonlinear system of equations and ensuring the solution exists on the entire interval.

It would be helpful to see the exact problem you are trying to solve. Does it involve symbolic coefficients? integer? floating point? Are they all about the same magnitude? complex-valued? All of these could influence the way Maple is working, and the results you see.

It's hard to give a specific answer to your quesiton without know the specifics of your problem.

You can copy your problem into a post, or upload a Maple worksheet. Both are easy to do within MaplePrimes.

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu

@Kitonum The backslashes in the OP's post were LaTeX source for what would be entered as sqrt( 1-r^2*exp(2*I*theta) in Maple.

As an aside, it would be nice if MaplePrimes supported MathJax, which would allow for the automatic displaying of LaTeX source as typeset mathematics. If MathJax worked in MaplePrimes, then the following would appear as typeset mathematics: \( \sqrt{r^2 e^{2i\theta}} \). Right now, all I see is the LaTeX source.

I have not looked at your full listing of Maple code, but the definitions of sys, IC_1, and ans1 at the end of your listing execute without trouble for me. (I copied your input into a new worksheet.)

Maybe something earlier in the code is affecting what's happening here. I'd encourage you to copy the last 3 assignments into a new worksheet and see if you get the same result.

If you include the actual worksheet it would be easier for someone to see what's going on.

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu

@acer Thanks for the clarification. I did not know this was allowed in 2D Math. It's nice, but - like many of the features that make Maple more "natural" to use - it's difficult to document.

A little playing shows that Maple will complain if you mismatch delimiters (||A|), and that |A| has a meaning to Maple (but given that it returns -327244 for the 3x3 matrix A in Wtolrud's post, it's not a norm).

Maple's help system is unable to determine the context of these "commands". Normally, "Help on Context" (F2) provides a quick link to the Maple help document for the current context, as determined by the current location of the cursor. But, no matter where I put the cursor in the 2-vertical-bar norm, Maple cannot identify a context.

So, this keeps getting more and more interesting.

@Wtolrud You gave the keystrokes to create this picture in the MaplePrimes compose window. That set of keystrokes does not work for me in Maple 2016.

Here's what I get:

restart;

with( LinearAlgebra );

[`&x`, Add, Adjoint, BackwardSubstitute, BandMatrix, Basis, BezoutMatrix, BidiagonalForm, BilinearForm, CARE, CharacteristicMatrix, CharacteristicPolynomial, Column, ColumnDimension, ColumnOperation, ColumnSpace, CompanionMatrix, CompressedSparseForm, ConditionNumber, ConstantMatrix, ConstantVector, Copy, CreatePermutation, CrossProduct, DARE, DeleteColumn, DeleteRow, Determinant, Diagonal, DiagonalMatrix, Dimension, Dimensions, DotProduct, EigenConditionNumbers, Eigenvalues, Eigenvectors, Equal, ForwardSubstitute, FrobeniusForm, FromCompressedSparseForm, FromSplitForm, GaussianElimination, GenerateEquations, GenerateMatrix, Generic, GetResultDataType, GetResultShape, GivensRotationMatrix, GramSchmidt, HankelMatrix, HermiteForm, HermitianTranspose, HessenbergForm, HilbertMatrix, HouseholderMatrix, IdentityMatrix, IntersectionBasis, IsDefinite, IsOrthogonal, IsSimilar, IsUnitary, JordanBlockMatrix, JordanForm, KroneckerProduct, LA_Main, LUDecomposition, LeastSquares, LinearSolve, LyapunovSolve, Map, Map2, MatrixAdd, MatrixExponential, MatrixFunction, MatrixInverse, MatrixMatrixMultiply, MatrixNorm, MatrixPower, MatrixScalarMultiply, MatrixVectorMultiply, MinimalPolynomial, Minor, Modular, Multiply, NoUserValue, Norm, Normalize, NullSpace, OuterProductMatrix, Permanent, Pivot, PopovForm, ProjectionMatrix, QRDecomposition, RandomMatrix, RandomVector, Rank, RationalCanonicalForm, ReducedRowEchelonForm, Row, RowDimension, RowOperation, RowSpace, ScalarMatrix, ScalarMultiply, ScalarVector, SchurForm, SingularValues, SmithForm, SplitForm, StronglyConnectedBlocks, SubMatrix, SubVector, SumBasis, SylvesterMatrix, SylvesterSolve, ToeplitzMatrix, Trace, Transpose, TridiagonalForm, UnitVector, VandermondeMatrix, VectorAdd, VectorAngle, VectorMatrixMultiply, VectorNorm, VectorScalarMultiply, ZeroMatrix, ZeroVector, Zip]

(1)

 

A := RandomMatrix( 4 );

A := Matrix(4, 4, {(1, 1) = -93, (1, 2) = -32, (1, 3) = 8, (1, 4) = 44, (2, 1) = -76, (2, 2) = -74, (2, 3) = 69, (2, 4) = 92, (3, 1) = -72, (3, 2) = -4, (3, 3) = 99, (3, 4) = -31, (4, 1) = -2, (4, 2) = 27, (4, 3) = 29, (4, 4) = 67})

(2)

Norm( A, 2 );

RootOf(_Z^4-58175*_Z^3+800721903*_Z^2-3474818399774*_Z+4138869346062025, index = 4)^(1/2)

(3)

evalf( % );

201.0845058

(4)

 

Now, let's try this with the keystrokes provided by Wtolrud in his MaplePrimes response:

||A||2

Error, `||` unexpected

 

 

Clearly this does not look as we expect, and Maple does not know what to do with it.

I've created this Maple worksheet to show what I get when I use your set of keystrokes. I also compute the norm via the explicit Norm command for comparison purposes (eventually).

Download NormNotationDemo.mw

You mention that you saw this in a webinar. If it was a Maplesoft webinar, it should be archived. Can you find where you saw it?

I'm do not believe you saw this in an input region. Maybe it was in an embedded component that was programmatically designed to show this display. The only way to know is to see an explicit example.

Doug

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