MaplePrimes Questions

Hi!

I am a new user to maple and I have tried to solve a partial differential equation.

The solution is shown in the figure above but I don't know how to make a 3d plot or contour plot of the solution. The code of solving pde is down below:

restart;
pde := diff(T(x, y), x $ 2) + diff(T(x, y), y $ 2) = 0;
bc := T(0, y) = T1, T(a, y) = T2, T(x, 0) = T2, k*D[2](T)(x, b) = h*(-T(x, b) + T3);
sol1 := simplify((pdsolve([pde, bc], T(x, y)) assuming (0 < a, 0 < b)));

and the constant value are:  a = 250, b = 4, k = 2.091, T1 = -5, T2 = 0, h = 100, T3 = 1000

the plot range is 0<x<250, 0<y<4.

Thank you for helping me!

 

 

From another question I asked, I learned that parse("string") returns an unevaluated Maple expression. 

But in interactive mode (in worksheet), the result looks the same as normal evaluated expression. That is why I did not know this. For example

ode1:= :-parse("diff(y(x),x$2)=0");
ode2:= diff(y(x),x$2)=0;

it gives

There is no difference when looking at it.  That is why when I was in Maple debugger, I could not see why Maple was complaining about it. An eval  was needed.

I looked at the types to see if there is something like type(variable,`unevaluated`) or such, and could not find one.

If Maple can at least display unevaluated expression with different color, or different notations when in the worksheet interface,  I would have noticed that parse returns unevaluated expression.

In Mathematica, these things are done using wrappers, (called Hold or Inactive) but these are visible in the notebook and use different color shading or Hold is present and had to expliclity removed,  and so looking at them, one can see the differerence between the expressions. 

How can one in Maple distinguish between unevaluated expression such as ode1 above and evaluated one such as ode2 above?  This can be useful to use inside a proc for example.  Is there an option in the GUI itself to tell Maple may be to color each differently?

 

According to the help manual...

To perform an action when the data table is updated, click the data table, and then, from the Data Table context panel, select Edit Content Changed Code to open the Code Editor dialog for the data table.

I am unable to make this work, nothing happens when I click on that button.

Edit - Component code - shows everything greyed out.

Any hints?

I can't figure why dsolve and odeadvisor fail to process ode when it is parsed from string and only inside a proc, but works ok in global space.

This works OK:

restart;
ode  :=  :-parse("diff(y(x),x$2)=0"):
func := :-parse("y(x)"):

dsolve(ode);
DEtools:-odeadvisor(ode,func);

But the same code, when inside a proc, fail

restart;
foo:=proc()
  local ode,func;  
  local x,y; #adding this did not  help

  ode  :=  :-parse("diff(y(x),x$2)=0");
  func :=  :-parse("y(x)");

  dsolve(ode);
  try
     DEtools:-odeadvisor(ode,func);
  catch:
     error lastexception;
  end try;

end proc;

foo()

It seems to have with name scoping, but I do not see what is the problem. :-parse works fine.

How to resolve this? Since I must use :-parse as I am reading the ode as string from database with Maple as string from inside a proc inside a module and the above is just a simple example that shows the problem.

Maple 2020.1 with Physics 724

I know for ordinairy differential equations (ODE) there is a odeadvisor in Maple what shows information about the equation .

What is is possible with a partial differential equations (PDE) package.
Is there a help like for ODE's ?

The following is my code, it is working but when I add third model in pde1 , it is not working .

Note that: u :people move to right,w: move to left,v: infected people and stationary(not move)

please help me to reconize the problem

restart;
with(PDEtools);
with(plots);
pde1 := {diff(u(x, t), t) + Gamma*diff(u(x, t), x) = mu(w - u) - 0.5*beta*v*(w - u) - beta*u*v, diff(w(x, t), t) - Gamma*diff(w(x, t), x) = mu(u - w) - 0.5*beta*v*(u - w) - beta*w*v,diff(v(x,t),t)=beta*u*v-alpha*v};
  
IBC1 := {u(0, t) = 0, u(x, 0) = exp(-200*(x - 0.4)^2), w(1, t) = 0, w(x, 0) = exp(-200*(x - 0.6)^2),v(x,0)=0,v(0,t)=sin(t)};
mu := 0.0009;
Gamma := 10;alpha:=1;beta:=0.1
            
