## 6809 Reputation

10 years, 222 days

## Unclear question...

Not exactly obvious what you want the final plot to look like! The attached shows a couple of possibilities, nd therre are probably many other ways to achieve this.

sphTrunc.mw

## Inconsistent...

For the supplied example (ie M=4, so desired variables are A[1], A[2]), the equation system is inconsistent.

A[1] and A[2] occur in the coefficients for x^1, x^2, and x^3. One can solve for A[1], A[2] using any two of these coefficient equations, but there are no values of A[1], A[2] which satisfy all three (without imposing restriction on other parameters)

See attached

solveEqs.mw

## pointplot()...

Why not use the plots:-pointplot() command and then just give it a list of points to plot?

As in

xVals:=Array( [seq(j, j=0..100,2)]):
yVals:=Array( [seq( j*sin(j), j in xVals)]):
pts:= [seq( [xVals[j],yVals[j]], j=1..numelems(xVals))]:
plots:-pointplot( pts );

## A tentative answer...

The attached produces two values of 'r' for which P(r)=0

solvePR.mw

I agree with Markiyan that the problem is ill-posed because of the parametric values involved. This makes finding solutions unnecessarily difficult - and unstable numerically. Note, for example, that Maple thinks the solution to your ODE is complex - I assume you believe that it is stricly real??

## If I understand correctly...

then the attached worksheet ought to provide what you want

dataPlot.mw

Quick Tip:

if you want to select a complete row or column from a Matrix, then you don't need the 1..rowdim (or 1..coldim) argument: for example
A[..,3] will select all entries in column 3
A[3,..] will select all entries in row 3

## Quick, dirty version...

Suppose you want to plot the function f - as in

f:=x->x^2:
plot(f, 0..10);

Then plotting it "upside-down" can be achieved by using the value=label construct of the tickmarks plot option, together with multiplying the function by (-1), as in

tVals:=[-100, -66, -33, 0]:
tLis:= [seq(j=convert(abs(j), string), j in tVals)]:
plot(-f, 0..10, axis[2]=[tickmarks=tLis]);

The drawback of this approach is that you have to "know/guess" the values of the tickmarks.

I am reasonably sure that one could automate this if necessary: eg if the x-range of the plot is known, then max and min values of the function can be calculated. Then a suitable range for y-axis tickmarks, can be computed which can then be translated to the appropriate labels

## My best try...

Your equation requires three boundary conditions, but only two can be 'boundary' rather than 'initial-value' conditions. I managed to obtain a solution by converting your problem to something which looks a bit like a shooting method. See the attached

ode3pt.mw

The logical process is not obvious but can be summarised as

1. Guess a value of the derivative D(F)(-1)
2. Solve the ODE in the range eta=-1..0, using the BCS F(-1)=0, F(0)=0 and the guess mentioned above
3. From this solution, obtain the associated second derivative at F(-1)
4. Now solve the same equation using F(-1)=0, the first derivative mentioned bullet 1 above, and the second derivative obtained at step 3.
5. Since this is now an initial-value problem, the range of the solution can be extended to -1..1, and hence F(1) can be computed
6. Use an optimisation process to change the value 'guessed' at bullet 1 above, so that the vlaue of F(1) obtained at bullet 5 above is equal to zero
7. The situation has now been converted to an initial value problem where the bondary conditions are F(-1), together with first and second derivatives at eta=-1. (Rather like using a shooting method to convert a BVP problem to an IVP one.)
8. Generate a complete solution for this case, and check that the OP's original conditions at F(0) and F(1) are still met

## Have I seen this before??...

Looks suspiciously like the previous post

http://www.mapleprimes.com/questions/220233-How-To-Solve-The-Challenging-Non-Linear...

where you ignored the suggestions provided. Why?

The attached provides solutions for the provided bcs.

I have deleted pi=3.143, and used Pi=3.14159..... throughout.

'refresh' - what is that? - I have replaced with restart

Rather obviously, your equations are singular at r=0, so I have had to use a mid-point solution method.

Probably because of this singularity, and the combination of huge (10^35) and tiny (10^-20) coefficients in your problem, I have also had to adjust various accuracy settings in order to get an solution at all.

odeProb2.mw

## Two obvious questions...

1. What is the file extension on the the document you are trying to open?
2. What is the actual format of the document you are trying to open

Anything with a '.mw' or '.mws' extension, Maple will open as a worksheet without giving the dialogue you poted in your question.

If the file has a '.txt' extension, then Maple produce the above dialogue - assuming that it actually contains 'plain text', then use the 'plain text' button on the dialogue, and Maple will import it as plain text

If you have some other combination, then you are going to have to provide more details. Alternatively you could upload the offending file here (use the big green up-arrow in the toolbar), and someone here can probably

1. figure out what kind of document you have
2. suggest the best way to persuade Maple to 'open' it

## If I understand correctly?...

Anything wrong with

Rot__alpha:=Matrix( [ [ cos(alpha(t)) , -sin(alpha(t)) , 0 ],
[ sin(alpha(t)) , cos(alpha(t)) , 0 ],
[ 0 , 0 , 1 ]
]
);
map(diff, Rot__alpha, t);

## Saving results...

Added an execution group to the bottom of your worksheet. See the attached

corrPrint.mw

## typos...

There are a couple of places in your code where you use the variable 'contants' (Note the spelling) - I'm pretty sure it should be 'constants' every time, since you seem to be referring to the procedure parameters, where the variable name is given as 'constants'

If I make these changes, your worksheet runs, but trips a timelimit in the try-catch statement within the procedure subCreate(). It also generates an error, here: I think because you are trying to evaluate a quantity whihc does not exist (because the try-catch, has timed out without producing the necessary data???)

I haven't tried extending the try-catch timelimit - up to you to assess whether this limit should be tripped or not!

## A solution...

I converted the definition of u() from 2-D math input, and changed the sum() functions to add(). Infinities went away: I assume becuase Maple is no longer looking for 'closed-form' solutions to the sum() command

Output from u(0 is now a function of r, theta,t: so one of these has to be set inorder to produce plots with respect to the other two. A number of possibilities are illustrated in the attached. The final two animations are moderately(?) impressive

WaveEq.mw

## Well.........

About as simple as I can come up with is shown in the attached. The only thing you will have to change is the path to the directory where the data bis to be stored. I have used

D://Users/TomLeslie/myMaple/

as the directory - because this exists on my machine. You will have to chenge this string to some (writable) directory which exists on your machine

wrData.mw

 First 110 111 112 113 114 115 116 Last Page 112 of 140
﻿