Maple 2018 Questions and Posts

These are Posts and Questions associated with the product, Maple 2018

Hello,

     I'm trying to simplify an expression involving signum and sqrt using assumptions:

assumptions := { A>0,psi::real,1+A*cos(psi)<sqrt(1+sin(psi)),1+sin(psi)>0 }:
signum(1+A*cos(psi)-sqrt(1+sin(psi))):
simplify(%) assuming op(assumptions);

It seems to me that, given these assumptions, we can safely conclude that the result should be -1. However, I can't get Maple to show this. Interestingly, setting A=1 does allow maple to simplify the result to -1. Is there something I'm missing?


Thanks!

I was wondering how Maple cope with piecewise functions during forward integration and if it's preferable to use dsolve events option in place of defining a piecewise discontinuos function.

As far as I understood dsolve/events halts the integration each time an event is triggered and subsequently restarts the integration using the pre-trigger outputs as new initial conditions. I suppose that by using a piecewise, if a discontinuity is detected, dsolve proceeds exactly in the same way halting and restarting the integration.

Here a toy example of a 2D rolling dice (idea of a rolling dice from the rolling cube by @one man :P ) in which the reaction forces of the floor can be seen as function of the compenetration dice/ground

Both the appraches (events and piecewise) give the same results

falling_dice.mw

Hi, I'm quite a beginner in Maple.

Currently, I'm solving several complex ODE using maple. When I run the code, it gives me some results. However, when I re-run the code using exactly the same equations and parameter, I somehow got completely different results. Using the same input sometimes it gives float(undefined), complex number, or real number.

Could anyone explain what's happening here? Does it mean that my set of ODE is not independent of each other?

Any helps would be greatly appreciated.

Thanks!

We know that Grid:-Map(x->f(x),[x1..xn]) is for parallel computing f(xi)'s but when some xi's are equal I think Maple copies one result for the others. But maybe my function f has some random sampling inside and so will have different output for same inputs. So I need to do parallel computations for same inputs without cheating of copying the result of one for the rest. For a very simple case that Maple copies while it is wrong to copy, see the following.

I will be happy if someone tells me how to solve this issue. Thanks.

More surprising to me is that if I try to use different xi's and then typing same xi's, I will see some new patterns of copying. 

For example in output (3) and (4), first random point of one parallel computation is the second random point of another computation. Or in output (6) only the two last computations are copy of each other!

 

I may need to add that I did this computations on a computer with 4 core processor. Is Maple producing random numbers using something like processor's time? Or something like this?
I can't report Maple computations if they don't really produce random points independently in seperate parallel computations.

If I type pi, Maple just show what I typed, but if I insert the Greek letter pi, then it works. Are there other things that I should take care of them when I'm using "floor" command in my programming?

help me for remove this error.

Error, `;` unexpected
 

thanks_Prab.mw

 

Hello,

      I've noticed a strange phenomenon involving simplify: given the exact same input, its output varies between two different results depending on memory usage patterns.

      I've attached a sample code. There, I have an equation which should simplify to 0=0. If I run the code with garbage collection gc uncommented, it will correctly give 0=0. However, with gc commented out, it gives the unsimplified result result ~80% of the time (with 0=0 the remaining 20%):

1/2*A1*k*epsilon*p*(-I*exp(I*psi__p)*(2-2*cos(2*psi__p))^(1/2)+exp(2*I*psi__p)-1)*exp(-I*psi__p-1/2*2^(1/2)*k^(1/2)*(-k*p*cos(psi__p)+(k^2*p^2+2*k*p*
cos(psi__p)+1)^(1/2)-1)^(1/2)*t)*(-exp(-I*k*x-1/2*I*2^(1/2)*k^(1/2)*(k*p*cos(psi__p)+(k^2*p^2+2*k*p*cos(psi__p)+1)^(1/2)+1)^(1/2)*t)+exp(I*k*x+1/2*I*
2^(1/2)*k^(1/2)*(k*p*cos(psi__p)+(k^2*p^2+2*k*p*cos(psi__p)+1)^(1/2)+1)^(1/2)*t)) = 0

For my particular machine, it seems that when the memory usage is <98.4MB, it gives 0=0, and the unsimplied case otherwise.

      Any idea why this is? It seems odd that simplify would return different results depending on garbage collection, especially since use of gc is now discouraged.

example.txt

