vv

5766 Reputation

9 Badges

3 years, 239 days

MaplePrimes Activity


These are answers submitted by vv

Linearization (near x0) simply means replacing f(x) with f(x0) + f'(x0) (x - x0).

Note that in finite dimensions, f'(x0) is identified with the Jacobian.

So, of course Maple is able to do it, and it's simple, as you see.

eq := t = indets(f, sqrt)[];
factor(eval(f,solve(eq,{k}))) assuming t>=0;
eval(%,eq);

 

It's easy to setup the problem, but it seems that Maple needs a very long time to solve it.
I wonder whether it can be done in a reasonable amount of time (days?).

restart;
we:=[1,2,8,9,15,16,22,23,29,30]:
wd:=[3,4,5,6,7,10,11,12,13,14,17,18,19,20,21,24,25,26,27,28]:
cond1 := seq(seq(  add(x[i,j,k], i=1..20)>=4,  j=1..30), k=1..2):
cond2 := seq(seq(  add(x[i,j,k], j=wd)>=4,   i=1..20), k=1..2):
cond3 := seq(seq(  add(x[i,j,k], j=we)>=2,   i=1..20), k=1..2):
cond4 := seq(seq( 2*x[i,j,2]+x[i,j+1,1]+x[i,j+1,2]<=2, i=1..20), j=1..29):
cond5 := seq(p[i] = add(add(x[i,j,k],j=1..30),k=1..2)-12,  i=1..20):
cond6 := seq( [p[i]<=q[i], -p[i]<=q[i]][], i=1..20):
Optimization:-LPSolve( add(q[i],i=1..20), {seq(cond||i, i=1..6)}, binaryvariables=indets([cond1]) );

 

Probably you want
numapprox:-infnorm(y-mExact, 0..1);
       
2.045889353*10^(-7)

Rewrite the recurrence:

rsolve({f(n+1)-f(n) = 1+f(n), f(1)=1}, f(n))

      2^n-1

 

Not all mathematical functions have evalhf implementation. pochhammer is one of them. See ?evalhf/fcnlist

You will have to use evalf instead.


 

F := (x,y,z) -> sin(1/x+1/(y*z^2)):
eval(series(F(x/t,y/t,z/t),t), t=1);

     1/x + 1/(y*z^2) - 1/(6*x^3) - 1/(2*y*z^2*x^2) + 1/(120*x^5)

You can use the package LinearAlgebra:-Generic.
It has not a Rank command, but there is ReducedRowEchelonForm which can be used easily to compute the rank.

 

If you want to check the inequality, use a random test.
Probably it's easier to construct your own:

restart;
fn := (a^(n+1)-b^(n+1))< c*(a^n-b^n);
r:=rand(0.0 .. 1):
rn:=rand(1..10):
N:=100000: OK:=0:  ex:=[];
to N do
  c:=r(): b:=c*r(): a:=b*r(); n:=rn():
  if (fn) then OK:=OK+1 else ex:=[a,b,c,n] fi
od:
'OK'=OK,'N'=N, 'counterexample'=ex;

    OK = 7393, N = 100000, counterexample = [0.2282758836, 0.6582892290, 0.6718939194, 5]

So, it is not true, and you have a counter-example.
(It is possible to exit the loop as soon as you find one.)

 

restart;

with(LinearAlgebra):  

A := <1, 0, -1, 3;  0, 2, 1, 0;  -1, 1, 6, -1;  3, 0, -1, 10>;
b := <0,-2,-1,-1>;   
f := x -> 1/2 * x^+ . A . x + b^+ . x:
v0:=<0.,1.,0.,0.> :
g0:=A . v0 + b:  
H0:=A^0:  
tot:=0:  

Matrix(4, 4, {(1, 1) = 1, (1, 2) = 0, (1, 3) = -1, (1, 4) = 3, (2, 1) = 0, (2, 2) = 2, (2, 3) = 1, (2, 4) = 0, (3, 1) = -1, (3, 2) = 1, (3, 3) = 6, (3, 4) = -1, (4, 1) = 3, (4, 2) = 0, (4, 3) = -1, (4, 4) = 10})

 

Vector[column](%id = 18446744074412437742)

(1)

while   (Norm(g0) > 1e-6) do;  
  d0 := -H0 . g0;    
  alpha0 := - g0^+ . d0 / (d0^+ . A . d0);  
  v1 := v0 +alpha0*d0;  
  g1 := A.v1 + b;      
  p0 := v1 - v0;  
  q0 := g1 - g0;  
  H1 := H0 - (H0 . q0. q0^+ . H0)/(q0^+ .H0 . q0) + (p0 . p0^+)/(p0^+ . q0);    
  v0 := v1;  
  H0 := H1;  
  g0 := g1;  
  tot:=tot+1;  
od:  
v0, g0, 'tot'=tot;

Vector(4, {(1) = -31.0000000940274, (2) = 2.99999999568687, (3) = -4.00000000551055, (4) = 9.00000002769014}), Vector(4, {(1) = -0.5446384677e-8, (2) = -0.1413682060e-7, (3) = 0.2896076268e-7, (4) = 0.3298907814e-9}), tot = 4

(2)

 


Download linsys.mw

Just delete the # in the last line and then press ENTER.

simplify(expand(f)) assuming x>0;

 

So, you want an example. The problem is interesting.

For any a[n]>0 converging to 0 very fast, P(n) will have n (negative) roots.
A concrete example is a[n] = 1 / 2^(3^n).

Check:

P:= n -> add(x^k/ 2^(3^k), k=0..n):
seq( [n, nops([fsolve(P(n))])], n=1..14);

    [1, 1], [2, 2], [3, 3], [4, 4], [5, 5], [6, 6], [7, 7], [8, 8], [9, 9], [10, 10], [11, 11], [12, 12], [13, 13], [14, 14]

Unfortunately for n>14 Maple will have problems here because 2^(3^15) has > 4*10^6 digits and the roots are also huge.

The integral can be computed.

J := fun11[1]
result11:=eval(subsop(2=s,J));

You have now the indefinite integral. It is a huge elementary expression (because you have a lot of parameters).
I do not know why you need it symbolically.
Anyway, in order to obtain the definite integral it's not possible to use directly the Newton-Leibniz formula.
(You can of course do it but the result will be generic and twice bigger).

You will have to check that  result11 is continuous in your interval; this will depend on the parameters.
In case of discontinuities, the integral must be split first. That's why Maple does not do it: there are too many possibilities, and the expressions involved are huge.

 

restart;
with(LinearAlgebra):
A := Matrix(4, 4, {(1, 1) = 1, (1, 3) = -1, (1, 4) = 3, (2, 2) = 2, (2, 3) = 1, (3, 1) = -1, (3, 2) = 1, (3, 3) = 6, (3, 4) = -1, (4, 1) = 3, (4, 3) = -1, (4, 4) = 10}, fill = 0):
b := Matrix(4, 1, {(1, 1) = 0, (2, 1) = -2, (3, 1) = -1, (4, 1) = -1}):
x := Matrix([[x1], [x2], [x3], [x4]]):
f := x -> (((1/2*Transpose(x)) . A) . x) + ((Transpose(b)) . x):
v0 := Matrix([[0.], [1.], [0.], [0.]]):
g := x -> (A . x) + b:
while   (Norm(g(v0)) > 1e-6) do;
  alpha0 := solve(diff(f(v0 - g(v0)*alpha)[1, 1], alpha) = 0);
  v0 := v0 - alpha0*g(v0);
od:
v0, g(v0);

Note that LinearSolve(A,b);  gives

1 2 3 4 5 6 7 Last Page 1 of 67