MaplePrimes Questions

Given a planar graph G 

i) How to find the degrees of the regions of G

ii) The edges in each region as sets

iii) edges in the intersection of regions

dchange gives the error when I try to convert pde into ode. Why?

restarts

with(PDEtools)

pde1 := diff(u(x, t), t)-(diff(u(x, t), `$`(x, 2), t))+3*u(x, t)^2*(diff(u(x, t), x))-2*(diff(u(x, t), x))*(diff(u(x, t), `$`(x, 2)))-u(x, t)*(diff(u(x, t), `$`(x, 3))) = 0

diff(u(x, t), t)-(diff(diff(diff(u(x, t), t), x), x))+3*u(x, t)^2*(diff(u(x, t), x))-2*(diff(u(x, t), x))*(diff(diff(u(x, t), x), x))-u(x, t)*(diff(diff(diff(u(x, t), x), x), x)) = 0

(1)

trans1 := {seq(var[i] = tau[i], i = 2), FN = Y(zz), var[1] = (zz-(sum(lambda[i]*tau[i], i = 2)))/lambda[1]}

{FN = Y(zz), var[1] = (-lambda[2]*tau[2]+zz)/lambda[1], var[2] = tau[2]}

(2)

ode1 := dchange(trans1, pde, [Y(zz), zz, seq(tau[i], i = 2)])

Error, (in dchange/info) the number of new and old independent variables must be the same. Found {zz, tau[2]} as new, while {FN, var[1], var[2]} as old

 

op(lhs(pde1))

diff(u(x, t), t), -(diff(diff(diff(u(x, t), t), x), x)), 3*u(x, t)^2*(diff(u(x, t), x)), -2*(diff(u(x, t), x))*(diff(diff(u(x, t), x), x)), -u(x, t)*(diff(diff(diff(u(x, t), x), x), x))

(3)

 

Download P_O.mw

Hi Everyone,

surely my question has a simple answer, however, I am a bit stumped. I need to calculate field equations for which I need to take the covariant derivative of a tensor density. This yields additional "Christoffel-terms" in the usual manner.

