Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

After a long hiatus I have come back to the issue of null tetrads in the physics package in light of the updates to  Maple in 2021. I have uploaded a document file to illustrate. See below. My first question concerns the labelling of elements of a null tetrad. After calling the metric 27,37 from Stephani et al, and using Setup to specify a null tetrad, Maple's choice is such that the elements labelled m and bar m are not complex. Rather, both these elements are in fact real, while the elements lablled l and n are complex, with one being the negative complex conjugate of the other. While these are just labels, they don't agree with the usual conventions for the Newman-Penrose formalism, which is disorienting. What convention is Maple using to label the elments of a null tetrad?

Next, I try to specify the null tetrad used by Stephani et al., first by converting it into covariant form (which I did by hand rather than in Maple). In Maple's default null tetrad, the order in which Maple listed the elements of the null tetrad is n, m, bar m, l (as rows in the matrix display for e_[ ]), so I followed that convention (in the conventions of Stephani et al., the first and fourh element should have scalar product -1, the second and third scalar product 1, and all other scalar products zero, which is the case). After entering the matrix and using Setup to specify the null tetrad by the matrix, I get an error message saying that the components of the metric with respect to my tetrad are not just 0, 1, and -1. Yet,  executing eta_[ ]  does not confirm this warning; nor does a computation by hand.

Finally, IsTetrad asserts the tetrad is not null, contrary to the fact that it is a null tetrad.

Since I have followed the conventions implicit in Maple's default null tetrad for this metric, I am puzzled as to what has gone wrong.SKMHH27_37_2021_New.mw

On the other hand, taking into account how Maple 2019 orders the coordinates in Stephani et al 27.37 and labels the null vectors in a null ttetrad, if I translate accordingly what I have in the 2021 Maple file, Maple 2019 confirms Stephani et al.'s null tetrad is indeed a null tetrad, as one would expect. See the following file.SKMHH27_37_2019_Var.mw.

Consider this example:

    h := proc(x)
        printf("h says: %a evaluates to %a.", x, eval(x));
    end proc:
    f := proc()
        local z, g;
        g := proc(x)
            printf("g says: %a evaluates to %a.\n", x, eval(x));
        end proc;
        z := 2;
        g('z');
        h('z');
    end proc:

    > f()
    g says: z evaluates to 2.
    h says: z evaluates to 2.

I can't figure out, whats going on here. Now it comes as no surprise, of course, that g would be able to see z. After all, its definition is within the lexical scope of z. But how can h possibly see z?

When eval is called in h, does eval somehow look into the call stack, and find out it was called by h, which was in turn called by f and then inspect the local variables of f?

Could you explain, what's going on here, please?

Thank you all!

Hello everybody.

My goal is to solve the following integro-functional equation:

(int(p^2/(f(p)-f(p+q)+omega), p = a .. b))/omega^2 = ln(omega^2+q^2)

(int(p^2/(f(p)-f(p+q)+omega), p = a .. b))/omega^2 = ln(omega^2+q^2)

 

where where is the unknown function and a, b are some numerical values as well as ω and q are real positive variables.

I would be grateful for any ideas.

This is Maple 2019. Suppose a directed graph D is given. 

I know that "Cycles≔CycleBasis(D)" lists down all the cycles in D and "numelems(Cycles)" gives the number of cycles in D. But if I only want to count the number of directed cycles of length k, say k=4, in D, is there a Maple function that gives us that?

Thank you all.

Hello,

I'm considering a question for undergraduates like this:

An investor is looking at a $150,000 home. If 20% must be put down and the balance is financed at 9% over the next 30 years, what is the monthly mortgage payment?

On a basic financial calculator, say TI BA the solution is simply:

 

In the Finance package there is a strangely named function

levelcoupon(face, rate, couponrate, maturity)

that actually calculates the PV, that is the bond price in a basic setup with no dates (all CF are at the end) which is what I need, and another of the same class - yieldtomaturity, but I didn't find a function that returns the payment (coupon). 

Any suggestions are highly appreciated.

Thanks!

please help me solve equation ${\sqrt {x^2-10 x+1}=\sqrt {-8 x^2+9 x-1}}$

above equation, maple gives 2 solutions x=2, x=1/9
but in fact the equation has no solution

please help me.

solve(sqrt(x^2-10*x+1) = sqrt(-8*x^2+9*x-1))

1/9, 2

(1)

``

Download solve_eq_help.mw

Hello I cant sign in on my other MapleCloud account to view all my other Maple Documents. 

It says "Oops an error stopped us, from verifying your account. Please sign in again or continue using public MapleCloud features maple" Any suggestions on how to fix it? 

Maple 2020 beginner user - matrices shows 10 rows and columns on worksheet, by default. How to increase this value up to 16 and more? Of course, there is possibility (browse matrix) to see all values and export to Excel also, but better to see all 16 on worksheet. 

