emrantohidi

15 Reputation

2 Badges

11 years, 24 days

MaplePrimes Activity


These are questions asked by emrantohidi

Dear Maple researchers

 

I have a problem in solving a system of odes that resulted from discretizing, in space variable, method of lines (MOL).

The basic idea of this code is constructed from the following paper:

http://www.sciencedirect.com/science/article/pii/S0096300313008060

If kindly is possible, please tell me whas the solution of this problem.

With kin dregards,

Emran Tohidi.

My codes is here:

> restart;
> with(orthopoly);
print(`output redirected...`); # input placeholder
> N := 4; Digits := 20;
print(`output redirected...`); # input placeholder

> A := -1; B := 1; rho := 3/4;
> g1 := proc (t) options operator, arrow; 1/2+(1/2)*tanh((1/2)*(A-(2*rho-1)*t/sqrt(2))/sqrt(2)) end proc; g2 := proc (t) options operator, arrow; 1/2+(1/2)*tanh((1/2)*(B-(2*rho-1)*t/sqrt(2))/sqrt(2)) end proc;
print(`output redirected...`); # input placeholder
> f := proc (x) options operator, arrow; 1/2+(1/2)*tanh((1/2)*x/sqrt(2)) end proc;
print(`output redirected...`); # input placeholder
> uexact := proc (x, t) options operator, arrow; 1/2+(1/2)*tanh((1/2)*(x-(2*rho-1)*t/sqrt(2))/sqrt(2)) end proc;
print(`output redirected...`); # input placeholder
> basiceq := simplify(diff(uexact(x, t), `$`(t, 1))-(diff(uexact(x, t), `$`(x, 2)))+uexact(x, t)*(1-uexact(x, t))*(rho-uexact(x, t)));
print(`output redirected...`); # input placeholder
                                      0
> alpha := 0; beta := 0; pol := P(N-1, alpha+1, beta+1, x); pol := unapply(pol, x); dpol := simplify(diff(pol(x), x)); dpol := unapply(dpol, x);
print(`output redirected...`); # input placeholder
> nodes := fsolve(P(N-1, alpha+1, beta+1, x));
%;
> xx[0] := -1;
> for i to N-1 do xx[i] := nodes[i] end do;
print(`output redirected...`); # input placeholder
> xx[N] := 1;
> for k from 0 to N do h[k] := 2^(alpha+beta+1)*GAMMA(k+alpha+1)*GAMMA(k+beta+1)/((2*k+alpha+beta+1)*GAMMA(k+1)*GAMMA(k+alpha+beta+1)) end do;
print(`output redirected...`); # input placeholder
> w[0] := 2^(alpha+beta+1)*(beta+1)*GAMMA(beta+1)^2*GAMMA(N)*GAMMA(N+alpha+1)/(GAMMA(N+beta+1)*GAMMA(N+alpha+beta+2));
print(`output redirected...`); # input placeholder
> for jj to N-1 do w[jj] := 2^(alpha+beta+3)*GAMMA(N+alpha+1)*GAMMA(N+beta+1)/((1-xx[jj]^2)^2*dpol(xx[jj])^2*factorial(N-1)*GAMMA(N+alpha+beta+2)) end do;
print(`output redirected...`); # input placeholder
> w[N] := 2^(alpha+beta+1)*(alpha+1)*GAMMA(alpha+1)^2*GAMMA(N)*GAMMA(N+beta+1)/(GAMMA(N+alpha+1)*GAMMA(N+alpha+beta+2));
print(`output redirected...`); # input placeholder
> for j from 0 to N do dpoly1[j] := simplify(diff(P(j, alpha, beta, x), `$`(x, 1))); dpoly1[j] := unapply(dpoly1[j], x); dpoly2[j] := simplify(diff(P(j, alpha, beta, x), `$`(x, 2))); dpoly2[j] := unapply(dpoly2[j], x) end do;
print(`output redirected...`); # input placeholder
print(??); # input placeholder
> for n to N-1 do for i from 0 to N do BB[n, i] := sum(P(jjj, alpha, beta, xx[jjj])*dpoly2[jjj](xx[n])*w[i]/h[jjj], jjj = 0 .. N) end do end do;
> for n to N-1 do d[n] := BB[n, 0]*g1(t)+BB[n, N]*g2(t); d[n] := unapply(d[n], t) end do;
print(`output redirected...`); # input placeholder
> for nn to N-1 do F[nn] := simplify(sum(BB[nn, ii]*u[ii](t), ii = 1 .. N-1)+u[nn](t)*(1-u[nn](t))*(rho-u[nn](t))+d[nn](t)); F[nn] := unapply(F[nn], t) end do;
print(`output redirected...`); # input placeholder
> sys1 := [seq(d*u[q](t)/dt = F[q](t), q = 1 .. N-1)];
print(`output redirected...`); # input placeholder
[d u[1](t)                                                                
[--------- = 40.708333333333333334 u[1](t) + 52.190476190476190476 u[2](t)
[   dt                                                                    

                                                                  2          3
   + 39.958333333333333334 u[3](t) - 1.7500000000000000000 u[1](t)  + u[1](t)

   + 7.3392857142857142858

   - 3.6696428571428571429 tanh(0.35355339059327376220

   + 0.12500000000000000000 t) - 3.6696428571428571429 tanh(
                                                     d u[2](t)   
-0.35355339059327376220 + 0.12500000000000000000 t), --------- =
                                                        dt       
-20.416666666666666667 u[1](t) - 25.916666666666666667 u[2](t)

                                                                  2          3
   - 20.416666666666666667 u[3](t) - 1.7500000000000000000 u[2](t)  + u[2](t)

   - 3.7500000000000000000

   + 1.8750000000000000000 tanh(0.35355339059327376220

   + 0.12500000000000000000 t) + 1.8750000000000000000 tanh(
                                                     d u[3](t)                
-0.35355339059327376220 + 0.12500000000000000000 t), --------- = 29.458333333\
                                                        dt                    

  333333333 u[1](t) + 38.476190476190476190 u[2](t)

                                                                  2          3
   + 30.208333333333333333 u[3](t) - 1.7500000000000000000 u[3](t)  + u[3](t)

   + 5.4107142857142857144

   - 2.7053571428571428572 tanh(0.35355339059327376220

   + 0.12500000000000000000 t) - 2.7053571428571428572 tanh(
                                                   ]
-0.35355339059327376220 + 0.12500000000000000000 t)]
                                                   ]
