MaplePrimes Questions

Hello all, 

Would you please tell me how to rewrite the expression 'Is_square' like 'Is_square2'?

The way how the first expression is re-written is that both numerator and denominator were divided by 'sigma^2*omega[rK]^2': 

One attempt I made was to use 'algsub' command using the subexpression ''sigma^2*omega[rK]'', but somehow it missed the term in the denominator. 


 

restart;

Is_square := M[dmax]*(sigma^2*omega[rK]^2 + omega[r]^2)*L[sigma]/(3*p*omega[r]*omega[rK]*L[mu]^2*sigma^2);

(1/3)*M[dmax]*(sigma^2*omega[rK]^2+omega[r]^2)*L[sigma]/(p*omega[r]*omega[rK]*L[mu]^2*sigma^2)

(1)

Is_square2 := M[dmax]*(1 + omega[r]^2/(sigma^2*omega[rK]^2))*L[sigma]/(3*p*omega[r]*L[mu]^2/omega[rK]);

(1/3)*M[dmax]*(1+omega[r]^2/(sigma^2*omega[rK]^2))*L[sigma]*omega[rK]/(p*omega[r]*L[mu]^2)

(2)

algsubs(omega[rK]*sigma^2=tt, Is_square);

(1/3)*M[dmax]*L[sigma]*(tt*omega[rK]+omega[r]^2)/(p*omega[r]*L[mu]^2*omega[rK]*sigma^2)

(3)

 


 

Download Qprime_20200621.mw

 

Suppose I have

with(GraphTheory):
vertices:=["M","P","C"]:
edge_weights:={[{"M","P"},3],[{"M","C"},1]}:

G1:=Graph(vertices,edge_weights)

EigenvectorCentrality(G1)
                                                  

Is it right to say the EigenvalueCentrality values correspond to the names in the vertices correspondingly?  ie M corresponds to 0.4415.. P corresponds to  0.4188.. and C corresponds to 0.1396... ?

 

restart;
sub:=x/C;
expr:=1/2*x*(p^2+a)/p;

And now

subs(p = sub, expr)

But

algsubs(p = sub,expr)

Notice one "p" is still not replaced. 

This is very annoying. I looked at help and did not see anything about this. I could have missed it. It looks like it does not replace "p" when it is in denominator:

algsubs(p = x,1/p)

Remains 1/p but 

subs(p = x,1/p)

gives 1/x as expected.

May be this is documented somewhere? But why it does this?

This was generated when running some code on Maple 2020.1.

Just wondering if this might indicate some problem internally, or is this something that can happen.

restart;
ZZ:=Int(-(a*_a^2+(_a^4*a^2-4*_a*b*y(x))^(1/2))/(a*_a^3+_a*(_a^4*a^2-4*_a*b*y(x))^(1/2)+6*y(x)),_a = _b .. x)+Intat(-2/(a*x^3+x*(a^2*x^4-4*_f*b*x)^(1/2)+6*_f)-Int(2/(_a^4*a^2-4*_a*_f*b)^(1/2)*b*_a/(a*_a^3+_a*(_a^4*a^2-4*_a*_f*b)^(1/2)+6*_f)+(a*_a^2+(_a^4*a^2-4*_a*_f*b)^(1/2))/(a*_a^3+_a*(_a^4*a^2-4*_a*_f*b)^(1/2)+6*_f)^2*(-2*_a^2/(_a^4*a^2-4*_a*_f*b)^(1/2)*b+6),_a = _b .. x),_f = y(x))+_C1 = 0;

timelimit(30,value(ZZ))

Error, (in discont/zero) too many levels of recursion

The problem is that I am not able to trap the error. This does not work

try
ZZ:=Int(-(a*_a^2+(_a^4*a^2-4*_a*b*y(x))^(1/2))/(a*_a^3+_a*(_a^4*a^2-4*_a*b*y(x))^(1/2)+6*y(x)),_a = _b .. x)+Intat(-2/(a*x^3+x*(a^2*x^4-4*_f*b*x)^(1/2)+6*_f)-Int(2/(_a^4*a^2-4*_a*_f*b)^(1/2)*b*_a/(a*_a^3+_a*(_a^4*a^2-4*_a*_f*b)^(1/2)+6*_f)+(a*_a^2+(_a^4*a^2-4*_a*_f*b)^(1/2))/(a*_a^3+_a*(_a^4*a^2-4*_a*_f*b)^(1/2)+6*_f)^2*(-2*_a^2/(_a^4*a^2-4*_a*_f*b)^(1/2)*b+6),_a = _b .. x),_f = y(x))+_C1 = 0;
timelimit(30,value(ZZ));
catch:
  print("ignore");
end try;

Error, (in discont/zero) too many levels of recursion

Why can't one catch this error inside try/catch? It means the whole program can not  continue.

Maple 2020.1

 by using its expansion Write the Maple  program.

 

Type the Maple command string that calculates this expression for the number of n arbitrarily entered from the keyboard.Can you help me please ?

  1. a1 = x and for every n >= 1 ,   

write the Maple procedure that calculates the term a100 for x = 2.

 

 Write the Maple program that finds the differential equation that accepts the solution. (c1, c2, c3 are arbitrary constants.)

Hello

After
 > save mytable, "foo.m";
in whitch folder may I find the file "foo.m" ?

I try with the function "search" of Windows 10, but it can't find it.

Thanks for a answer.

Serge

Hello all, 

Is there any way to avoid the 'Error, recursive assignment' in the expressions below?

The 's' at the LHS of ':=' is different from the 's' in 'omega[s]' or 'omega['s']'.

s NULL:= omega[sl]/omega[s];

Error, recursive assignment

 

s ``:= omega[sl]/omega['s'];

Error, recursive assignment

 

 

 


 

Download Q_20200621.mw

Hi!

I try to figure out how to add »kr« as a currency symbol, and as currency in the Numeric Formatting list.

Can it be done?

Kind regards

I hvae Maple 2020 installed on Linux Ubuntu, and there is a foler maple2020. Could anyone help me with, where is the user initialization file,  .mapleinit, in Maple Linux, or how to creat an  .mapleinit file?

Many Thanks.

This works

restart;
patmatch(3*g(x),A::nonunit(algebraic)*B::function,'la');
la

[A = 3, B = g(x)]

But this fails

restart;
patmatch(3*g(x),conditional(A::nonunit(algebraic)*B::function, true ),'la');

Error, (in PatternMatching:-AlgStruct:-Match) improper op or subscript selector
 

I am not able to see why. In the above I used true for the condition, just to keep things simple. Any boolean valued expression will work.  

changing the above to

restart;
patmatch(3*g(x),conditional(A::anything*B::function, true ),'la');

it works. No error. [A = 3, B = g(x)]

What did I do wrong in the above syntax which generated the error?

Maple 2020.1

 

Please, l need assistance on maplesoft activation code 

 

Hi, 

How can I determine an expression is of the form a*b where a is anything but a function of t, and b a function of t?
I thought I could do this using patmatch but I can't make it work correctly.

For instance I would like patmatch (or something else) to return [a=C, f=F] when called this way patmatch(C*F(t), ?)

Thanks in advance

First 418 419 420 421 422 423 424 Last Page 420 of 2308