mmcdara

3442 Reputation

16 Badges

5 years, 232 days

MaplePrimes Activity


These are replies submitted by mmcdara

@vv 

Than you vv.
Indeed I had noticed myself that your "simple integral" already led to some difficulties.

So, do you think that trying to integrate f is a dead end with MAPLE?

@tomleslie 

Thank you Tom, this is already a first step to the soluttoipn of the reverse problem.
The assumption mu >0 is indeed unjustified, but it introduces the idea to split the (mu, x) domain in 4 subdomains (mu<0, x<0, ... mu>0, x>0) on which the "proof" could be derived more easily.

For your information, f represents the PDF of a Generalized Gaussian random varable whose F is the CDF.
See for instance Generalized_normal_distribution
One can find the expression of F in several sources but I can't find any one where the details of its computation.


 

@Alex0099 
 

J := Int(psi*sin(Pi*n*x/l), x=0..l):
J = value(%)  assuming l::real

 

@lcz 

Based on @Rouben Rostamian's answer I'd suggest these modifications

display(
	plot(sin(x), x=-2*Pi..2*Pi, color="Green"),
	line([-2*Pi,0], [2*Pi,0]),
	line([0,-2*Pi], [0,2*Pi]),
        seq(circle([0, 0], k*Pi/2, color=gray, linestyle=3), k=1..4),
        textplot([2*Pi, 0, 'x'], 'align'={above, right}),
        textplot([0, 2*Pi, 'y'], 'align'={above, left}),
        axis[2]=[tickmarks=piticks]
):
p3 := rotate(%, Pi/4):
display(p1,p3, scaling=constrained);

@rcorless 

I'm not sure the curve you plot is correct:

 

restart:

e := r-sec(theta-Pi/4);
discont(sec(theta), theta);

r-csc(theta+(1/4)*Pi)

 

{Pi*_Z1+(1/2)*Pi}

(1)

ec := eval(e, [r=sqrt(x^2+y^2), theta=arctan(y/x)]);


opts := gridlines=true, color=blue, thickness=3:
plots:-implicitplot(ec=0, x=0..2, y=0..2, opts);

(x^2+y^2)^(1/2)-csc(arctan(y/x)+(1/4)*Pi)

 

 

opts := opts, gridrefine=5:
plots:-display(
  plots:-implicitplot(ec=0, x=0..2, y=-2..2, opts),
  plots:-implicitplot(ec=0, x=-2..0, y=-2..2, opts)
)

 

# left and right limits of ec at x=0

LL0 := limit(ec, x=0, left ) assuming y < 0;
LR0 := limit(ec, x=0, right) assuming y > 0;

eval(LL0, y=-sqrt(2));
eval(LR0, y=+sqrt(2));

-y-2^(1/2)

 

y-2^(1/2)

 

0

 

0

(2)

 


 

Download sec.mw

@Rouben Rostamian  

Very clear illustration Rouben, I vote up

@rlopez 

