## Bug in pdsolve, numeric

Maple

Let us consider

```sol := pdsolve({diff(u(x, t), t)-(diff(v(x, t), x))+u(x, t)+v(x, t) = (1+t)*x+(x-1)*t^2, diff(v(x, t), t)-(diff(u(x, t), x))+u(x, t)+v(x, t) = (1+t)*x*t+(2*x-1)*t}, {u(0, t) = 0, u(x, 0) = 0, v(0, t) = 0, v(x, 0) = 0}, time = t, numeric, timestep = 0.1e-1, spacestep = 0.1e-1, range = 0 .. 1);
sol:-plot3d(v(x, t), x = 0 .. 1, t = 0 .. 1);```

A nice plot similar to the one produced by Mma (see the  attached pdf file pdesystem.pdf) is expected.
The exact solutions u(x,t)=x*t,v(x,t)=x*t^2 are known

```pdetest({u(x, t) = x*t, v(x, t) = x*t^2}, {diff(u(x, t), t)-(diff(v(x, t), x))+u(x, t)+v(x, t) =
(1+t)*x+(x-1)*t^2, diff(v(x, t), t)-(diff(u(x, t), x))+u(x, t)+v(x, t) = (1+t)*x*t+(2*x-1)*t});
{0}```

But the wrong result

module() ... end module
Error, (in pdsolve/numeric/plot3d) unable to compute solution for t>HFloat(0.26000000000000006):
solution becomes undefined, problem may be ill posed or method may be ill suited to solution

is obtained. Also

`sol:-plot3d(v(x, t), x = 0 .. 1, t = 0 ..0.1);`

The plot

`sol:-plot3d(v(x, t), x = 0 .. .5, t = 0 .. .1);`

is not better.

## Calculating integral...

If I calculate the integral:

z:=exp(I*t)

evalf(Int(z^(1/2)*(diff(z, t)), t = 0 .. 2*Pi))

I get -1.33333333*I

If I calculate

int(z^(1/2)*(diff(z, t)), t = 0 .. 2*Pi)

I get -4/3

so where is the I coming from? Am I doing sth  something   wrong?

I might add: if I calculate the same for z:=0.5+exp(I*t) I get 0 and -I*0.4714....

so what is going different here?

## Semitorus...Bug? And how do I?...

Try this command.

display(semitorus([0, 0, 0], 0 .. Pi, 1, 2), lightmodel = light4, orientation = [-140, 60], scaling = constrained, style = patchnogrid)

I get this mess. The picture on the help page doesn't look any better.Setting the range 0..2 Pi looks fine though. So I think it is a bug.

What I was trying to do is plot 3/4 of a torus i.e circle disk swept in 3/4 of a carcle with capped ends. What is a good way?

## Using if/else statements to fill an empty matrix?...

I am trying to use a do loop with if/else statements to create a 5x5 unit matrix. I made an empty array. Converted it to a matrix. Then made a do loop where I was trying to get the matrix elements where i=j to be 1 and all else to be 0. It didn't spit out a matrix.

Any advice? I assume I must have missed a small detail in syntax.

 (1)

 (2)

By the way, I am open to completely different methods, also! I was just trying to use loops to do it rather than inbuilt commands.

## How do I let Maple work with the positive value's ...

Hi all,

I am working on a Maple file to find the right force excerted in a specifik angle (theta). This is the script Maple than has to work out:

eq4 := Fh1 = (1/2)*(solFh2*sqrt(2)-40)/sin(theta);
eq5 := Fh1 = (1/2)*(solFh2*sqrt(2)-100)/cos(theta);
sol := solve({eq4, eq5}, {Fh1, theta});

Next it gives me the answers as following:

sol := {Fh1 = 121.6477702, theta = .9606764638}, {Fh1 = -121.6477702, theta = -2.180916190}

Which is correct: I get a force (Fh1 = ± 121.6477...) with 2 angles (theta = .9696... or theta=-2.1809...)

If i want to continue working with Fh1 it gives an error saying it has 2 values for it (obviously a positive and a negative value). Is there a way to continue working with the positive values of Fh1 and theta?

I was thinking of solving the intersect equation on the positive 'theta'-axis in a form like:

sol := solve({eq4, eq5}, {Fh1, theta>0}); as theta is my horizontal axis and a positve theta gives me a positive Fh1 but Maple doesn't work that straightforward.

Thanks a lot!

## Help with Maple Commands...

Hi I was wondering if you can help me with some maple commands about using Euler's method. My professor created a tutorial on using some commands to calculate the value via Euler's method.

Her commands in the tutorial for using Euler's method  for a differential equation- dy/dx= x+y   y(0)=1

x0:=0:y0:=1:xf:=1:n:=10:

h:=evalf((xf-x0)/n);

f:=(x,y) -> x+y

x:=x0:y:=y0:

This next step confuses me the most, my professor uses this syntax to compute the values of approximation via Euler's method. N represents the number of pieces we want to approximate the value with. X0 is initial and XF is final.

forifrom1tondo k:=f(x,y):y:=y+h*k:x:=x+h:print(x,y):od:

I tried replicating this syntax on the exact same problem, copying the syntax commands word for word. Yet, I keep getting the same error "unable to parce" error, with the "od" being highlighted. But on her tutorial, it gave her an two columns with the intervals (n) and all it's values. She even did the same did for only wanting 1 loop printed

forifrom1tondo k:=f(x,y):y:=y+h*k:x:=x+h:od:print(x,y):.   And it gave her only 1 loop.

## Polarplot warning for a semistable limit cycle...

Hey, i'm trying do demonstrate that a nonlinear system has a semistable limit cycle but i get a warning at the plot command saying "Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct" and i dont understand it. So i wonder if someone here could help me?

restart; with(PDEtools); with(plots);
eq1 := diff(x(t), t) = x(t)*(x(t)^2+y(t)^2-1)^2-y(t);
2
d              /    2       2    \
--- x(t) = x(t) \x(t)  + y(t)  - 1/  - y(t)
dt
eq2 := diff(y(t), t) = y(t)*(x(t)^2+y(t)^2-1)^2+x(t);
2
d              /    2       2    \
--- y(t) = y(t) \x(t)  + y(t)  - 1/  + x(t)
dt
tr := {x(t) = r(t)*cos(theta(t)), y(t) = r(t)*sin(theta(t))};
{x(t) = r(t) cos(theta(t)), y(t) = r(t) sin(theta(t))}
eq1b := dchange(tr, x(t)*eq1+y(t)*eq2, [r(t), theta(t)], simplify);
/ d      \       2 /        4         2\
r(t) |--- r(t)| = r(t)  \1 + r(t)  - 2 r(t) /
\ dt     /
eq1b := expand(eq1b/r(t));
d                    5         3
--- r(t) = r(t) + r(t)  - 2 r(t)
dt
eq2b := dchange(tr, y(t)*eq1-x(t)*eq2, [r(t), theta(t)], simplify);
2 / d          \        2
-r(t)  |--- theta(t)| = -r(t)
\ dt         /
eq2b := simplify(eq2b/(-r(t)^2));
d
--- theta(t) = 1
dt
sol1 := dsolve({eq1b, r(0) = r[0]}, r(t));
/      /  /     2  \
|      |  | r[0]   |          2     2
r(t) = exp|RootOf|ln|--------| (exp(_Z))  r[0]
\      \  \r[0] - 1/

2     2
- ln(r[0] + 1) (exp(_Z))  r[0]

/             2\
|(exp(_Z) - 1) |          2     2            2        2
- ln|--------------| (exp(_Z))  r[0]  + (exp(_Z))  _Z r[0]
\ exp(_Z) - 2  /

/     2  \
2     2         | r[0]   |             2
+ 2 (exp(_Z))  r[0]  t - 2 ln|--------| exp(_Z) r[0]
\r[0] - 1/

2
+ 2 ln(r[0] + 1) exp(_Z) r[0]

/             2\
|(exp(_Z) - 1) |             2                    2
+ 2 ln|--------------| exp(_Z) r[0]  - 2 exp(_Z) _Z r[0]
\ exp(_Z) - 2  /

/     2  \
2       | r[0]   |          2
- 4 exp(_Z) r[0]  t - ln|--------| (exp(_Z))
\r[0] - 1/

/             2\
2     |(exp(_Z) - 1) |          2
+ ln(r[0] + 1) (exp(_Z))  + ln|--------------| (exp(_Z))
\ exp(_Z) - 2  /

/     2  \
2                   2       | r[0]   |
- (exp(_Z))  _Z - 2 t (exp(_Z))  + 2 ln|--------| exp(_Z)
\r[0] - 1/

/             2\
|(exp(_Z) - 1) |
- 2 ln(r[0] + 1) exp(_Z) - 2 ln|--------------| exp(_Z)
\ exp(_Z) - 2  /

2                                    2
- (exp(_Z))  + 2 _Z exp(_Z) + 4 t exp(_Z) + r[0]  + 2 exp(_Z)

\\
||
- 1|| - 1
//
sol1 := simplify(sol1);
/      /   /     2  \
|      |   | r[0]   |               2
r(t) = exp|RootOf|-ln|--------| exp(2 _Z) r[0]
\      \   \r[0] - 1/

2
+ ln(r[0] + 1) exp(2 _Z) r[0]

/             2\
|(exp(_Z) - 1) |               2                    2
+ ln|--------------| exp(2 _Z) r[0]  - exp(2 _Z) _Z r[0]
\ exp(_Z) - 2  /

/     2  \
2         | r[0]   |             2
- 2 exp(2 _Z) r[0]  t + 2 ln|--------| exp(_Z) r[0]
\r[0] - 1/

2
- 2 ln(r[0] + 1) exp(_Z) r[0]

/             2\
|(exp(_Z) - 1) |             2                    2
- 2 ln|--------------| exp(_Z) r[0]  + 2 exp(_Z) _Z r[0]
\ exp(_Z) - 2  /

