vv

13805 Reputation

20 Badges

9 years, 313 days

MaplePrimes Activity


These are answers submitted by vv

Note that the parametrization is 4*Pi - periodic in u, so, no need to plot over 0..6*Pi.
 

restart;
f:=[arctan(-tan(u/4)) + ((cosh(v) - sinh(v))*sin(u))/2, -v/2 + ((cosh(v) - sinh(v))*cos(u))/2, 2*(cosh(v/2) - sinh(v/2))*sin(u/2)]:
e:=1.e-3:
P1:=plot3d(f, u = 0 .. 2*Pi-e,    v = -1 .. 1, grid = [80, 15], orientation = [50, 79], shading = XYZ, style = patch):
P2:=plot3d(f, u = 2*Pi+e .. 4*Pi, v = -1 .. 1, grid = [80, 15], orientation = [50, 79], shading = XYZ, style = patch):
plots:-display(P1,P2);

I simply insert (when needed) some empty execution groups.

 

discont(Re(p1), alpha): evalf(%)[]:
A:=0, %[-3..-1], 5:
plots:-display(seq(plot([Re(p1),Re(p2)],alpha=A[i]+0.001 .. A[i+1]-0.001, view=-2..2, color=[red,blue]), i=1..4));

                    

restart;

P:=expand((D[1] - 1)*(D[1]^2 + 2));

D[1]^3-D[1]^2+2*D[1]-2

(1)

L:=evalindets(P,`^`,  u->`@@`(op(u)));

D[1]@@3-D[1]@@2+2*D[1]-2

(2)

dsolve(L(y)(x));

y(x) = (1/4)*exp((1/2)*x)*cos((1/2)*7^(1/2)*x)*_C1+(1/4)*_C1*7^(1/2)*exp((1/2)*x)*sin((1/2)*7^(1/2)*x)-(1/4)*_C2*7^(1/2)*exp((1/2)*x)*cos((1/2)*7^(1/2)*x)+(1/4)*exp((1/2)*x)*sin((1/2)*7^(1/2)*x)*_C2+x+_C3

(3)

 

 

Download dsolveD.mw

It seems that you made yourself (using a palette?) a variable named alpha~. Don't do that, just use alpha. Actually it is much better to use % (or the label of the expression) rather than copy+paste or re-type the expression.
simplify(fracdiff(%, t, alpha));

Compute the series around x = 0. You will see that Maple's result is correct.

The procedure is very simple and practically it cannot be made faster (the bottleneck being isprime).
For n>28 you will need a lot of patience. But you can save f and rerun it another day, the computed values are saved too.
 

restart;
f:=proc(n::posint)
local a,b,c;
a,b:=f(n-2),f(n-1);
while not isprime((c:=a+b)) do a,b:=b,c od;
if n<13 then lprint(n=c) else
   printf("%d = %s ... %s len=%d\n", n, ""||c[1..10], ""||c[-10..-1], length(c)) fi; 
f(n):=c;
end proc:
f(1):=2:f(2):=3:

f(27):


3 = 5
4 = 13
5 = 31
6 = 313
7 = 2659
8 = 96979
9 = 97340263
10 = 96133996771
11 = 288596670839
12 = 35613385860024917251
13 = 1210855125 ... 1377274153 len=22
14 = 4191695536 ... 7350583473 len=23
15 = 1559140836 ... 5674347327 len=35
16 = 1169745412 ... 9762684239 len=40
17 = 3996415043 ... 1378463323 len=55
18 = 4535544101 ... 7757493097 len=64
19 = 2625668239 ... 2056367381 len=113
20 = 2276456306 ... 0210477381 len=138
21 = 2046360541 ... 3641285093 len=168
22 = 4162619505 ... 8047946001 len=271
23 = 1930123412 ... 5467084469 len=276
24 = 1665092783 ... 3398723741 len=287
25 = 7550383970 ... 9920377053 len=421
26 = 1325989112 ... 9358807409 len=691
27 = 1475647825 ... 1633573333 len=1030
 

A = A(i) can be proved to be equal to - (-d)^i. Use induction. Maple does not want to simplify A(i) to -(-d)^i. It would be possible to use Maple for A(i+1) etc, but it's easier by hand..

The rest is simple, because B = - A(i+1)/d = - (-d)^i = A(i).

A:= t -> numapprox:-infnorm((f_exact-f_numeric)(x,t), x=0..2):
numapprox:-infnorm('A'(t), t=0..2);
#                         0.02681084520

 

AA:=convert(A,rational):
bb:=convert(b,rational);
xx := LinearSolve(AA, bb);

 

restart;
g[2]:=0: g[1]:=1: g[3]:=1: alpha:=2: c:=1:
k:=(g[2]+2*g[3]-3*g[1]*alpha)/(6*g[1]*g[3]):
omega:=(((1-3*g[1]*k)*(2*k-c-3*g[1]*(k^2))  )/(g[1]))+(k^2)-g[1]*(k^3):
uu11:=1/(g[2]+2*g[3])^(1/2)*(-3*(3*k^2*g[1]+c-2*k))^(1/2
)*sin(1/2/g[1]*2^(1/2)*(g[1]*(3*k^2*g[1]+c-2*k))^(1/2)*(-c*t+x))/
cos(1/2/g[1]*2^(1/2)*(g[1]*(3*k^2*g[1]+c-2*k))^(1/2)*(-c*t+x))*exp(
I*(k*x-omega*t)):
pde:=I*Diff(u(x,t),t)+Diff(u(x,t),x$2)+alpha*(abs(u(x,t))^2)*u(x,t)+ 
I*( g[1]*Diff(u(x,t),x$3) + g[2]*(abs(u(x,t))^2)*u(x,t) + g[3]*Diff((abs(u(x,t))^2),x)*u(x,t) ):
eval(pde, u(x,t)=uu11):
Z:=value(%):
eval(Z, [x=1,t=2]): evalf(%);  # <>0
eval(Z, [x=2,t=1]): evalf(%);  # <>0

                  -12687.93889 - 28829.95560 I

                  25022.56665 - 19131.68293 I

The two functions are equal (f and the spline). This is normal, f being a polynomial of degree <=3). So, if you want to test your construction, choose another f.
convert(NaturalSpline(x) - f, rational) ; # ==> 0.

BTW. Your f is an expression, not a procedure. So, don't use f(x) because it's a nonsense. 

So, you probably want to approximate a solution of ODE0 by U0. Why not something like this?

restart;
ODE0:= diff(U(x),x$2) + A*U(x) + B*U(x)^3;
U0:=x -> sin(mu*x)/(K + L*cos(mu*x));
Z:=eval(ODE0, U=U0);
series(Z,x,4);
coeffs(convert(%,polynom),x);
solve([%],[K,L],explicit);

 

Maple is not a human. A student would make the change of variables e.g. x = t^(3/4), and then compute directly.
But Maple uses sometimes lookup tables (with patterns) such as int(x^a*(1+A*x^b)^c, x), in terms of special functions.
The conversion from these special functions to elementary ones is not always easy, or even possible.

BTW, in Maple 2020 the integral is computed directly.

First 28 29 30 31 32 33 34 Last Page 30 of 120