I am trying to solve a nonlinear equation frequently and use the solution result to draw a plot. I was wondering when some solutions are complex numbers (I), how Maple treats them. Can we add a condition saying that if the solution is complex, it should be replaced by a real number (e.g., zero)

dear all:

    here I try to repeat the results as follows:

 (23) is my target

my 2 solving processes are included in the attachment.

using LinearSolve(A, b) and regular solve command can not generate results as (23)

Please take a look.

question_DHT.mw

thanks for your help.

best regards

I need help please. This is Maple 2019. I want to run through all possible bipartite tournaments with exactly 4 vertices in each partite set, and for each bipartite tournament compute the number of pair of vertices which has at least one common out-neighbor. 
1) The following code stops after two lines of output. Please advise how the code can be fixed.  
2) The printing of the adjaceny matrix using WeighMatrix(G) seems wrong too.

Thank you very much.😭😭

Hi,

I would like to plot this function from x= 2pi to 4pi.  I entered this into the plotting command, and nothing happened.  How do I plot this from 2pi to 4pi?

plot_from_two_pi_to_4_pi.mw

restart;
kp := .3;

Pr := .3; N := .5; g := .5; A := 1; B := 0; M := .5; lambda := .5; Ec := .5;

rf := 997.1; kf := .613; cpf := 4179; `σf` := 0.5e-1;
p1 := 0.1e-1; sigma1 := 2380000; rs1 := 4250; ks1 := 8.9538; cps1 := 686.2;
p2 := 0.5e-1; sigma2 := 3500000; rs2 := 10500; ks2 := 429; cps2 := 235;

NULL;
a1 := (1-p1)^2.5*(1-p2)^2.5;
a2 := (1-p2)*(1-p1+p1*rs1/rf)+p2*rs2/rf;
a3 := 1+3*((p1*sigma1+p2*sigma2)/`σf`-p1-p2)/(2+(p1*sigma1+p2*sigma2)/((p1+p2)*`σf`)-((p1*sigma1+p2*sigma2)/`σf`-p1-p2));

a4 := (1-p2)*(1-p1+p1*rs1*cps1/(rf*cpf))+p2*rs2*cps2/(rf*cpf);
a5 := (ks1+2*kf-2*p1*(kf-ks1))*(ks2+2*kf*(ks1+2*kf-2*p1*(kf-ks1))/(ks1+2*kf+p1*(kf-ks1))-2*p2*(kf*(ks1+2*kf-2*p1*(kf-ks1))/(ks1+2*kf+p1*(kf-ks1))-ks2))/((ks1+2*kf+p1*(kf-ks1))*(ks2+2*kf*(ks1+2*kf-2*p1*(kf-ks1))/(ks1+2*kf+p1*(kf-ks1))+2*p2*(kf*(ks1+2*kf-2*p1*(kf-ks1))/(ks1+2*kf+p1*(kf-ks1))-ks2)));


OdeSys := (diff(U(Y), Y, Y))/(a1*a2)+Theta(Y)+N*(Theta(Y)*Theta(Y))-a3*(M*M)*U(Y)/a2-(kp*kp)*U(Y)/(a1*a2), a5*(diff(Theta(Y), Y, Y))/a4+Pr*Ec*((diff(U(Y), Y))^2+U(Y)^2*(kp*kp))/(a1*a2); Cond := U(0) = lambda*(D(U))(0), Theta(0) = A+g*(D(Theta))(0), U(1) = 0, Theta(1) = B; Ans := dsolve([OdeSys, Cond], numeric, output = listprocedure);
U := proc (Y) options operator, arrow, function_assign; (eval(U(Y), Ans))(0) end proc;
                 U := Y -> (eval(U(Y), Ans))(0)
Theta := proc (Y) options operator, arrow, function_assign; (eval(Theta(Y), Ans))(0) end proc;
             Theta := Y -> (eval(Theta(Y), Ans))(0)
Theta_b := (int(U(Y)*Theta(Y), Y = 0 .. 1))/(int(U(Y), Y = 0 .. 1));
Error, (in Theta) too many levels of recursion
Q := int(U(Y), Y = 0 .. 1, numeric);
Error, (in Theta) too many levels of recursion
NUMERIC := [(eval((diff(U(Y), Y))/a1, Ans))(0), (eval(-(diff(Theta(Y), Y))/(Theta_b*a5), Ans))(0)];
Error, (in Theta) too many levels of recursion

 

i need the solution  for Y=0 and Y=1

I was looking at symbolically solving a second-order differential equation and it looks like the method=laplace method has a sign error when the coefficients are presented in a certain way.  Below is a picture of some examples with and without method=laplace that should all have the same closed form.  Note that lines (s6) and (s8) have different signs in the exponential than they should have (which is a HUGE problem):

restart