/     2  \
2       | r[0]   |
+ 4 exp(_Z) r[0]  t + ln|--------| exp(2 _Z)
\r[0] - 1/

/             2\
|(exp(_Z) - 1) |
- ln(r[0] + 1) exp(2 _Z) - ln|--------------| exp(2 _Z)
\ exp(_Z) - 2  /

/     2  \
| r[0]   |
+ exp(2 _Z) _Z + 2 t exp(2 _Z) - 2 ln|--------| exp(_Z)
\r[0] - 1/

/             2\
|(exp(_Z) - 1) |
+ 2 ln(r[0] + 1) exp(_Z) + 2 ln|--------------| exp(_Z)
\ exp(_Z) - 2  /

2
+ exp(2 _Z) - 2 _Z exp(_Z) - 4 t exp(_Z) - r[0]  - 2 exp(_Z)

\\
||
+ 1|| - 1
//
sol2 := dsolve({eq2b, theta(0) = theta[0]}, theta(t));
theta(t) = t + theta[0]
theta[0] := (1/4)*Pi;
1
- Pi
4
plot1 := polarplot([subs(r[0] = .1, rhs(sol1)), rhs(sol2), t = 0 .. 10], color = red);
Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct
plot2 := polarplot([subs(r[0] = 2, rhs(sol1)), rhs(sol2), t = 0 .. 10], color = blue);
Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct
display({plot1, plot2}, scaling = constrained, tickmarks = [4, 3], view = [-2 .. 2, -2 .. 2]);

## 2D plotting problems in Maple 2015...

Hi,

I'm struggling to solve a problem with the Maple 2015 worksheet interface. I have a very dense 2D plot, with lots of oscillations, that was generated using Maple 2015 on Windows 10. Substantial parts of the plot are missing; it looks like the tips of the oscillations being clipped out. If I load the same worksheet into Maple 18 on Windows 7 then the plot looks fine (i.e. nothing is clipped). I've dug through the options in Maple 2015 and nothing I try seems to fix the problem. Any advice would be greatly appreciated.

Many thanks,
David

## Output not simplified...

Hi,

I started using Maple recently. The output sometime is not simplified like that in the attached picture. How can I simplify such expressions?

## strange old rand() behavior in Maple...

http://www.maplesoft.com/applications/view.aspx?SID=1526&view=html

near the middle, it says

I just tried in Maple 2016 and that is not what it did. It says this was in Maple 8. It seems this was "fixed" in Maple 2015.

My question: How could Maple 8 have simplified rand()/rand() to 1 before evaluating rand()?  i.e. why was not rand() evaluated first, before the simplification was made? it seems to have worked as if one typed x/x , but rand() would have been a function, and it should be evaluated before?

Just wondering why Maple 8 did the above, that is all.

## How to view the source code for a created .mv file...

How to view the source code for a created .mv file in Maple?

## Maple programing problem in for loops...

helo my friends,

## computing the wronskian with Maple gave nothing...

I am tying to compute the wronskian of a fourth order DE: y=C1e2x+ C2e-x +C3xe-x+ C4x2e-x Here's what I did:

with(VectorCalculus):
with(LinearAlgebra):

Determinant(Wronskian([e^(2*x), e^(-x), xe^(-x), x^2*e^(-x)], x)):

which gave nothing.

AJ

## can Maple find solution to eigenvalue boundary val...

newbie here. When I give Maple 2016.2  a boundary value ODE with an eigenvalue in it, it returns the trivial solution. I was wondering if Maple supports finding non-trivial solution and also give the eigenvalue values associated with the non-trivial solution?

```restart;
ode:=diff(y(x),x\$2)+lambda*y(x)=0;
bc:=y(0)=0,y(L)=0:
assume(L>0,L,'real'):
sol:=dsolve({ode,bc},y(x));
```

The outtput is `y(x)=0`

In Mathematica, it gives both trivial and non-trivial solution:

```Clear[L0, lam, x, y, r]
ode = y''[x] + lam y[x] == 0;
bc = {y[0] == 0, y[L0] == 0};
sol = Assuming[Element[L0, Reals] && L0 > 0,
DSolveValue[{ode, bc}, y[x], x]]```

If Maple does not currently support this, any one knows if this will added to Maple 2017?

## trouble with Levi-Civita symbol from physics-packa...

Hi, there!

I try to simplify the next expression:

`Simplify(LeviCivita[4, sigma, lambda, rho]*LeviCivita[4, xi, eta, mu]*g_[rho, mu]*qp[sigma]*q[lambda]*qp[xi]*q[eta])`

In reality it is incorrect answer, because indices must run over 1,2,3 but not 1,2,3,4!

SumOverRepeatedIndices(%) confirms that maple mistakes.

my preamble is:

`with(Physics)`

```Setup(mathematicalnotation = true); Coordinates(X);```

`Setup(spaceindices = lowercaselatin)`

`Setup(tensors = q[mu](X))`

`PDEtools:-declare(q(X))`

`Setup(tensors = qp[mu](X))`

`PDEtools:-declare(qp(X))`

 5 6 7 8 9 10 11 Last Page 7 of 1253
﻿