Items tagged with assume

Hi everybody,

 

Here is a very simple question :
I have two strictly positive reals r and s and the expression
a := r^2 – r*s + s^2
Obviously a is strictly positive too

But I’m not capable to prove this with Maple (2016, Windows 7), even after having declared r and s both positive which, I thought, would have prevent Maple to consider them as potentially complex.
I failed in using "is", "coulditbe", "use RealDomain ..." and so on

Totally distressed I tried to do something simpler ... which ultimately appeared still more upsetting

restart:
assume(r, ‘positive’):
coulditbe(r, ‘complex’) ;    # the answer is (surprising ?) true

I'm probably doing some mistake bigger than I but I don't find it !

Could you be compassionate enough to enlight me !!!

Mammoth thanks in advance

Hello,

I want to check via Maple whether the term is always bigger than c/4 (it is), but using verify(TERM, c/4, greater_than) just returns FALSE. I did assume(a > 0, b > 0, -1 <= c and c <= 1); It would be nice if you could tell me what exactly is causing the problem and how to solve it.

Thanks in advance

(9*a^3*b^3*c^2+4*a^6*c+16*a^5*b*c+47*a^4*b^2*c+82*a^3*b^3*c+47*a^2*b^4*c+16*a*b^5*c+4*b^6*c+16*a^5*b+80*a^4*b^2+132*a^3*b^3+80*a^2*b^4+16*a*b^5)*(a+2*b)^2*(a+b)^2*(2*a+b)^2/((4*a^6+28*a^5*b+77*a^4*b^2+106*a^3*b^3+77*a^2*b^4+28*a*b^5+4*b^6)*sqrt(-9*a^2*b^2*c^2+32*a^3*b*c+62*a^2*b^2*c+32*a*b^3*c+16*a^4+80*a^3*b+132*a^2*b^2+80*a*b^3+16*b^4)*sqrt(-9*a^4*b^4*c^2+24*a^6*b^2*c+28*a^5*b^3*c-14*a^4*b^4*c+28*a^3*b^5*c+24*a^2*b^6*c+16*a^8+112*a^7*b+276*a^6*b^2+296*a^5*b^3+220*a^4*b^4+296*a^3*b^5+276*a^2*b^6+112*a*b^7+16*b^8))

 

I can't get the Real and Imaginary parts of matrix to seperate out as required. It is an SU(2) matrix. Want to convert is to a 4 Vector (quaternion). I think because Maple doesnt know what psi(t) is being conservative so to speak. Tried assume, assuming...
 

restart

assume*{psi(t), 'real'}

assume*{real, psi(t)}

(1)

V := Matrix(2, 2, {(1, 1) = (1/4)*cos((1/2)*psi(t))*sqrt(2)*sqrt(4-2*sech((1/6)*sqrt(3)*t))-I*cos((1/2)*psi(t))*sqrt(2)*tanh((1/6)*sqrt(3)*t)/sqrt(4-2*sech((1/6)*sqrt(3)*t))-((1/2)*I)*sin((1/2)*psi(t))*sqrt(2)*sqrt(3)*sech((1/6)*sqrt(3)*t)/sqrt(4-2*sech((1/6)*sqrt(3)*t)), (1, 2) = (1/2)*cos((1/2)*psi(t))*sqrt(2)*sqrt(3)*sech((1/6)*sqrt(3)*t)/sqrt(4-2*sech((1/6)*sqrt(3)*t))+((1/4)*I)*sin((1/2)*psi(t))*sqrt(2)*sqrt(4-2*sech((1/6)*sqrt(3)*t))-sin((1/2)*psi(t))*sqrt(2)*tanh((1/6)*sqrt(3)*t)/sqrt(4-2*sech((1/6)*sqrt(3)*t)), (2, 1) = ((1/4)*I)*sin((1/2)*psi(t))*sqrt(2)*sqrt(4-2*sech((1/6)*sqrt(3)*t))+sin((1/2)*psi(t))*sqrt(2)*tanh((1/6)*sqrt(3)*t)/sqrt(4-2*sech((1/6)*sqrt(3)*t))-(1/2)*cos((1/2)*psi(t))*sqrt(2)*sqrt(3)*sech((1/6)*sqrt(3)*t)/sqrt(4-2*sech((1/6)*sqrt(3)*t)), (2, 2) = ((1/2)*I)*sin((1/2)*psi(t))*sqrt(2)*sqrt(3)*sech((1/6)*sqrt(3)*t)/sqrt(4-2*sech((1/6)*sqrt(3)*t))+(1/4)*cos((1/2)*psi(t))*sqrt(2)*sqrt(4-2*sech((1/6)*sqrt(3)*t))+I*cos((1/2)*psi(t))*sqrt(2)*tanh((1/6)*sqrt(3)*t)/sqrt(4-2*sech((1/6)*sqrt(3)*t))})

Matrix(%id = 18446744074495800014)

(2)

``

``