pds1 := pdsolve(pde1, IBC1, numeric, time = t, range = 0 .. 1, spacestep = 0.001);
 

 

[[p__jb = (Typesetting[delayDotProduct](c__a . ((rho*(-1+alpha)*t__a-alpha*t__b)/(t__b*t__a)), t__b, true)*t__a+((c__b+`p__-jb`)*alpha-c__b-t__b-`p__-jb`)*t__a-alpha*t__b*(c__b+`p__-jb`))/((2*alpha-2)*t__a-2*alpha*t__b)]]

I cannot seem to set up this integral correctly:

Gradshteyn 3.529

I think maple should do it.

`assuming`([int(((cosh(a*x)-1)/sinh(b*x))(1/x), x = 0 .. infinity)], [b > abs(a)])

I wonder where I'm going wrong here? Thank you in advance.

hi

I'm working on my thesis,to solve a particular problem,I created a 84*84 matrix in Matlab.

I want to calculate the determinat of that matrix in maple,so from tools>assistance>import date added this matrix in maple.

every thing seems to be ok but when i want to caculate the determinant this error apears :

 Error, (in LinearAlgebra:-Determinant) matrix must be square

does anybody know what is the problem here?

Also sorry for my weak English 

and it's worth mentioning that I'm a beginner in maple programming 

thank you

 

 

Since I've updated maple to version 2019 it's has become very slow. Erverytime I enter something it seems to reload all the side buttons just like when a new worksheet is started. This is very annoying because during this loading time you cannot enter anything. Has anyone any suggestions? btw I've bought my pc in march 2020 and it has enough CPU and GPU.

 

 

i have a nonlinear inequality which is plotted using plots:-inequl
can i find an algebric solution for this inequality? for example sth like this : 0.08<t<10 
thnx in advance

 

restart:with(plots):with(Optimization):

with(SolveTools[Inequality]):

k := 1; c := 5; sigma := .85;N=10;

1

 

5

 

.85

 

N = 10

(1)

x:=t->4*exp(-t);

proc (t) options operator, arrow; 4*exp(-t) end proc

(2)

t0:=0.0065:

inequal(sigma*k/(2*c+k)*abs(x(t))<abs(x(t)-x(t0)),t=0..10,x=0..4)

 

 

 

NULL


 

Download inequality.mw

Hi, 

 

Let S(N) the set of all N by N matrices defined this way:

  • each element of a matrix M in S(N) is an integer number between 1 and included N^2
  • all the elements of M are different

For instance the matrix M = < <1, 2>|<3, 4> > belongs to S(2).

