4029 Reputation

17 Badges

6 years, 185 days

MaplePrimes Activity

These are replies submitted by mmcdara

@AmirHosein Sadeghimanesh 
Excellent point.
Have your post been an answer instead of a remark I would have voted up.


I missed the expression of sys:

sys := {seq(G[i] = 0, i = 1 .. 4)}:




A := Matrix([[1, 1, 1, -1], [-1, 1, -1, -1], [1, -1, -1, -1], [-1, -1, 1, 3]]):

k := op(NullSpace(A)):#kernel

MatrixVectorMultiply(A, k):#check

C := op(ColumnSpace(A)):

X := <x, y, z, t>:

F := MatrixVectorMultiply(A, X) - a*C[1] - b*C[2] - c*C[2]:

G := op(convert(F, list)):

sys := {seq(G[i] = 0, i = 1 .. 4)}:
vars := [a, b, c]:
M,V := GenerateMatrix(sys, vars):
<vars> = (M^+.M).(M^+.V)

(Vector(3, {(1) = a, (2) = b, (3) = c})) = (Vector(3, {(1) = 4*x+8*y-16*t-4*z, (2) = 2*x+10*y-20*t-8*z, (3) = 2*x+10*y-20*t-8*z}))





GenerateMatrix returns a matrix and a vector, respectively M and V in my code


@vv @tomleslie @Mariusz Iwaniuk @acer

Thank you all for your involvement.
All of your responses are brty instructive to varying degrees, both for the direct and the reverse problem.

PS: vv, the change of variable you use in K doeesn't seem to be allowed in Maple 2015 (Error, (in IntegrationTools:-Change) expected lhs of transformation equations of type And(name, Not(constant)), or (unknown) function. Received `^`), I'll try tomorrow at work with Maple 2021


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?


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.



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



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

	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}),
p3 := rotate(%, Pi/4):
display(p1,p3, scaling=constrained);


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



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





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);




opts := opts, gridrefine=5:
  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));












@Rouben Rostamian  

Very clear illustration Rouben, I vote up


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.



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.

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):

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
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




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

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




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


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

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


# Make G undirected

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


[1, 2, 3]


# 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)



# 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]]




# 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]]





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


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))






First 12 13 14 15 16 17 18 Last Page 14 of 91