A few notes:

  • It seems replacing gc with a simple call to kernelopts(memusage) also produces the correct output
  • This is a snippet of a larger body of code I wrote: there, even without gc, it will sporadically (with the exact same input) produce the correct answer ~50% of the time
  • Only the last 4 lines are relevant; the beginning of the attached code is simply to generate appropriate memory usage and doesn't affect the relevant, final 4 lines

 

Hi all.

Is there a kind soul who can enligthen me on the where abouts of the "print preview" feature in maple 2018?

It does not appear under the "file" -> "print" nor under "file" -> "page setup"

Macbook pro 2018

How do I create a timing diagram simular to

Image result for timing diagram

I do the following:-

1. 

2. TTdf := TruthTable(logic, form = MOD2)

I have tried the statistics package and the timing package. The problem is I get something like

Convert to matrix and add first column to indicate time, e.g 

Where we get an angle rise instead of a vertical rise.

I have also tried it in statistics. The best graph I can get is 

Also tried with no fill and with boarder around the columns, but still cannot get it to look right.

Help much appreciated. Really the Timing Graph should really be available in the Logic Package

Really I want to be able to split the Dataframe into seperate line graphs with a vertical rise and not a angle rise.

Any help would be much appreciated.

P.S I am still learning Maple. I have Maple 2018

Hello

The problem is translate Mathematica code to Maple to find  numerical solution using int(numeric).

I have a more complicated example and here I gives a very simplified version.

I use  successive approximations to solve integral-equation with symbolic int it's easy to do,but with numeric int  I'm failed

MMA code:

func[x_, 0] := x
ifunc[0][x_] := x
func[x_?NumericQ, n_Integer] := x + NIntegrate[(x - y)*ifunc[n - 1][y], {y, 0, x}]
ifunc[j_Integer] := ifunc[j] = Interpolation[Table[{x, func[x, j]}, {x, -3, 3, 0.2}]]

Plot[{Sinh[x], ifunc[n][x] /. n -> 4}, {x, -3, 3}]


My first attempt to translate:

ifunc := proc (n, x) options operator, arrow; x end proc;

ifunc(0, x) := x;

func(x, 0) := x;

func := proc (x, n) x+int((x-t)*ifunc(n-1, t), t = 0 .. x, numeric) end proc;

T := proc (j) option remember;

Interpolation:-Interpolate([seq(x, x = -2 .. 2, .1)], [seq(func(x, j), x = -2 .. 2, .1)], method = cubic)

end proc;

plot([sinh(x), (T(4))(x)], x = -2 .. 2);

See attached file for more info.

Thanks.

test_numeric_volterra.mw

EDITED :----------------------------------------------------------

Third attempt:

func(x, 0) := x;

(ifunc(0))(x) := x:

func := proc (x, n) option remember; x+int((x-t)*(ifunc(n-1))(t), t = 0 .. x, numeric) end proc;

ifunc := proc (j) local f; option remember;

ifunc(0) := proc (t) options operator, arrow; t end proc;

f := proc (t) options operator, arrow;

CurveFitting:-Spline([seq(x, x = -3 .. 3, .1)], [seq(func(x, j), x = -3 .. 3, .1)], x, degree = 1) end proc end proc;

n := 4; plot([sinh(x), (ifunc(n))(x)], x = -3 .. 3)# for n=4 diverge !!!

when using slideshow tool (F11), it just show the first page and arrows for going to other pages does not work. is it a bug?

I'm working with some sum values, but for some reason that I can't figure out, this sum always returns 1.
Have I made some mistake in the way it's supposed to be typed in or why does it return 1? Below the sum I've filled out the spots manually to show how I want them to be.


 

``

x := 2; y := 2; sum(binomial(y, i)*(1/3)^i*(2/3)^(y-i)*(sum(binomial(x, j)*(1/3)^j*(2/3)^(x-j), j = i+1 .. x)), i = 0 .. y)

1

(1)

binomial(y, 0)*(1/3)^0*(2/3)^(y+0)*(sum(binomial(x, j)*(1/3)^j*(2/3)^(x-j), j = 1 .. x))+(1/3)*binomial(y, 1)*(2/3)^(y-1)*(sum(binomial(x, j)*(1/3)^j*(2/3)^(x-j), j = 2 .. x))+binomial(y, 2)*(1/3)^2*(2/3)^(y-2)*(sum(binomial(x, j)*(1/3)^j*(2/3)^(x-j), j = 3 .. x))

