nm

11458 Reputation

20 Badges

13 years, 77 days

MaplePrimes Activity


These are answers submitted by nm

Under Options->General. Uncheck it

 

try expanding it first so both sides have same structure?    evalb(a-a*b=expand(a*(1-b)))  now gives true.

Help says

The evalb command does not simplify expressions. It may return false for a relation that is true. In such a case, apply a simplification to the relation before using evalb.
 

In this case simplify() did not make it give true.

or you could just use is(a-a*b=a*(1-b)) gives true without the need to expand or simplify.

You can try adding some assumptions? for example

expr:=sqrt(y^2/(x^2+y^2))*sqrt(x^2+y^2)

(y^2/(x^2+y^2))^(1/2)*(x^2+y^2)^(1/2)

simplify(expr)

(y^2/(x^2+y^2))^(1/2)*(x^2+y^2)^(1/2)

simplify(expr) assuming x::real,y::real

abs(y)

simplify(expr) assuming x::real,y::real,y>0

y

 

Download t2.mw

This works for me. 

 

restart;
f := 9*x^3 - 7*x^2*y + 8*x*y^2 - 6*y^3 + 3*x^2 - 3*x*y + 4*y^2 - 3*x + 9*y - 7;
fx:=diff(f,x);
fy:= diff(f,y);

ctpts:= solve({fx=0,fy=0},{x,y});
evalf(allvalues(ctpts))

 

{x = 0.04295586238 + 0.2689937615*I, y = 0.9924517251 + 0.1221355623*I}, {x = -0.1196978953, y = -0.5678259706}, {x = -0.2777747003, y = -0.6265224321}, {x = 0.04295586238 - 0.2689937615*I, y = 0.9924517251 - 0.1221355623*I}

 

I do not know how to add rules to the build in simplify command in Maple (It is possible to do this in Mathematica easily). May there is a way to do it in Maple in order to teach it a new "rule".  The standard simplify(expr,ln) did not do it.

For now you can do

expr:=(ln(-z*I + b) - ln(z*I + b));
I*simplify(log(exp(expr)))

I calculated 6 critical points :how to show them in the plot? 

restart;
f:=(x,y)->x^4-3*x^2-2*y^3+3*y+1/2*x*y; 
cp:=  solve( {diff(f(x,y),x)=0,diff(f(x,y),y)=0}, {x,y});
cp:=  evalf(allvalues(cp));
pts:= map(X->eval([x,y],X),[cp]);
pts:=map(X->[op(X),f(X[1],X[2])],pts);
plots:-display([plot3d(f),plots:-pointplot3d(pts,'color'='red','symbol'='solidcircle','symbolsize'=15)])

 

Using the view point used by others, we get

plots:-display([plot3d(f(x,y),x=-2..2,y=-2..2, view=-6..6),plots:-pointplot3d(pts,'color'='red','symbol'='solidcircle','symbolsize'=15)])

How to make table out of this list.CriticalPoints. for easy reading.?

 

<<'x'|'y'|'z'>,Matrix(pts)>

would it not be better to just use collect? Then the result is automatically sorted by L[n], but it is also collected, which is easier to read also.

result:= expand(((673*L[13] - 485*L[14] - 176*L[15])*h^2 - 90*(L[13] - (13*L[14])/15 - (2*L[14])/15)*x*h)/(12*h^3));
collect(result,indets(result,'indexed'))

 

Alternatively, a way to factorize 6*x^2+a*x-10 into (a+6*x)*x-10 could do the trick.

restart;
expr:=a*x+6*x^2-10;
tmp:=select(has,expr,x);
factor(tmp)+expr-tmp;

I am not sure if is possible to write Q3 = gamma*Q1 + (1-gamma)*Q2 

Maple says it is not possible. You can try simplify with side relations

 

restart;
Q3 := 1/(v)*(    v*pi-  (   (1-alpha*gamma) *pi * r[0]  - (1-pi)*B*alpha  + (gamma*pi + (1-pi)*h)    )   );
eqs:={ 1/v *(  v*pi    -  (   h - (1-pi)*B   )      )=Q2,1/v*(   v*pi     - (   pi*r[0]+ (1-pi)*h  )   )=Q1};
simplify(Q3,eqs);

 

I have not used this command before myself in Maple, but may this is what you want

plots:-conformal(exp(2*z), z=0..1+I);

may be you can use the definition of concave function. From Wiki

 differentiable function f is (strictly) concave on an interval if and only if its derivative function f ′ is (strictly) monotonically decreasing on that interval, that is, a concave function has a non-increasing (decreasing) slope.[3][4]

So just need one counter example. This is your g(x) function which is increasing and concave function g:=x-exp(-x). 

If you plot the derivative of   (2*x+5)*g(x), you will see is not concave.

 

Why would you load LinearAlgebra and then at same time make call to linalg:- ?

    Important: The linalg package has been deprecated. Use the superseding packages, LinearAlgebra

if you remove that then it works. It might have to do with how linalg works. I do dot know for sure, but this works.

To multiply these matrices/vectors, just use the dot. So intead of what you had

          linalg:-multiply(Ts_sksul, XCin)

you can just do

         Ts_sksul.XCin

 

fixed.mw

 

diff(x^n,x) does not equal n*x^(n-1), but rather 0 if n=1

you probably meant rather 1, and not rather 0..

This seems like a bug to me

it is not a bug. all CAS systems work on a general expressions, not specific values. 

 

 

 

To get derivative for specific you need to give specific value for n.

 

 

 

Maple by default uses 10 decimal points to display real numbers.

This works for 2021.1 on windows 10, using worksheet interface

restart;
interface(typesetting=extended);
Typesetting:-Settings(striptrailing=true);
V := 4;
K := 16.56;
H := 0.5;
q1 := diff(y[1](x), x) = V*y[2](x)/H - K*y[1](x)/H;

Or you could do

restart;
V := 4;
K := 16.56;
H := 0.5;
q1 := diff(y[1](x), x) = V*y[2](x)/H - K*y[1](x)/H:
convert(q1,rational)

See this post for reference. How-To-Delete-Zeros-After-Decimal-Point

btw, why are using evalf for? Your numbers already real.

 

When expression is   A+B then operands are A and B. And select selects operand which has what you wanted. So if the expression is t*u[1,1,1]*u[1,1,1,2]+2 then A=t*u[1,1,1]*u[1,1,1,2] and B=2, that is why it returned A.

When the input is t*u[1,1,1]*u[1,1,1,2] then expression is A*B*C and each one is now an operand. So A=t, B=u[1,1,1] and C=u[1,1,1,2] and that is why select now returned only u[1,1,1]

One way could be to do 

LT:=proc(expr, term)
 if type(expr,`+`) or nops(expr)=1 or expr=term then
    select(has, expr, term);
 elif type(expr,`*`) then
      if has(expr,term) then
          return expr;
      else
          return NULL;
      fi;
 else
     error "not expression?";
 fi;
end proc;

And now it works for both cases

 

 

First 7 8 9 10 11 12 13 Last Page 9 of 20