## 2973 Reputation

16 years, 258 days

Doug

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

## Clarification? Or, maybe the ODE Analyze...

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.

## A possible guess at the source of your p...

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

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

## Better results at home...

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

## Having trouble with scan...

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

## Veritasium...

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.

## What do you mean by transpose?...

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

## inputData...

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

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


## Newton...

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

## more on my "shoot" package...

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

## show us the details, please...

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

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


## \ not / - and a request for MathJax supp...

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

## cannot reproduce, in Maple 2015...

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

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


## unable to determine context (for help)...

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

## Nope - that does not work (.mw provided)...

@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 );
 (1)
 >
 > A := RandomMatrix( 4 );
 (2)
 > Norm( A, 2 );
 (3)
 > evalf( % );
 (4)
 >

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

 > ||A||2
 >

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