8/27

(2)

``


 

Download Sum_fejl.mw

The issue concerns calculation of 2nd derivative of the numerical solution of 2nd order BVP for an ordinal DE.

Lets consider a test problem:

-y’’(t)+y(t)=t*sin(5*t)

y(0)=0.2, y(1)=1

 Numerical solution was obtained by

dsolve([-diff(F(x), x$2)+F(x)= x*sin(5*x), F(0)=0.2, F(1)=1], [F(x)], type = numeric, 'output' = Array([seq(k/5, k=0..5)]));

 

dsolve returns the values of the solution and its 1st derivative (for the test example, a solution can be obtained analytically, but for general case I require numerical solution)..

It is needed to calculate the 2nd derivative of the solution.

I tried to use the Bessel method, when the solution’s 2nd derivative is calculated as the 2nd derivative of 5th degree polynomial having in consequent points t1, t2, t3 the values y(t1), y(t2), y(t3) and 1st derivatives y’(t1), y’(t2), y’(t3), all obtained from the numerical solution. Later I use Hermit piecewise-polynomial interpolation, based on values of the solution and its 1st and 2nd derivatives (polynomial of 5th degree).

Unfortunately, 2nd derivative of such interpolation has a large non-smoothness.

Here, we see the solution. It is smooth.

Here, 1st derivative. Still smooth enough.

Here, 2nd derivative. Typical view with large and sharp teeth.

 

 

Maybe, there exists a simple method for calculation of more smooth 2nd derivative?

Also. it is desirable that it would be embedded in Maple.

How I can solve these time delay  differential equations?

please see attatched files.

Best

Doc191.pdf

ny.mw

 


 

restart; d[1] := 1; d[2] := 4; d[3] := 1; r[1] := 1; r[2] := 1; r[3] := 1; r[4] := .5; a[11] := .5; a[12] := 3; a[21] := 2; a[22] := .8; a[23] := 1; a[32] := .5; a[33] := .9; tau := .3

diff(u(t, x), t) = d[1]*(diff(u(t, x), x, x))+u(t, x)*{r[1]-a[11]*u(t, x)-a[12]*v(t, x)}

diff(u(t, x), t) = diff(diff(u(t, x), x), x)+u(t, x)*{1-.5*u(t, x)-3*v(t, x)}

(1)

diff(v(t, x), t) = d[2]*(diff(v(t, x), x, x))+v(t, x)*{r[2]+a[21]*u(t-tau, x)-a[22]*v(t, x)-a[23]*w(t-tau, x)}

diff(v(t, x), t) = 4*(diff(diff(v(t, x), x), x))+v(t, x)*{1+2*u(t-.3, x)-.8*v(t, x)-w(t-.3, x)}

(2)

diff(w(t, x), t) = d[3]*(diff(w(t, x), x, x))+w(t, x)*{r[3]+a[32]*v(t, x)-a[33]*w(t, x)}

diff(w(t, x), t) = diff(diff(w(t, x), x), x)+w(t, x)*{1+.5*v(t, x)-.9*w(t, x)}

(3)

0 < x and x < Pi, t > 0

0 < x and x < Pi, 0 < t

(4)

diff(u(t, x), x) = 0, diff(v(t, x), x) = 0, diff(w(t, x), x) = 0, x = 0, x = Pi, t >= 0

diff(u(t, x), x) = 0, diff(v(t, x), x) = 0, diff(w(t, x), x) = 0, x = 0, x = Pi, 0 <= t

(5)

u(t, x) > 0, v(t, x) > 0, w(t, x) > 0, `in`(t, x, `&x`([-tau, 0], [0, Pi]))

0 < u(t, x), 0 < v(t, x), 0 < w(t, x), `in`(t, x, [-.3, 0]*[0, Pi])

(6)

``

``


 

Download ny.mw

Hi guys and girls, 

 

The new Maple 2018 have a feature in the buttom called editable. If you remove that mark in the buttom of the screen, then maple doc can't be edited. I teach students who have english as a second language and some remove the mark in the editable box by mistake. Such that they can't do there hand-ins etc. 

 

So is there anyway to disable the editable box in the buttom of the screen? 

 

thanks in advance.

Fred

First 27 28 29 30 31 32 33 Last Page 29 of 43