> ics := seq(u[qq](0) = evalf(f(xx[qq])), qq = 1 .. N-1);
print(`output redirected...`); # input placeholder
    u[1](0) = 0.38629570659055483825, u[2](0) = 0.50000000000000000000,

      u[3](0) = 0.61370429340944516175
> dsolve([sys1, ics], numeic);
%;
Error, (in dsolve) invalid input: `PDEtools/sdsolve` expects its 1st argument, SYS, to be of type {set({`<>`, `=`, algebraic}), list({`<>`, `=`, algebraic})}, but received [[d*u[1](t)/dt = (20354166666666666667/500000000000000000)*u[1](t)+(13047619047619047619/250000000000000000)*u[2](t)+(19979166666666666667/500000000000000000)*u[3](t)-(7/4)*u[1](t)^2+u[1](t)^3+36696428571428571429/5000000000000000000-(36696428571428571429/10000000000000000000)*tanh(1767766952966368811/5000000000000000000+(1/8)*t)-(36696428571428571429/10000000000000000000)*tanh(-1767766952966368811/5000000000000000000+(1/8)*t), d*u[2](t)/dt = -(20416666666666666667/1000000...

Dear All

 

I have a question:

How can I computet the laplace inverse of a function that is below!

My version of Maple is 13:

It should be noted that r>0, \rho>0.5, y\in R.

 

> restart;
> with(MTM);
print(??); # input placeholder
> ilaplace(r^(rho-.5)*abs(y)^(rho-1)*exp(-r*y)/GAMMA(rho-.5), s);

Dear Maple users

 

I have a question about applying pdsolve MAPLE for solving two dimensional heat equations:

My codes have been provided but it shows to me this error:

Error, (in pdsolve/numeric/process_PDEs) can only numerically solve PDE with two independent variables, got {t, x, y}

If kindly is possible, please help me in this case.

 

With kind regards,

Emran Tohidi.

 

> restart;
> with(plots);
print(??); # input placeholder
> with(PDEtools);
print(??); # input placeholder
> declare(u(x, y, t));
print(`output redirected...`); # input placeholder
                    u(x, y, t) will now be displayed as u
> S := 1/100; tR := 0 .. 1; xR := 0 .. 1; yR := 0 .. 1; NF := 30; NP := 100;
print(??); # input placeholder
> N := 3; L1 := [red, blue, green]; L2 := [0, 1/2, 1]; Ops := spacestep = S, timestep = S;
print(??); # input placeholder
> Op1 := frames = NF, numpoints = NP;
print(??); # input placeholder
> PDE1 := diff(u(x, y, t), t)-(diff(u(x, y, t), `$`(x, 2)))-(diff(u(x, y, t), `$`(y, 2))) = 0;
print(??); # input placeholder
> IC := {u(x, y, 0) = exp(x+y)}; BC := {u(0, y, t) = exp(2*t+y), u(1, y, t) = exp(2*t+y+1), u(x, 0, t) = exp(2*t+x), u(x, 1, t) = exp(2*t+x+1)};
print(??); # input placeholder
> Sol := pdsolve(PDE1, `union`(IC, BC), numeric, u(x, t), Ops);
Error, (in pdsolve/numeric/process_PDEs) can only numerically solve PDE with two independent variables, got {t, x, y}


Dear Friends

I have a problem in CPU time in MAPLE.

I write the codes in maple related to the nonlinear heat conduction problem in one dimension by Collocation method, but after 30 minutes no solution has been observed!!!

My codes are for N=4!, i.e., I have 25 equations with 25 unknowns!!!

If MAPLE can not solve this simple system, How can I solve 3 dimensional pdes by N=9,

In this case, I have 1000 equations with 1000 unknowns!!!

please help me and suggest me a fast iterative solver.

I should remark that my problem is stated in this paper

http://www.sciencedirect.com/science/article/pii/S1018364713000025

If there exist any other suitable method, I will be happy to receive any support.

 

With kind regards,

Emran Tohidi.

 

> restart;
> Digits := 20; N := 4; st := time(); u := sum(sum(a[m, n]*x^m*t^n, m = 0 .. N), n = 0 .. N); u := unapply(u, x, t); ut := diff(u(x, t), `$`(t, 1)); ut := unapply(ut, x, t); ku := simplify(1+u(x, t)^2); ku := unapply(ku, x, t); ux := diff(u(x, t), `$`(x, 1)); ux := unapply(ux, x, t); K := ku(x, t)*ux(x, t); K := unapply(K, x, t); Kx := diff(K(x, t), `$`(x, 1)); Kx := unapply(Kx, x, t); f := proc (x, t) options operator, arrow; x*exp(t)*(1-2*exp(2*t)) end proc;
print(`output redirected...`); # input placeholder
> S1 := {seq(u(i/N, 0)-i/N = 0, i = 0 .. N)}; S2 := {seq(u(0, j/N) = 0, j = 1 .. N)}; S3 := {seq(u(1, j/N)+ux(1, j/N)-2*exp(j/N) = 0, j = 1 .. N)}; S4 := {seq(seq(Kx(i/N, j/N)+f(i/N, j/N)-ut(i/N, j/N) = 0, i = 1 .. N-1), j = 1 .. N)}; S := `union`(`union`(`union`(S1, S2), S3), S4); sol := DirectSearch:-SolveEquations([op(S)], tolerances = 10^(-4), evaluationlimit = 1000000);
print(`output redirected...`); # input placeholder
> assign(sol);
%;
> u(x, t);
> CPUTIME := time()-st;
plot3d(u(x, t) - x exp(t), x = 0 .. 1, t = 0 .. 1)

Dear All

 

I have a question about applying fsolve in MAPLE.

These codes come from an applicable model from heat transfer.

I previously solve such systems, but the fsolve takes long time, for example for N=2, I have 12 equations with 12 unknowns. But the fsolve does not work!

I try by N=3 or N=4, but a similar result has been obtained.

 

If kindly is possible, please give me a help for using fsolve more efficiently that solve my problem.

I have MAPLE 13 in my PC.

 

With kind regards,

Emran Tohidi.

 

> restart;
> with(orthopoly);
print(`output redirected...`); # input placeholder
> Digits := 20;
> N := 3; f := proc (x) options operator, arrow; cos(Pi*(x-1/2)) end proc; h1 := proc (t) options operator, arrow; 0 end proc; h2 := proc (t) options operator, arrow; 0 end proc; E := proc (t) options operator, arrow; cos(.2*Pi)*exp(-t^2) end proc;
print(`output redirected...`); # input placeholder
> u := sum(sum(b[m, n]*P(m, 2*x-1)*P(n, 2*t-1), m = 0 .. N), n = 0 .. N);
print(`output redirected...`); # input placeholder
> u := unapply(u, x, t);
print(`output redirected...`); # input placeholder
> ut := diff(u(x, t), `$`(t, 1)); ut := unapply(ut, x, t);
print(`output redirected...`); # input placeholder
> uxx := diff(u(x, t), `$`(x, 2)); uxx := unapply(uxx, x, t);
print(`output redirected...`); # input placeholder
> a := sum(c[m]*P(m, 2*t-1), m = 0 .. N); a := unapply(a, t);
print(`output redirected...`); # input placeholder
> A := fsolve(P(N+1, 2*x-1) = 0);
print(`output redirected...`); # input placeholder
> S1 := {seq(seq(ut(A[i], A[j])-a(A[j])*uxx(A[i], A[j]) = 0, i = 2 .. N), j = 2 .. N+1)}; S2 := {seq(u(A[i], 0)-f(A[i]) = 0, i = 2 .. N)}; S3 := {seq(u(0, A[j])-h1(A[j]) = 0, j = 1 .. N+1)}; S4 := {seq(u(1, A[j])-h2(A[j]) = 0, j = 1 .. N+1)}; S5 := {seq(u(.3, A[j])-E(A[j]) = 0, j = 1 .. N+1)}; S := `union`(`union`(`union`(`union`(S1, S2), S3), S4), S5);
print(`output redirected...`); # input placeholder
> sol := fsolve(S);



1 2 Page 1 of 2