I'm interesting in finding the number of singular matrices of S(N), and more reasonnably of S(N <=3).
It's easy to verify that no matrix in S(2) is singular.
For S(3) now: as S(3) contains only 9! = 362880 elements a brute force approach can still be used. It showed that 2736 matrices were singular (about 0.75%).
But I wonderded if a more elegant approach could be used?
In the attached file I wrote all the relations elements of S(2) (and next S(3)) must verify and solved these equations for integer solutions (I only accounted for singular matrices . The case S(2) is tractable, but not S(3) (at least on my computer).

So my question: do you have any idea of some method to tackle this problem, or are you aware of any theoritical results about this issue?

PS: of course a statistical approach in which elements of S(N) would be generated using random permutations of [$1..N^2] is still possible to get a crude approximation of the number of singular matrices, but I'm not interested in this kind of approach.

Thanks in advance


 

restart:

alias(det = LinearAlgebra[Determinant])

det

(1)

 

Brute Force

 

S    := 0:
p    := 3:
PERM := combinat:-permute(p^2):
for perm in PERM do
  M := Matrix(p, p, perm):
  if det(M)=0 then S := S+1; end if:
end do:
S;
evalf(S/9!);

2736

 

0.7539682540e-2

(2)

 

A non systematic approach

Case of S(2)

 

M := Matrix(2, 2, symbol=m):
iM := {indices(M)}:

# set of all relations that define the elements of S(2)

rels :=
  {
    det(M) = 0,

    # each term is equal to an integer between 1 and 4 included

    mul((M[1, 1]-k), k=1..4)=0,
    mul((M[1, 2]-k), k=1..4)=0,
    mul((M[2, 1]-k), k=1..4)=0,
    mul((M[2, 2]-k), k=1..4)=0,

    # the sum of all the terms is equal to 10

    # M[1, 1]+M[1, 2]+M[2, 1]+M[2, 2]=10,

    # all the terms are different

    seq( mul(seq((M[op(im)]-M[op(ij)]), ij in iM minus {im})) <> 0, im in iM)
  }

{(m[1, 1]-1)*(m[1, 1]-2)*(m[1, 1]-3)*(m[1, 1]-4) = 0, (m[1, 2]-1)*(m[1, 2]-2)*(m[1, 2]-3)*(m[1, 2]-4) = 0, (m[2, 1]-1)*(m[2, 1]-2)*(m[2, 1]-3)*(m[2, 1]-4) = 0, (m[2, 2]-1)*(m[2, 2]-2)*(m[2, 2]-3)*(m[2, 2]-4) = 0, m[1, 1]*m[2, 2]-m[1, 2]*m[2, 1] = 0, (m[1, 1]-m[1, 2])*(m[1, 1]-m[2, 1])*(m[1, 1]-m[2, 2]) <> 0, (m[1, 2]-m[1, 1])*(m[1, 2]-m[2, 1])*(m[1, 2]-m[2, 2]) <> 0, (m[2, 1]-m[1, 1])*(m[2, 1]-m[1, 2])*(m[2, 1]-m[2, 2]) <> 0, (m[2, 2]-m[1, 1])*(m[2, 2]-m[1, 2])*(m[2, 2]-m[2, 1]) <> 0}

(3)

isolve(rels);  # no solution founds

 

A non systematic approach

Case of S(3)

 

 

M := Matrix(3, 3, symbol=m):
iM := {indices(M)}:

rels :=
  {
    det(M) = 0,

    # each term is equal to an integer between 1 and 9 included

    mul((M[1, 1]-k), k=1..9)=0,
    mul((M[1, 2]-k), k=1..9)=0,
    mul((M[1, 3]-k), k=1..9)=0,
    mul((M[2, 1]-k), k=1..9)=0,
    mul((M[2, 2]-k), k=1..9)=0,
    mul((M[2, 3]-k), k=1..9)=0,
    mul((M[3, 1]-k), k=1..9)=0,
    mul((M[3, 2]-k), k=1..9)=0,
    mul((M[3, 3]-k), k=1..9)=0,

    # the sum of all the terms is equal to 10*9/2 = 45

    M[1, 1]+M[1, 2]+M[1, 3]+M[2, 1]+M[2, 2]+M[2, 3]+M[3, 1]+M[3, 2]+M[3, 3]=45,

    # all the terms are different

    seq( mul(seq((M[op(im)]-M[op(ij)]), ij in iM minus {im})) <> 0, im in iM)
  }:

numelems(rels);

20

(4)

run_this := false:
if run_this then
  isolve(rels);  # requires a huge amount of memory and computational time
end if;

 


 

Download HowManyMatricesAreSingular.mw

Is there a pallette that contains the symbol for a contour integral both clockwise and anticlockwise?

doubt5.mw

Hi I want to run the following algorithm in code edit region:

for m in set_m do
    for n in set_n do
      solve for N solving ODE11 and ODE12 simultaneously
      solve for t_2 solving ODE11 and ODE12 simultaneouly
      find t__3 and t__4
      if (N<=t_4 and M>=t_3) then
        d1= TCS__1 using n,m,t__2 and N
          if (d1< d2)
            d2=d1
            print(d2,m,n,N,t_2)
    end do
end do
 

But I am struck for to how to extract N and t__2 from SOL1 in code edit region

SOL1 := fsolve({ODE11, ODE12}, {N, t__2});

Thanks in advance

How do I convert the expression

y = (sqrt(x) + 10)^(1/3) - (sqrt(x) - 10)^(1/3);

into

y^3 = 20 - 3*(x - 100)^(2/3);

A post on the Maxima mailing list said this was done by cubing both sides.  I can not seem to be able to get there.  A suggestion that the process involved recognizing the product (a+b)*(a-b)

First 522 523 524 525 526 527 528 Last Page 524 of 2427