Kitonum

21435 Reputation

26 Badges

17 years, 22 days

MaplePrimes Activity


These are replies submitted by Kitonum

@acer  Thank you.

Maple 2018 easily handles this trivial example as well. But it fails with a slightly complicated example below. I wonder what will happen in Maple 2020?

restart;
kernelopts(version);

assume(x, 'real'); assume(y, 'real');
verify(x^2 - x*y + y^2, 0, {'greater_equal'});
is(x^2 - x*y + y^2>=0);

restart;
verify(x^2 - x*y + y^2, 0, {'greater_equal'}) assuming x::real, y::real;
is(x^2 - x*y + y^2>=0) assuming x::real, y::real;

                                    

 

 

Download example.mw

@gst  Try

restart;

divide5_new := proc(g, k)
  local x, r;
  if type(k,numeric) then if k < 3 then return 0 else return unapply((1/5)*g(i, x), i, x) fi; 
else return piecewise(k<3,0,unapply((1/5)*g(i, x),i,x)) fi; 
end proc:

# Example

f :=  (i,x) -> x^2+i :
f1:=divide5_new(f, i);
eval(f1,[i=1,x=2]);
eval(f1,[i=4,x=2]);

 

@Carl Love  Your code results in an error:

divide5_new:= proc(g, k)
local x;
    if k::numeric then `if`(k<3, 0, unapply((1/5)*g(k, x), k, x))
    else unapply(piecewise(k<3, 0, (1/5)*g(k, x)),k,x) 
    fi
end proc:

f :=  (i,x) -> x^2+i :
f3 := divide5_new(f, 4);

      Error, (in unapply) variables must be unique and of type name

@vv  Thanks for this method. The key to success here, of course, is to rewrite the system as a polynomial system (without  sqrt ). Unfortunately, we have to do it manually. After that, the  solve  command also solves the problem.

sys := r-c>0, 0<=r^2 - 2*r*c -r +2*c, r^2 - 2*r*c -r +2*c  < (r-c)^2, 0<=c, c<=1 , 0<r, r<1, r<2*c:
solve([sys], r, parametric=true);


Wolfram Mathematica solves the problem immediately in its original setting:

 

 

@manju  1. Maple can choose a random object only from a certain finite set. Therefore, a certain range must be specified.
2. Replace colons with semicolons, for example  a_1:=rand(1..5)();  and so on.

It is enough to use backticks only in denominators, for example   4=456/`1920`  and so on.

@Maple_lover1  I corrected my answer.

@BrettKnoss  See my solution above.

@BrettKnoss  I didn't understand the meaning of your question. If a series is given, then the general term of the series  u(n)  must be known for any  .

@BrettKnoss  c(n)  is just the coefficient in front of  n_th  term of the series:

restart;
S := Sum((x-2)^n/(n^2-1)^2, n = 2 .. infinity);
op(1,S);
coeff(%, (x-2)^n);

                       

 

@matviiv10 

restart;
h:=0.01: r:=0.02: N:=10: f:=y->y^5: K:=(x,y)->sin(x)*y^5:
for n from 1 to N do 
x[n]:=sin(h*n);
od:
for m from 1 to N do
y[m]:=cos(r*m);
od:
n:='n': m:='m':
Sys:={seq(sum(K(x[n],y[m])*U[n],n=1..N)=f(y[m]), m=1..N)};
solve(Sys);
assign(%);
plot([seq([x[n],U[n]], n=1..N)]);

 

@ahmeng  Above, I showed only one solution (in my opinion, the most direct and reliable). Here are 2 more ways:


 

restart

``

"f(x):=18*log10(x);"

proc (x) options operator, arrow, function_assign; 18*log10(x) end proc

(1)

"g(x):=1/(2) x^(3)-8*x^(2)+(69/(2))^()*x-27;"

proc (x) options operator, arrow, function_assign; (1/2)*x^3-8*x^2+(69/2)*x-27 end proc

(2)

plot([f(x), g(x)], x = -1 .. 11)

 

``

`assuming`([solve(f(x)-g(x), x)], [x::real])

exp(RootOf(-(exp(_Z))^3*ln(10)+16*(exp(_Z))^2*ln(10)-69*exp(_Z)*ln(10)+54*ln(10)+36*_Z))

(3)

allvalues(exp(RootOf(-(exp(_Z))^3*ln(10)+16*(exp(_Z))^2*ln(10)-69*exp(_Z)*ln(10)+54*ln(10)+36*_Z)))

exp(RootOf(-(exp(_Z))^3*ln(10)+16*(exp(_Z))^2*ln(10)-69*exp(_Z)*ln(10)+54*ln(10)+36*_Z, 1.505446443)), 1, exp(RootOf(-(exp(_Z))^3*ln(10)+16*(exp(_Z))^2*ln(10)-69*exp(_Z)*ln(10)+54*ln(10)+36*_Z, -3.291052648)), exp(RootOf(-(exp(_Z))^3*ln(10)+16*(exp(_Z))^2*ln(10)-69*exp(_Z)*ln(10)+54*ln(10)+36*_Z, 2.302585093)), exp(RootOf(-(exp(_Z))^3*ln(10)+16*(exp(_Z))^2*ln(10)-69*exp(_Z)*ln(10)+54*ln(10)+36*_Z, 1.788246136-5.696578776*I)), exp(RootOf(-(exp(_Z))^3*ln(10)+16*(exp(_Z))^2*ln(10)-69*exp(_Z)*ln(10)+54*ln(10)+36*_Z, .6642129866+7.816965006*I)), exp(RootOf(-(exp(_Z))^3*ln(10)+16*(exp(_Z))^2*ln(10)-69*exp(_Z)*ln(10)+54*ln(10)+36*_Z, 1.788246136+5.696578776*I)), exp(RootOf(-(exp(_Z))^3*ln(10)+16*(exp(_Z))^2*ln(10)-69*exp(_Z)*ln(10)+54*ln(10)+36*_Z, .6642129866-7.816965006*I))

(4)

evalf(%[1 .. 4])

4.506164927, 1., 0.3721465484e-1, 10.00000000

(5)

Student:-Calculus1:-Roots(f(x)-g(x), x)

[0.3721465485e-1, 1, 4.506164928, 10.00000000]

(6)

``


 

Download more_ways.mw

@ibrahimcbx 

1. You can do this with either separate commands or with a single command.

2. I didn't understand the meaning of your second question.

@Carl Love  It seems that your solution will be correct only in the segment  p in [0, 3-2*sqrt(2)]

 

First 17 18 19 20 21 22 23 Last Page 19 of 132