v := Vector(4, [Re(V[1, 1]), Im(V[1, 2]), Re(V[2, 1]), Im(V[1, 1])])

Vector[column](%id = 18446744074531387982)

(3)

``


 

Download extract_R_and_I.mw

I'm trying to solve

deq := diff(theta(x), x) = -sin(theta(x));
                         
sol := dsolve({deq, theta(0) = -(1/2)*Pi});
 

The answer should be theta=-2*arctan(exp(-x))

but I get

theta(x) = arctan(2*exp(-x+I*Pi)/((exp(-x+I*Pi))^2+1), -((exp(-x+I*Pi))^2-1)/((exp(-x+I*Pi))^2+1))

Does it have to do with assuming?

Staffan Malmberg

 

#my testing for wildcard to one
#after testing, it loop a very long time and not stop
ppp := [[0,0,0,x],[0,0,1,0],[0,1,0,0],[1,0,0,0]]:
check1 := [seq(0,ii=1..nops(ppp))];
ttt1 := [[0,0,0,1],[0,0,1,0],[0,1,0,0],[1,0,0,0]]:
mmmeaght1 := [seq(0,ii=1..nops(ppp[1]))]:
bbb1 := [seq(0,ii=1..nops(ppp[1]))]:
emap := [(xx) -> if [xx < 0 assuming x > 0] then 0 else 1 end if, (xx) -> evalf(1/(1+exp(xx)))]:
#trace(perceptronrule1);
MM(ppp, ttt1, mmmeaght1, bbb1, check1, emap);
 

when test wildcard variable for input, would like to assume x > 0 then

i try assuming x > 0 , got error

 

Hi.

I have 2 expressions, the first expression cosist of x´s and y´s, the other expression consits only of x´s

I wanna test the relation between those 2 expression to check wether A>B giving the condition that 2y<x

I have tried this:

assume(2y<x);

is(A>B);

the problem is that maple returns FAIL, I could put in values to check and it works, but that is not really what im trying to acomplish.

 

Thanks

I am interested in the behaviour of a system of equations close to the origin- these equations are quite long, and there are a lot of them so i would like to have commands that i can use to assume products of variables are zero. 

here are the first two polynomials:


alpha*k[a1]*B[1]^2+(-alpha*k[a1]-alpha*k[a2])*B[2]*B[1]+2*alpha*k[a1]*B[1]*B[11]+alpha*k[a1]*B[12]*B[1]+2*alpha*k[a1]*B[1]*B[211]+alpha*k[a1]*B[221]*B[1]+2*alpha*k[a1]*B[1]*B[2211]+(-alpha*R[b]*k[a1]-k[d1])*B[1]+2*B[11]*k[d1]+B[12]*k[d2]+k[d1]*B[211]+k[d2]*B[221]

(-alpha*k[a1]-alpha*k[a2])*B[2]*B[1]+alpha*k[a2]*B[2]^2+2*alpha*k[a2]*B[2]*B[22]+alpha*B[2]*B[12]*k[a2]+alpha*k[a2]*B[2]*B[211]+2*alpha*k[a2]*B[2]*B[221]+2*alpha*k[a2]*B[2]*B[2211]+(-alpha*R[b]*k[a2]-k[d2])*B[2]+B[12]*k[d1]+2*B[22]*k[d2]+k[d1]*B[211]+k[d2]*B[221]

the varables are the terms with B and a subsript and everything else is a parameter.

My intuition was to use coeffs but I couldn't get anything helpful

hi every one ! i want to use Assume option to simplify some expression ! but it is not working ! what should i do !?

i have assume that ( a+b+c=0) and i want maple returns me exp(a+b+c) =1 ! but it does not ! what should i do !?


restart:with(Physics):

Assume(a+b+c=0):

about(a+b+c)

a+b+c:

  is assumed to be: 0

 

simplify(exp(a)*exp(b)*exp(c))

exp(a+b+c)

(1)

simplify(exp(a+b+c))

exp(a+b+c)

(2)

 


Download assume.mw

Assume i got an equation like f(x):=2*x-tan(x); how to us solve or other function to give me that this equation got 2 root: x=1/2*(tan(x)) and x=arctan(2x).

^^ hope everyone can help.

Thank for spend time reading.

intersection in the geometry package does not seem to recognize assume.

restart: with(geometry):

assume(p[1]<>0, p[2]<>0, p[3]<>0);
assume(q[1]<>0, q[2]<>0, q[3]<>0);
point(T,[p[1],q[1]]);
point(U,[p[2],q[2]]);
point(V,[p[3],q[3]]);
point(Op,[0,0]);

line(OT,[Op,T]);
line(OU,[Op,U]);
line(OV,[Op,V]);

point(B,2*q[2],solve(subs(x=2*q[2],Equation(OU)),y));
coordinates(B);
IsOnLine(B,OU);