For mathematical details see e.g. (https://math.stackexchange.com/questions/2267059/covariant-derivative-of-tensor-densities)

(I hope it's ok to link resources from another forum)

My problem is that I can't seem to find a command to define a tensor density in the Differential Geometry package. I can only obtain Metric densities through the "MetricDensity" command. However, this command does not create a tensor density in the usual manner.

One workaround might be to substitute the Metric Density from the command mentioned above into the covariant derivative after expanding in terms of the Christoffel-symbols. 

Any input would be appreciated.

I think I mentioned this before long time ago and never got any satisfactory answer. So I thought I will try again.

I never been able to figure why/how dsolve decides when to integrate the intermediate result vs. keeping the integral inert, even though it can integrate it.

It must use some rule internal to decide this, and this is what I am trying to find out.

Here is a very simple separable ode. So this is just really an integration problem.

restart;
ode:=diff(y(x),x)=(b*y(x)+sqrt(y(x)^2+b^2-1) )/(b^2-1);
dsolve(ode)

The first thing that comes to mind, is that Maple could not integrate it, that is why it gave inert integral. but it can integrate it but the result is a little long

int((b^2 - 1)/(b*y + sqrt(y^2 + b^2 - 1)),y)

So it could have generated the above implicit solution instead. Now notice what happens when I make very small change the ode.

restart;
ode:=diff(y(x),x)=(y(x)+sqrt(y(x)^2+b^2-1) )/(b^2-1);
dsolve(ode)

In the above I changed b*y to just y and guess what, now maple will integrate it and give an implicit solution instead of an inert integral

In both cases, Maple is able to do the integration. But in first case, it returned an inert integral and in the second it did not.

my question is why?  Does it have a rule where if the size of the integral is larger than some limit, it does not solve it? Did it say,

     "I think this result is too complicated to the user, so I will keep the integral inert instead"

If so, what are the rules it uses to decide when to do the integration and when to keep it inert? Is it based on leafcount? number of terms? something else?

infolevel does not give a hint on this, as all what it says is that it is separable.

Any one has an ideas on this?

Hello everyone!

How do I get some information about my computer (eg Windows edition,System processor, Computer name, .....) with the Maple command?

Thanks for your help!

I can generate Bode Plots from a transfer function but I just need to know what the gain is at a specific frequency.  Is there a simple way to do that without having examine the plots?

Thank you,

David

Hello all,

I am fairly new to Maple and would like to programatically simplify the output form using Maple's pade function on an arbitrary function: Y := 1/(R__s + 1/(s*C__dl + 1/(R__ct + 1/(sqrt(s)/sigma + 1/R__w))))
I found that only Maple's pade function was able to convert my function into a rational expression which is quite interesting.

Now I would like to replicate using maple what was manually done in steps 2 - 4 of the attached solution pdf (which was done by hand).

I was only able to do step 1 (as shown in the attached maple worksheet) after which I got stuck.

kindly assist

restart

with(numapprox)

[chebdeg, chebmult, chebpade, chebsort, chebyshev, confracform, hermite_pade, hornerform, infnorm, laurent, minimax, pade, remez]

(1)

s = I*omega

s = I*omega

(2)

Y := 1/(R__s+1/(s*C__dl+1/(R__ct+1/(sqrt(s)/sigma+1/R__w))))

1/(R__s+1/(s*C__dl+1/(R__ct+1/(s^(1/2)/sigma+1/R__w))))

(3)

padey := pade(Y, x = sqrt(s), [1, 1])

(C__dl*s^(3/2)*R__ct*R__w+C__dl*R__ct*s*sigma+C__dl*R__w*s*sigma+s^(1/2)*R__w+sigma)/(C__dl*s^(3/2)*R__ct*R__s*R__w+C__dl*R__ct*R__s*s*sigma+C__dl*R__s*R__w*s*sigma+s^(1/2)*R__ct*R__w+s^(1/2)*R__s*R__w+R__ct*sigma+R__s*sigma+sigma*R__w)

(4)

collect((C__dl*s^(3/2)*R__ct*R__w+C__dl*R__ct*s*sigma+C__dl*R__w*s*sigma+s^(1/2)*R__w+sigma)/(C__dl*s^(3/2)*R__ct*R__s*R__w+C__dl*R__ct*R__s*s*sigma+C__dl*R__s*R__w*s*sigma+s^(1/2)*R__ct*R__w+s^(1/2)*R__s*R__w+R__ct*sigma+R__s*sigma+sigma*R__w), s)

(C__dl*s^(3/2)*R__ct*R__w+(C__dl*R__ct*sigma+C__dl*R__w*sigma)*s+s^(1/2)*R__w+sigma)/(C__dl*s^(3/2)*R__ct*R__s*R__w+(C__dl*R__ct*R__s*sigma+C__dl*R__s*R__w*sigma)*s+(R__ct*R__w+R__s*R__w)*s^(1/2)+R__ct*sigma+R__s*sigma+sigma*R__w)

(5)

padey2 := collect((C__dl*s^(3/2)*R__ct*R__w+C__dl*R__ct*s*sigma+C__dl*R__w*s*sigma+s^(1/2)*R__w+sigma)/(C__dl*s^(3/2)*R__ct*R__s*R__w+C__dl*R__ct*R__s*s*sigma+C__dl*R__s*R__w*s*sigma+s^(1/2)*R__ct*R__w+s^(1/2)*R__s*R__w+R__ct*sigma+R__s*sigma+sigma*R__w), sigma)

((C__dl*R__ct*s+C__dl*R__w*s+1)*sigma+C__dl*s^(3/2)*R__ct*R__w+s^(1/2)*R__w)/((C__dl*R__ct*R__s*s+C__dl*R__s*R__w*s+R__ct+R__s+R__w)*sigma+C__dl*s^(3/2)*R__ct*R__s*R__w+s^(1/2)*R__ct*R__w+s^(1/2)*R__s*R__w)

(6)

Download maple_attempt.mw

solution.pdf

Why Maple returns empty solution (see eq. (5))? Also, is it possible that Maple not only gives us the explit solution but also the solution steps?

restart

with(PDEtools, TWSolutions, declare)

[TWSolutions, declare]

(1)

with(DEtools, diff_table)

[diff_table]

(2)

U := diff_table(u(x, t))

table( [(  ) = u(x, t) ] )

(3)

sys := {U[]*U[x]+U[t]-pU[x, x]+qU[x, x, x] = 0}

{u(x, t)*(diff(u(x, t), x))+diff(u(x, t), t)-pU[x, x]+qU[x, x, x] = 0}

(4)

TWS_sol := TWSolutions(sys)

(5)

map(pdetest, [TWS_sol], sys)

[]

(6)

``

Download twsol.mw

Dear maple user i am facing difficulty to plot the graph   for different values  of parameter M=2,4  and fixing t=j=0 to 2 and   y=i=0 to 4 on x axis and U on y axis. I am unable to plot 2D . I am enclosing the codes and sample graphs. 

restart; 
# Parameter values:
 Pr:=0.71:E:=1:A:=0:Sc:=0.02: K:=1:

a := 0: b := 1: N := 9:
h := (b-a)/(N+1): k := (b-a)/(N+1):

 lambda:= 1/h^2:  lambda1:= 1/k^2:
# Initial conditions
for i from 0 to N do 
  U[i, 0] := h*i+1:
end do:


for i from 0 to N do 
  T[i, 0] := h*i+1:
end do:
for i from 0 to N do 
  C[i, 0] := h*i+1:
end do:

# Boundary conditions
for j from 0 to N+1 do 
  U[0, j] := exp(A*j*lambda); 
  U[N+1, j] := 0;
  T[0, j] := j*lambda1; 
  T[N+1, j] := 0;
  C[0, j] := j*lambda1; 
  C[N+1, j] := 0 
end do:


#Discretization Scheme
for i to N do 
  for j from 0 to N do 
    eq1[i, j]:= lambda1*(U[i, j+1]-U[i, j]) = (Gr/2)*(T[i, j+1]+T[i,j])+(Gr/2)*(C[i, j+1]+C[i,j])+(lambda^2/2)*(U[i-1,j+1]-2*U[i,j+1]+U[i+1,j+1]+U[i-1,j]-2*U[i,j]+U[i+1,j])-(M/2)*(U[i,j+1]+U[i,j]) ;
    eq2[i, j]:= lambda1*(T[i, j+1]-T[i, j]) = (1/Pr)*(lambda^2/2)*(T[i,j+1]-2*T[i,j+1]+T[i+1,j+1]+T[i-1,j]-2*T[i,j]+T[i+1,j])+(E*lambda^2)*((U[i+1,j]-U[i,j])^2);
    eq3[i, j]:= lambda1*(C[i, j+1]-C[i, j]) = (1/Sc)*(lambda^2/2)*(C[i,j+1]-2*C[i,j+1]+C[i+1,j+1]+C[i-1,j]-2*C[i,j]+C[i+1,j])+(K/2)*((C[i,j+1]+C[i,j]))  
  end do
end do:


#
# Determine the unknowns in the system
#
  `union`(  seq(seq( indets( eq1[i,j], name), i=1..N), j=0..N),
            seq(seq( indets( eq2[i,j], name), i=1..N), j=0..N),
            seq(seq( indets( eq3[i,j], name), i=1..N), j=0..N)
          );
#
# And how many unknowns
#
   numelems(%);
#
# And the number of equations
#
  numelems(eq1)+numelems(eq2)+numelems(eq3);

#
# So if one supplies values for 'Gr' and 'M', and
# (assuming the equations are consistent), one ought
# to be able to get values for C[1..9, 1..10],
# T[1..9,1..10], and U[1..9,1..10]
#
# As an example below, choos Gr=1.0 and M=2, then the
# following obtains a 'solution` afer a minute or so
#
  fsolve( eval( [ seq(seq(eq1[i,j], i=1..N),j=0..N),
                  seq(seq(eq2[i,j], i=1..N),j=0..N),
                  seq(seq(eq3[i,j], i=1..N),j=0..N)
                ],
                [Gr=1.0, M=2]
 )
        );


 

 

 

Is there more or less simple way to generate magic and semi magic squares in maple by just giving the order and the magic constant?

It appears that using 2D math can generate hidden characters that make code not run. 

It seems like a lot of people think that using 1D math is a no-brainer, as if it had all the advantages and no disadvantages.

I am trying to write code for an object. I was using 2D math, because the automatic formatting of the code (italics, bold) makes it much easier to see and understand the code. Then again, I ran into an issue I face sometimes which is that code that looks absolutely perfect can't be parsed. 

I read that we can convert the code to 1D math and we will see hidden characters messing things up but that doesn't seem to be the case (or at least I can't seem to see the extra character). And in any case, it is just maddening and not a productive thing to have to do.

Is 1D math really the best user experience that is available? Is there really a tradeoff between legibility and useability in Maple 2022?

This ode from textbook, and the solution is given in back of book and I verified it is correct.

odetest gives zero also when asked to verify the solution.

but when asked to verify both the solution and the initial conditions, instead of returning [0,0] as expected, it returns [the_ode,0]

Here is an example
 

interface(version);

`Standard Worksheet Interface, Maple 2022.2, Windows 10, October 23 2022 Build ID 1657361`

restart

ode:=diff(y(x), x) = 2*(2*y(x) - x)/(x + y(x));
ic:=y(0) = 2;
booksol:=(x-y(x))^2/( y(x)-2*x)^3 = 1/2;

diff(y(x), x) = 2*(2*y(x)-x)/(x+y(x))

y(0) = 2

(x-y(x))^2/(y(x)-2*x)^3 = 1/2

#this returns zero, so maple agree the book solution is correct
odetest(booksol,ode)

0

#when adding ic, when does it not give [0,0] ?
odetest(booksol,[ode,ic])

[diff(y(x), x)-2*(2*y(x)-x)/(x+y(x)), 0]

 


How shoulld one interpret the above answer?

Download question_on_odetest_nov_14_2022.mw

Consider the following system of differential equations

sys := diff(y(x), x) = z(x)*f1(i), diff(z(x), x) = y(x)*f2(i)

where f1 and f2 are functions that depend on the current iteration. Ultimately, I'd like to index into an array that has the length of the number of iterations, to obtain a value that will be part of the differential equations. It's an array of random numbers, but I'd rather not have to generate them on the fly while dsolve is working.

I've been investigating the use of Events for this, but the documentation is quite atrocious and outdated (and I only know this because, for example, when I try to use certain arguments to dsolve some error messages show that the arguments have changed name)

Please help me to prove that the limit of the following function does not exist:

I've read the documentation on events, and as far as I can tell after an hour or two, I am doing exactly what is in the documentation but not getting the expected result.

Here is a worksheet illustrating the issue: dsolve_events.mw

Basically there is a very simply system of two differential equations and I would simply like to see an event triggered when the dependent variable is above 2. 

This event has no useful interpretation, it was just my attempt at trying to get something to trigger (I have tried multiple things). As far as I can tell from the docs I am using an event specification of form 

[0, c(t,y(x)) < 0]: discrete event with a conditional trigger

ie, [0,2-x<0]

and when that is triggered I set i(x) to something like i(x)+1 (but even something as simple as assigning it to some constant like 7, given that the initial value i(0)=0, would allow me to check when the event is being triggered), where i(x) is defined as a discrete variable (my ultimate goal is to trigger the event on every iteration and have i be the iteration counter. I want to use this iteration counter in the equations)

I run the dsolve command, assign the result to a variable and then call, for example p(3). I would expect to see the event triggered and i(3) not equal to the initial value i(0). But the value of i(x) doesn't change.

First 141 142 143 144 145 146 147 Last Page 143 of 2308