Exact solution of nonlinear ODE? ...

restart:with(plots):
eq:=(diff(f(eta),eta\$2))-a*f(eta)+b*(1+diff(f(eta),eta)^2)^(-1/2)=0;
bc:=f(1)=0,D(f)(0)=0;
ans := dsolve(eq);

Sparse Matrix Products in Maple

by: Maple

I thought I would share some code for computing sparse matrix products in Maple.  For floating point matrices this is done quickly, but for algebraic datatypes there is a performance problem with the builtin routines, as noted in http://www.mapleprimes.com/questions/205739-How-Do-I-Improve-The-Performance-Of

The code is fairly straightforward in that it uses op(1,A) to extract the dimensions and op(2,A) to extract the non-zero elements of a Matrix or Vector, and then loops over those elements.  I included a sparse map function for cases where you want to map a function (like expand) over non-zero elements only.

`# sparse matrix vector productspmv := proc(A::Matrix,V::Vector)local m,n,Ae,Ve,Vi,R,e;  n, m := op(1,A);  if op(1,V) <> m then error "incompatible dimensions"; end if;  Ae := op(2,A);  Ve := op(2,V);  Vi := map2(op,1,Ve);  R := Vector(n, storage=sparse);  for e in Ae do    n, m := op(1,e);    if member(m, Vi) then R[n] := R[n] + A[n,m]*V[m]; end if;  end do;  return R;end proc:`
`# sparse matrix productspmm := proc(A::Matrix, B::Matrix)local m,n,Ae,Be,Bi,R,l,e,i;  n, m := op(1,A);  i, l := op(1,B);  if i <> m then error "incompatible dimensions"; end if;  Ae := op(2,A);  Be := op(2,B);  R := Matrix(n,l,storage=sparse);  for i from 1 to l do    Bi, Be := selectremove(type, Be, (anything,i)=anything);    Bi := map2(op,[1,1],Bi);    for e in Ae do      n, m := op(1,e);      if member(m, Bi) then R[n,i] := R[n,i] + A[n,m]*B[m,i]; end if;    end do;  end do;  return R;end proc:`
`# sparse mapsmap := proc(f, A::{Matrix,Vector})local B, Ae, e;  if A::Vector then    B := Vector(op(1,A),storage=sparse):  else    B := Matrix(op(1,A),storage=sparse):  end if;  Ae := op(2,A);  for e in Ae do    B[op(1,e)] := f(op(2,e),args[3..nargs]);  end do;  return B;end proc:`

As for how it performs, here is a demo inspired by the original post.

`n := 674;k := 6;`
`A := Matrix(n,n,storage=sparse):for i to n do  for j to k do    A[i,irem(rand(),n)+1] := randpoly(x):  end do:end do:`
`V := Vector(n):for i to k do  V[irem(rand(),n)+1] := randpoly(x):end do:`
`C := CodeTools:-Usage( spmv(A,V) ):  # 7ms, 25x fasterCodeTools:-Usage( A.V ):  # 174 ms`
`B := Matrix(n,n,storage=sparse):for i to n do  for j to k do    B[i,irem(rand(),n)+1] := randpoly(x):  end do:end do:`
`C := CodeTools:-Usage( spmm(A,B) ):  # 2.74 sec, 50x fasterCodeTools:-Usage( A.B ):  # 2.44 min`
`# expand and collect like termsC := CodeTools:-Usage( smap(expand, C) ):`

How to find exact value of it?...

I try to find the exact (symbolic) value of

(-2*sqrt(7)-4)*EllipticK((1/8)*sqrt(2)*(-3+sqrt(7)))^2+4*EllipticE(-(1/8)*sqrt(2)*(-3+sqrt(7)))*sqrt(7)*EllipticK((1/8)*sqrt(2)*(-3+sqrt(7)))

I tried 'simplify' with different options and 'convert'. It would be pi=3.141... as numerical approximation suggests.

Many thanks.

How to find exact solution of ODE?...

EF.3.mwHi, I want to ask that how to find the exact solution of equation without applying any technique

how to avoid the float(undefined)...

Hello,

Good day.

How to avoid float(undefined) for v3, v4,v5 in this problem.

compact solution to an ode...

hello,

restart:

ODE:=diff(T(z),z\$2)+A1*(S-1/L+1/L*exp(-L*z))*diff(T(z),z)+A2*T(z)=0;

bcs:=T(0)=1,T(infinity)=0;

bcs:=T(0)=1,T(A3)=0;

dsolve({ODE,bcs});

where, A1, A2, A3, L, S are all constants.

i get an exact solution but is there any way around to get a more compact solution?

exact code for pde...

hey friends am stuck with some code. My code is correct and am trying to find exact solution but not able to see output. Please kindly check it and let me know exact_solution.mw

Maple 13 fails to find exact solution...

hi friends am using maple 13 which is unable to find exact solutions for pdes

because for exact solution i should have maple 15 but am not able to install that so please can anyone of u can find exact sloution for me of the pde

pde := diff(U(x, y), x, x)-3*(diff(U(x, y), y, y))+16 = 0 where boundary conditions are

U=0 on x=1,-1

U=0 on x=1,-1

diff(U(x, y), y) = -U on y=1, -1< x

diff(U(x, y), y) = U on y=-1, -1< x

finding exact solution through maple...

Can we find exact solution of PDE with help of maple?

If it is yes the please let me how to write commands for parabolic pde

ut=k uxx with boundary conditions u(0,t)=u(l,t)=0 and initial condition u(x,0)=e-x

consider:

`assume(k[f1]>0,k[f2]>0,k[f2]>k[f1],h_bar>0,m>0);`
` `
`h_bar:=1.0545e-34;m:=0.10938e-31;n[0]=1e28;> eq1:=n=(k[f1]^3+k[f2]^3)/6/Pi^2;> eq2:=e*V=h_bar^2/2/m*(k[f2]^2-k[f1]^2);`
`> solve({eq1,eq2},{k[f1],k[f2]});`

in the final command i get a very messy numerical&symbolic results like

```{k[f1] = 1016612041.*
(-1.*RootOf(9456017282782496601177464289*n^2*Pi^4...```

maple evaluate function...

Hi

I am usign dsolve for maple to give my a fuction z(t) . Maple solves the differential equation but i want maple to give me the exact number for specific t values z(60) and so on. But maple is given as an answer z(60) and not a number

How to plot an identical graph over the several pe...

Can someone help me to generate the same, identical grpah over several periods in x-axis? In exact term, I mean that I need to plot a periodical grpah, that repeats itself over the interval? It is like given a periodical function and now have to draw it many times...(function can be any form, not only sine and cosine)

How can I make Maple compute with expressions inst...

Like when I type

1/2^2;

it gives

1/4

but if I type

0.5^2;

it gives

0.25

I want it to consider 0.5 as 1/2, because sometimes I make computations on large equations and I want to have access to the symbolic output, not the numeric output.

 Page 1 of 1
﻿