s1 := dsolve([diff(x(t), t, t)+2*a*(diff(x(t), t))+a^2*x(t)], [x(t)])

{x(t) = exp(-a*t)*(_C2*t+_C1)}

(1)

s2 := dsolve([diff(x(t), t, t)+2*a*(diff(x(t), t))+a^2*x(t)], [x(t)], method = laplace)

x(t) = exp(-a*t)*(t*(D(x))(0)+x(0)*(a*t+1))

(2)

s3 := dsolve([diff(x(t), t, t)+2*(diff(x(t), t))/b+x(t)/b^2], [x(t)])

{x(t) = exp(-t/b)*(_C2*t+_C1)}

(3)

s4 := dsolve([diff(x(t), t, t)+2*(diff(x(t), t))/b+x(t)/b^2], [x(t)], method = laplace)

x(t) = exp(-t/b)*(t*(D(x))(0)+x(0)*(b+t)/b)

(4)

s5 := dsolve([diff(x(t), t, t)+2*(diff(x(t), t))/sqrt(L*C)+x(t)/(L*C)], [x(t)])

{x(t) = exp(-(L*C)^(1/2)*t/(L*C))*(_C2*t+_C1)}

(5)

s6 := dsolve([diff(x(t), t, t)+2*(diff(x(t), t))/sqrt(L*C)+x(t)/(L*C)], [x(t)], method = laplace)

x(t) = (t*(D(x))(0)+3*C*L*x(0)*t/(L*C)^(3/2)+x(0))*exp((L*C)^(1/2)*t/(L*C))

(6)

s7 := dsolve([L*C*(diff(x(t), t, t))+2*sqrt(L*C)*(diff(x(t), t))+x(t)], [x(t)])

{x(t) = exp(-(L*C)^(1/2)*t/(L*C))*(_C2*t+_C1)}

(7)

s8 := dsolve([L*C*(diff(x(t), t, t))+2*sqrt(L*C)*(diff(x(t), t))+x(t)], [x(t)], method = laplace)

x(t) = exp(t/(L*C)^(1/2))*(t*(D(x))(0)+x(0)*(L*C+3*(L*C)^(1/2)*t)/(L*C))

(8)

s9 := dsolve([diff(x(t), t, t)+2*z*wn*(diff(x(t), t))+wn^2*x(t)], [x(t)])

{x(t) = _C1*exp((-z+(z^2-1)^(1/2))*wn*t)+_C2*exp(-(z+(z^2-1)^(1/2))*wn*t)}

(9)

s10 := dsolve([diff(x(t), t, t)+2*z*wn*(diff(x(t), t))+wn^2*x(t)], [x(t)], method = laplace)

x(t) = exp(-wn*t*z)*(cosh((wn^2*(z^2-1))^(1/2)*t)*x(0)+(x(0)*wn*z+(D(x))(0))*sinh((wn^2*(z^2-1))^(1/2)*t)/(wn^2*(z^2-1))^(1/2))

(10)

s11 := dsolve([(diff(x(t), t, t))/wn^2+2*z*(diff(x(t), t))/wn+x(t)], [x(t)])

{x(t) = _C1*exp((-z+(z^2-1)^(1/2))*wn*t)+_C2*exp(-(z+(z^2-1)^(1/2))*wn*t)}

(11)

s12 := dsolve([(diff(x(t), t, t))/wn^2+2*z*(diff(x(t), t))/wn+x(t)], [x(t)], method = laplace)

x(t) = exp(-wn*t*z)*(cosh((wn^2*(z^2-1))^(1/2)*t)*x(0)+(x(0)*wn*z+(D(x))(0))*sinh((wn^2*(z^2-1))^(1/2)*t)/(wn^2*(z^2-1))^(1/2))

(12)

s13 := dsolve([(diff(x(t), t, t))/wn^2+2*z*(diff(x(t), t))/wn+x(t)], [x(t)])

{x(t) = _C1*exp((-z+(z^2-1)^(1/2))*wn*t)+_C2*exp(-(z+(z^2-1)^(1/2))*wn*t)}

(13)

s14 := dsolve([(diff(x(t), t, t))/wn^2+2*z*(diff(x(t), t))/wn+x(t)], [x(t)], method = laplace)

x(t) = exp(-wn*t*z)*(cosh((wn^2*(z^2-1))^(1/2)*t)*x(0)+(x(0)*wn*z+(D(x))(0))*sinh((wn^2*(z^2-1))^(1/2)*t)/(wn^2*(z^2-1))^(1/2))

(14)

NULL

Download DsolveLaplaceIssues.mw

Hello,

How to factor the following polynomial : n*xn - 2*n*x(n - 1) + xn

I can't find a command to write : xn-1*((n+1)*x-2n)

Thank you for your help.

First 228 229 230 231 232 233 234 Last Page 230 of 2218