Maybe a question of translation?
The method of lines you are talking about, seems to me as an alternate name (maybe I'm mistaken) for the method of characteristics used to solve hyperbolic pdes or diffusion-convection equations.
I think that, more simply, what the OP is refering to is a Finite Difference (en [x,y]) Time Domain method (FDTD) or even simpler tha classical numerical method to solve elliptic pdes after space-time separation.

@yangtheary @vv  
and all involved people...

The solution is given at page 79 (problem 4.10) of "INTRODUCTION TO FUNCTIONAL EQUATIONS, theory and problem-solving strategies for mathematical competitions and beyond" by  Costas Efthimiou
Free pdf here 100914book.pdf

The method to solve this kind of functional equations (termed "Equations Reducing to Algebraic Systems") is explained in details from pages 69 to 79 with a link to Group Theory.

 

@rcorless 

You're welcome

An example is provided in Maple's help pages: help(pdsolve[boundaryconditions]).
In the See Also section of this help page click on  pdsolve[boundaryconditions].
Unfold then the section Three Textbook Examples in the new document.
System 

sys[5] := [diff(u(x,t), x, x) - (1/c^2)*diff(u(x,t), t, t) = 0, u(x,0) = f(x), D[2](u)(x, 0) = g(x)];

illustrate how to declare that diff(u(x, t), t)=g(x) for any x value at time t=0.
The notation D[2](u) means "the derivative of u(x,t) withe respect to its 2nd argument (here t):

restart:
a := D[2](u)(x, 0);
convert(a, diff);  # the display is prettier in a worksheet
                         D[2](u)(x, 0)
                     / d                     \
                eval| ---- u(x, t1), {t1 = 0}|
                     \ dt1                   /


For an example (1D diffusion equation over  XxT = (0, 1)x(0, +oo) and a Neuman boundary condition at t=0) see here
insu160.htm
The Neuman boundary condition then writes

D[1](u)(0,t) =A(t)


More axamples can be found here index.htm

 

 

Please refer to my previous reply.

Concerning your "I think the issue is that the writer of this package had a different mental model of what graphs were" comment:

  • The CycleBasis function operates (at least in Maple 2015, I don't have newer versions right now to check this on them) on undirected graph only.
    See the attached file to verify this.
     
  • The convenient term to use for directed graphs is circuit, not cycle (see my previous reply).
    Unfortunately there is no mention of any function designed to manipulate circuits in Maple 2015 (in newer versions ???)
     
  • As it's shown in the attached file you can cheat to find the circuits (if any) of a directed graph:
    • transform the originall directed graph G into an undirected one UG
    • use CycleBasis to find the cycles of UG
    • check if these cycles form a circuit in G


 

restart:

with(GraphTheory):

G := Graph({[1,2],[2,3],[3,1]});
DrawGraph(G)

GRAPHLN(directed, unweighted, [1, 2, 3], Array(%id = 18446744078255432038), `GRAPHLN/table/1`, 0)

 

 

CycleBasis(G);

Error, (in GraphTheory:-CycleBasis) input graph must be undirected

 

map(e -> {e[]}, Edges(G))

{{1, 2}, {1, 3}, {2, 3}}

(1)

# Make G undirected

UG := Graph(map(e -> {e[]}, Edges(G))):
DrawGraph(UG);
CUG := CycleBasis(UG)[];

 

[1, 2, 3]

(2)

# Is CUG a circuit of G ?
# If this is so, then there exists in G a path from CUG[1] to CUG[-1].
# Simply here:

is(ShortestPath(G, CUG[1], CUG[-1]) = CUG)

true

(3)

# For a more complex graph a simple way is to check if the
# list of Arrivals of vertices in CUG is equal to the CUG
# rotated to the left:

alias(LTR = ListTools:-Rotate):
Arrivals~(G, CUG);
is(op~(%) = LTR(CUG, -1));

[[3], [1], [2]]

 

true

(4)

# Finally the circuit is (up to an arbitrary rotation) is

Potential_Circuit := map(n -> [CUG[n], LTR(CUG, n)[1]], CUG);

[[1, 2], [2, 3], [3, 1]]

(5)

 


 

Download circuit.mw

@acer 
Hi,
In the present case, is there an advantage in using implicitdiff instead of this "basic" method?

restart:

alias(x=x(y)):
diff(2*x*y^3 + 3*x^2*y = 1, y):
isolate(%, diff(x, y));
map(factor, %)

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

 

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

(1)

 


 

Download diff.mw

 

You might find this site interesting:
index.htm    (Wave PDE in 1D)
and more particularly
inse30.htm   (Finite length string)
and next
insu175.htm

BTW: your file can't be loaded

Can't reproduce for toy functions
(Maple 2015, Mac OS X)

Seq.mw

@vv @tomleslie

While I agree with your explanation, don't you think this reveals a regression of Maple since 2019?
Note that even larger values of the Poisson parameter works well (nevertheless slowly) in Maple 2015, and I guess until Maple 2018.

CodeTools:-Usage( Histogram(Sample(Poisson(10^4),10000)) ):
memory used=274.52MiB, alloc change=-9.65MiB, cpu time=1.90s, real time=1.67s, gc time=358.01ms


 

4 5 6 7 8 9 10 Last Page 6 of 83