PerpendicularLine(AD,B,OT);
ArePerpendicular(AD,OT);
sol:=solve({Equation(AD),Equation(OT)},{x,y});
eval(x,sol);
point(A,eval(x,sol),eval(y,sol));  ## the intersection exists
intersection(xA,AD,OT); ## fails
about(p[1]),about(q[1]);

Hi guys,

I'm doing some heavy analytical calculations, as the calculations take hours to finish, I want to save the results, which is easily done, however when I load the saved results, it behaves differently, somehow I can no longer substitute the variables. I extracted the main problem into the following minimal working example.

Thanks for any useful insight,

Cheers, Sören

restart():

assume(`in`(n, real))

x := n+1

n+1

(1)

subs(n = 1, x)

2

(2)

save x, "./myfunction.m";

read "./myfunction.m";

x

n+1

(3)

Now we can't substitute n in x:

subs(n = 1, x)

n+1

(4)

subs(n = 1, n+1)

2

(5)

y := x:

Download assume_and_save.mw

The question in the title has been raised before over the years, but has maybe not received enough attention.
Reraising the question was motivated by a comment by Kitonum to a recent post on improved integration results in Maple 2016:
http://mapleprimes.com/maplesoftblog/202910-New-And-Improved-Integration-Results

Consider the following session.
restart;
assume(n=0);
n^2; #Returns n^2
eval(%);#Returns n^2
sin(n*Pi); # Returns 0
sin(n); # Returns sin(n)
eval(%); # Returns sin(n)
ln(n); #Returns ln(n)
ln(n*exp(1)); # Returns ln(n*exp(1))
expand(%); # Error, (in ln) numeric exception: division by zero
ln((n+1)*exp(1)); Returns ln((n+1)*exp(1))
expand(%); # Returns ln(n+1)+1
sqrt(n^2); # Returns 0
sqrt(n); # Returns n^(1/2)
eval(%,n=n^2); # Returns (n^2)^(1/2)
simplify(%); #Returns 0: simplify doesn't help in the examples above.
##################
We see that assume n=0 certainly doesn't imply that expressions always will be evaluated at n=0, but sometimes it appears that it does.
So what is the intended behavior when assuming equality?
##
Several years ago (Maple 14 or earlier) I overloaded assuming so that equality assumptions were handled by eval.
There was a discussion at the time in MaplePrimes about this. Shall try to find the link.

Hey,

I think I found a bug concerning the useage of assume and alias:

restart:

alias(a=a(t),b=b(t));

a, b

(1)

assume(a(t),real);

getassumptions(a(t));

{((a(t))(t))::real}

(2)

assume(b(t),real);

getassumptions(a(t));

{((b(t))(t))::real}

(3)

getassumptions(b(t));

{((b(t))(t))::real}

(4)

 

 

 

Commenting out the alias command produces correct results. I am on linux with build 922027.

alias_bug.mw

I am having trouble removing assumptions that are stored within expresssions.

Example code:

assume(l1>0): # this assumptions later helps to find a solution for a geometric problem with two four-bar-linkages
a := sqrt(l1);
save a, "test.m";
restart;
read "test.m"
a; # the assumptions are stored within the saved data
l1:='l1'; # try to remove the assumption
a; # assumption in a still existing
subs({l1=2}, a); # nothing happens: I can not access l1 any more
subs({l1~=2}, a); # This does not work either, nothing changes in a

So my question is: How do I remove the assumption within a stored expression?

My main problem lies in the handling of the expression with assumptions. At some point, I want to generate Matlab code, and the codegen-command gives me:

Warning, the following variable name replacements were made: l1~ -> cg

 

Hi All,

 

I have o problem with simplify. A variable cp1r has been assumed to be positive. Why simplify still has csgn(cp1r) for it? Here is my code:

tmp := subs(cp1t(t)=cp1r, cp2t(t)=cp2r, Ca[2]);
1 / 2 2
----------- |-cp2r sin(x[1]) sin(x[7]) cp1r
2 2 |
cp1r cp2r |
\

2
+ 2 cp2r sin(x[1]) cos(x[1]) cos(x[7]) sin(x[7]) cp1r +

1 / 2 2 /
-------------- \cp2r cos(x[1]) cos(x[7]) sin(x[7]) \
(1/2)
/ 2\
2 \cp1r /
2 \\\
-2 cos(x[1]) cos(x[7]) sin(x[1]) + 2 sin(x[1]) cos(x[1])//|
|
|
/
assume(cp1r > 0, cp2r > 0);
simplify(tmp);
1 / / 3 3
---------- \sin(x[1]) sin(x[7]) \-cos(x[1]) cos(x[7])
2
cp1r cp1r

+ 2 cos(x[1]) cos(x[7]) cp1r csgn(cp1r) cp1r

2 3 \ \

- cp1r csgn(cp1r) cp1r + cos(x[1]) cos(x[7])/ csgn(cp1r)/

 

should csgn(cp1r) be simplified to 1 already? What is wrong with my script?

 

Thanks 

Everett

1 2 Page 1 of 2