MaplePrimes Questions

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. 

For instance, I'd like to find the integer solutions of the following system (unknowns: k[1], k[2], k[3], k[4], k[5], and k[6]): 

eqs:=eval~(k[1]*x^3+k[2]*x^2*y+k[5]*x^2*z+k[3]*x*y^2+k[6]*x*y*z+k[8]*x*z^2+k[4]*y^3+k[7]*y^2*z+k[9]*y*z^2+k[10]*z^3,{{x=1,y=1,z=1},{x=RootOf(_Z^3-4*_Z^2+_Z+1,index=1),y=RootOf(_Z^3-4*_Z^2+_Z+1,index=2),z=RootOf(_Z^3-4*_Z^2+_Z+1,index=3)},{x=RootOf(_Z^3-4*_Z^2+_Z+1,index=2),y=RootOf(_Z^3-4*_Z^2+_Z+1,index=3),z=RootOf(_Z^3-4*_Z^2+_Z+1,index=1)},{x=RootOf(_Z^3-4*_Z^2+_Z+1,index=3),y=RootOf(_Z^3-4*_Z^2+_Z+1,index=1),z=RootOf(_Z^3-4*_Z^2+_Z+1,index=2)}}):
{isolve}(eqs=~0);

It seems that the isolve command cannot solve such a system of linear equations, but its integer solutions do exist: 

sol := [k[1] = _Z1, k[2] = _Z2, k[3] = _Z3, k[4] = _Z4, k[5] = _Z5, k[6] = _Z1 + 2*_Z3 + 2*_Z4 + _Z5 + 3*_Z6, k[7] = 2*_Z1 + _Z3 + 8*_Z4 - _Z6, k[8] = -21*_Z1 + 2*_Z2 - _Z4 - 4*_Z5 + _Z6, k[9] = 24*_Z1 - 4*_Z2 - 5*_Z3 - 12*_Z4 + 3*_Z5 - 4*_Z6, k[10] = -7*_Z1 + _Z2 + _Z3 + 2*_Z4 - _Z5 + _Z6]: (*results from Mathematica*)
evala(subs(sol, eqs));
 = 
                              {0}

Here _Z1, _Z2, _Z3, _Z4, _Z5, and _Z6 are integer parameters. However, how do I get this result in Maple?

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

@nm I can see that working for a signal that has a starting point other than 0 and no other shifts involved, but I am wondering about signals built from shifted steps / ramps / etc.  If the forcing function is something like r(t) - u(t-1) - r(t-1) with u(t)=Heaviside(t) and r(t) = t Heaviside(t).  I won't have time to see if I can break Maple with that until this weekend, but I plan to try!

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

Is it possible to have the results of a MapleFlow container wrap to the next line as opposed to just extending off the page?

Thanks.

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

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