tomleslie

13876 Reputation

20 Badges

15 years, 168 days

MaplePrimes Activity


These are answers submitted by tomleslie

  1. Only way I could reproduce OP's output was to make the assumption that n is a positive integer: NB:- OP does not indicate this requirement in his/her posted image
  2. However assuming that n is a positive integer, I tried n even, and n odd. As rlopez has already indicated, n even gives the integral to be identically zero. Furthermore n odd still does not reproduce tha value which OP claims is "the answer"

See the attached

badInt.mw

 

In the example you quote, you are using [] just to group terms: in maple [] are used to create indexable objects.

If I change your example by using () rather than [], I get the answer (1/840)*L

eq:=(5/2)*x+5*y=15;
isolve(eq);

to get a set of solutions. Never a good idea to use isolve() on an equation containing floats

You can obtain a solution using

restart;
Pr:=0.71;
delta:=1.0;
lambda:=1.0;
eq1:=diff(theta(x,t),t)=lambda*diff(theta(x,t),x$2)/Pr-delta*theta(x,t);
pdsolve(eq1, explicit);


However you will need three intial/boundary conditions in order to eliminate the three arbitrary constants which arise.

Can't think of any way to do this without introducing a 'tolerance' parameter.

if one sets a tolerance variable,, then one can check whether var-tol < value < var+tol fairly easily using a function such as

comp:= (var, val, tol)-> evalb( var > val-tol)
                                      and
                                      evalb( var < val+tol);

Using this function, comp( 3.14, Pi, 0.01) returns 'true', but comp( 3.14, Pi, 0.001) returns 'false' - as you would expect.

Only way I could solve this was by increasing both maxmesh and abserr. The former is no problem (just increases compute time): the latter is less desirable, since it means that numerical accuracy may have been 'compromised' somewhat.

It may be possible to use the solution obtained in the attached as argument for the 'approxsoln' option, and thu obtain a more accurate(?) answer, but I haven't bothered trying this

wsCorr.mw

I have no idea what most of the attached worksheet is trying to achieve, and am reasonably certain that most of it is logically rubbish - See the comments I have made in the attached file

If I ignore all of your code, apart from the comment which identifies the ODE you are trying to solve, then I can produce something close to the answer you seem to expect. Since you are incapable of even specifying values for both of the necessary boundary conditions, I think getting this far is miraculous

crapODE.mw

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

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

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

 

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

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

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

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
First 176 177 178 179 180 181 182 Last Page 178 of 207