Items tagged with assume assume Tagged Items Feed

Hi Again

Assume that we have known matrix namely, Q, of order (m+1)*(m+1) and we want to construct following matrix

where 0(bar) is zero matrix of orde (m+1)*(m+1) and New matrix should be of order {N*(m+1)}*{N*(m+1)} where N is known constant.

thanks for any guide


Mahmood   Dadkhah

Ph.D Candidate

Applied Mathematics Department

according to

http://www.maplesoft.com/support/faqs/detail.aspx?sid=32658

But the above does not work in Maple 18, windows: (I use worksheet)

restart;
assume(z>0):
interface(showassumed=0):
z;

Only the other solution works, which is using options->display->turnoff assumed variables tilda.

Why does not the above command work?

Hi all

I have a mathematical problem and I asked it in various sites but the answers till yet are not correct.

Assume that we have:

T[m]:=t->t^m:
b[n,m]:=unapply(piecewise(t>=(n-1)*tj/N and t<n*tj/N, T[m](N*t-(n-1)*tj), 0), t):

where n,N,tj are known constants. furthermore assume that we want to comute the following integral:

for following approximations:

I have written the following code but it seems to be incorrect:

V1:=Vector([seq(seq(b[n,m](t),m=0..1),n=1..3)]);
V:=evalf(V1.Transpose(V1));

the original program is :

taaylor.mws

I will be so grateful if any one can help me to solve it by maple

Mahmood   Dadkhah

Ph.D Candidate

Applied Mathematics Department

Hello,

Maple needs 827 characters to write a equation of a straight line.
Is that true or what am I doing wrong?   

Can anybody help me or give a direction to handle with such problems?

Putting
  assume(2<alpha , alpha<=4);about (alpha);
before it does not help either.

f:=-(6*(3*alpha^2*(alpha-1+sqrt(alpha^2-3*alpha+2))^4/(alpha-1)^4-12*alpha^2*(alpha-1+sqrt(alpha^2-3*alpha+2))^3/(alpha-1)^3-6*alpha*(alpha-1+sqrt(alpha^2-3*alpha+2))^4/(alpha-1)^4+16*alpha^2*(alpha-1+sqrt(alpha^2-3*alpha+2))^2/(alpha-1)^2+24*alpha*(alpha-1+sqrt(alpha^2-3*alpha+2))^3/(alpha-1)^3+3*(alpha-1+sqrt(alpha^2-3*alpha+2))^4/(alpha-1)^4-8*alpha^2*(alpha-1+sqrt(alpha^2-3*alpha+2))/(alpha-1)-24*alpha*(alpha-1+sqrt(alpha^2-3*alpha+2))^2/(alpha-1)^2-12*(alpha-1+sqrt(alpha^2-3*alpha+2))^3/(alpha-1)^3+8*(alpha-1+sqrt(alpha^2-3*alpha+2))^2/(alpha-1)^2+8*alpha+(8*(alpha-1+sqrt(alpha^2-3*alpha+2)))/(alpha-1)-7))/(alpha*(alpha-1+sqrt(alpha^2-3*alpha+2))^2/(alpha-1)^2-2*alpha*(alpha-1+sqrt(alpha^2-3*alpha+2))/(alpha-1)-(alpha-1+sqrt(alpha^2-3*alpha+2))^2/(alpha-1)^2+(2*(alpha-1+sqrt(alpha^2-3*alpha+2)))/(alpha-1)-1)^4;

It is well known that  operating in  geometry  package when setting objects symbolically some inconveniences arise. The error occurs if you do not set limits on the parameters. I wrote the procedure for finding center and radius of the circumscribed circle, devoid of drawbacks:

restart;

Circumcircle:=proc(a,b,c)

local x1, y1, x2, y2, x3, y3, n;

uses geometry;

x1,y1:=op(a); x2,y2:=op(b); x3,y3:=op(c);

n:=x2*y3-x3*y2+x3*y1-x1*y3+x1*y2-x2*y1;

point(A,a), point(B,b), point(C,c);

if type(n,realcons) then triangle(T,[A,B,C]); circumcircle(cc,T,'centername'=OO);

return [coordinates(OO),radius(cc)]  else assume(n<>0);

triangle(T,[A,B,C]); circumcircle(cc,T,'centername'=OO);

simplify([coordinates(OO),radius(cc)]); fi;

end proc:

 

At initial startup procedure works correctly:

Circumcircle([x1,y1], [x2,y2], [x3,y3]);

 

 

But if you change the arguments of the procedure, an error occurs:

Circumcircle([x1,1], [x2,y2], [x3,y3]);

 

But if you run the procedure again with the same arguments, the error disappears:

Circumcircle([x1,1], [x2,y2], [x3,y3]);

 

What is the reason?

Circumcircle.mws

Hi MaplePrime-ers!

I've been using the Maple(17) toolbox in Matlab(2012b) to quickly enumerate systems of equations by: (i) solving them symbolically, (ii) using unapply to make them functions, (iii) then supplying the points (driver equations) to get the system solution.  Speed is a must, because there may be 3 million+ systems to solve.  Symbolics is also very important because I am evaluating topology, so the structure of the equations may change, and therefore a functional approach will not work.

I have had success (seen in the first code snippet).  I would like similiar behaviour in the second code snippet, but sometimes I get 'solutions may be lost' as an error message,  or 'Error, (in unapply) variables must be unique and of type name'

The system of equations include:  Linear equations, 5th order polynomials, absolute functions, and pieceiwse functions.

Here is code with a topology that solves:

#Interconnection Equations
eq2[1] := FD_T + EM2_T = 0;
eq2[2] := ICE_T + GEN_T = 0;
eq2[3] := EM2_A + GEN_A + BAT_A = 0;
eq2[4] := -FD_W + EM2_W = 0;
eq2[5] := -ICE_W + GEN_W = 0;
eq2[6] := -EM2_V + GEN_V = 0;
eq2[7] := -EM2_V + BAT_V = 0;

#ICE
eq_c[1] := ICE_mdot_g=((671.5) + (-21.94)*ICE_T + (0.1942)*ICE_W + (0.5113)*ICE_T^2 + (-0.01271)*ICE_T*ICE_W + ( -0.0008761)*ICE_W^2 + (-0.006071)*ICE_T^3 + (9.867e-07)*ICE_T^2*ICE_W + (5.616e-05)*ICE_T*ICE_W^2 + (1.588e-06)*ICE_W^3 + (3.61e-05)*ICE_T^4 + (8.98e-07)*ICE_T^3*ICE_W + (-2.814e-07)*ICE_T^2*ICE_W^2 + (-8.121e-08)*ICE_T*ICE_W^3 + ( -8.494e-08 )*ICE_T^5 + (-2.444e-09)*ICE_T^4*ICE_W + (-9.311e-10)*ICE_T^3*ICE_W^2 + ( 5.835e-10)*ICE_T^2*ICE_W^3 ) *1/3600/1000 * ICE_T * ICE_W;

#BAT
eq_c[2] := BAT = 271;

#EM2
EM2_ReqPow_eq := (-148.3) + (4.267)*abs(EM2_W) + (12.77)*abs(EM2_T) + (-0.0364)*abs(EM2_W)^2 + ( 1.16)*abs(EM2_W)*abs(EM2_T) + (-0.258)*abs(EM2_T)^2 + ( 0.0001181)*abs(EM2_W)^3 + (-0.0005994)*abs(EM2_W)^2*abs(EM2_T) + ( 0.0001171)*abs(EM2_W)*abs(EM2_T)^2 + (0.001739 )*abs(EM2_T)^3 + (-1.245e-07 )*abs(EM2_W)^4 + ( 1.2e-06)*abs(EM2_W)^3*abs(EM2_T) + ( -1.584e-06)*abs(EM2_W)^2*abs(EM2_T)^2 + ( 4.383e-07)*abs(EM2_W)*abs(EM2_T)^3 + (-2.947e-06)*abs(EM2_T)^4;
eq_c[3] := EM2_P = piecewise( EM2_T = 0, 0, EM2_W = 0, 0, EM2_W*EM2_T < 0,-1 * EM2_ReqPow_eq, EM2_ReqPow_eq);
eq_c[4] := EM2_A = EM2_P/EM2_V;

#GEN
GEN_ReqPow_eq:= (-5.28e-12) + ( 3.849e-14)*abs(GEN_W) + (-71.9)*abs(GEN_T) + (-1.168e-16)*abs(GEN_W)^2 +(1.296)*abs(GEN_W)*abs(GEN_T) + (2.489)*abs(GEN_T)^2 + (1.451e-19)*abs(GEN_W)^3 + (0.0001326)*abs(GEN_W)^2*abs(GEN_T) + (-0.008141)*abs(GEN_W)*abs(GEN_T)^2 + (-0.004539)*abs(GEN_T)^3 +(-6.325e-23)*abs(GEN_W)^4 + (-2.091e-07)*abs(GEN_W)^3*abs(GEN_T) + ( 3.455e-06)*abs(GEN_W)^2*abs(GEN_T)^2 + ( 2.499e-05)*abs(GEN_W)*abs(GEN_T)^3 + (-5.321e-05)*abs(GEN_T)^4;
eq_c[5] := GEN_P = piecewise( GEN_T = 0, 0, GEN_W = 0, 0, GEN_W*GEN_T < 0,-1 * GEN_ReqPow_eq, GEN_ReqPow_eq);
eq_c[6] := GEN_A = GEN_P/GEN_V;

#ASSUMPTIONS
assume(BAT_V::nonnegative);
assume(FD_W::nonnegative);

#FINAL EQUATIONS

sys_eqs2 := convert(eq2,set) union {eq_c[1],eq_c[2],eq_c[3],eq_c[4],eq_c[5],eq_c[6]};

#Selecting which variables to solve for:

drivers2:= { ICE_T,ICE_W,FD_T,FD_W};
symvarnames2:=select(type,indets(convert(sys_eqs2,list)),name);
notdrivers2:=symvarnames2 minus drivers2;


#Symbolic solve

sol2:=solve(sys_eqs2,notdrivers2) assuming real:
symb_sol2:=unapply(sol2,convert(drivers2,list)):


#Enumerate (there will generally be about 40, not 6)

count := 0;
for i1 from 1 to 40 do
     for i2 from 1 to 40 do
          for i3 from 1 to 40 do
               for i4 from 1 to 40 do
                    count := count + 1;
                    solsol2(count) := symb_sol2(i1,i2,i3,i4);
               od;
          od;
     od;
od;
count;



This works great!  I would like simliar output in my second code snippet, but this time with more inputs to symb_sol.  However, if I try and change the interconnection equations a little, and add a piecewise function, and another driver... (differences in bold)

#Interconnection Equations
eq1[1] := FD_T+EM2_T = 0;
eq1[2] := ICE_T+GBb_T = 0;
eq1[3] := GEN_T+GBa_T = 0;
eq1[4] := EM2_A+GEN_A+BAT_A = 0;
eq1[5] := -FD_W+EM2_W = 0;
eq1[6] := -GEN_W+GBa_W = 0;
eq1[7] := -ICE_W+GBb_W = 0;
eq1[8] := -EM2_V+GEN_V = 0;
eq1[9] := -EM2_V+BAT_V = 0;

#ICE
eq_c[1] := ICE_mdot_g=((671.5) + (-21.94)*ICE_T + (0.1942)*ICE_W + (0.5113)*ICE_T^2 + (-0.01271)*ICE_T*ICE_W + ( -0.0008761)*ICE_W^2 + (-0.006071)*ICE_T^3 + (9.867e-07)*ICE_T^2*ICE_W + (5.616e-05)*ICE_T*ICE_W^2 + (1.588e-06)*ICE_W^3 + (3.61e-05)*ICE_T^4 + (8.98e-07)*ICE_T^3*ICE_W + (-2.814e-07)*ICE_T^2*ICE_W^2 + (-8.121e-08)*ICE_T*ICE_W^3 + ( -8.494e-08 )*ICE_T^5 + (-2.444e-09)*ICE_T^4*ICE_W + (-9.311e-10)*ICE_T^3*ICE_W^2 + ( 5.835e-10)*ICE_T^2*ICE_W^3 ) *1/3600/1000 * ICE_T * ICE_W;

#BAT
eq_c[2] := BAT = 271;

#EM2
EM2_ReqPow_eq := (-148.3) + (4.267)*abs(EM2_W) + (12.77)*abs(EM2_T) + (-0.0364)*abs(EM2_W)^2 + ( 1.16)*abs(EM2_W)*abs(EM2_T) + (-0.258)*abs(EM2_T)^2 + ( 0.0001181)*abs(EM2_W)^3 + (-0.0005994)*abs(EM2_W)^2*abs(EM2_T) + ( 0.0001171)*abs(EM2_W)*abs(EM2_T)^2 + (0.001739 )*abs(EM2_T)^3 + (-1.245e-07 )*abs(EM2_W)^4 + ( 1.2e-06)*abs(EM2_W)^3*abs(EM2_T) + ( -1.584e-06)*abs(EM2_W)^2*abs(EM2_T)^2 + ( 4.383e-07)*abs(EM2_W)*abs(EM2_T)^3 + (-2.947e-06)*abs(EM2_T)^4;
eq_c[3] := EM2_P = piecewise( EM2_T = 0, 0, EM2_W = 0, 0, EM2_W*EM2_T < 0,-1 * EM2_ReqPow_eq, EM2_ReqPow_eq);
eq_c[4] := EM2_A = EM2_P/EM2_V;

#GEN
GEN_ReqPow_eq:= (-5.28e-12) + ( 3.849e-14)*abs(GEN_W) + (-71.9)*abs(GEN_T) + (-1.168e-16)*abs(GEN_W)^2 +(1.296)*abs(GEN_W)*abs(GEN_T) + (2.489)*abs(GEN_T)^2 + (1.451e-19)*abs(GEN_W)^3 + (0.0001326)*abs(GEN_W)^2*abs(GEN_T) + (-0.008141)*abs(GEN_W)*abs(GEN_T)^2 + (-0.004539)*abs(GEN_T)^3 +(-6.325e-23)*abs(GEN_W)^4 + (-2.091e-07)*abs(GEN_W)^3*abs(GEN_T) + ( 3.455e-06)*abs(GEN_W)^2*abs(GEN_T)^2 + ( 2.499e-05)*abs(GEN_W)*abs(GEN_T)^3 + (-5.321e-05)*abs(GEN_T)^4;
eq_c[5] := GEN_P = piecewise( GEN_T = 0, 0, GEN_W = 0, 0, GEN_W*GEN_T < 0,-1 * GEN_ReqPow_eq, GEN_ReqPow_eq);
eq_c[6] := GEN_A = GEN_P/GEN_V;

#GB
FiveSpeedGearbox_R := proc(ig)
local i ,eq;
i[1]:=3.32;
i[2]:=2;
i[3]:=1.36;
i[4]:=1.01;
i[5]:=0.82;
eq:= piecewise(ig=1,i[1],ig=2, i[2],ig=3,i[3],ig=4,i[4],ig=5,i[5],1);
return eq(ig);
end proc;


eq_c[7] := GBb_T = -1/GB_R * GBa_T;
eq_c[8] := GBb_W = GB_R * GBa_W;
eq_c[9] := GB_R = FiveSpeedGearbox_R(ig);

 

#System Equations
sys_eqs := convert(eq1,set) union convert(eq_c,set);

 

 #Solve for variables
symvarnames:=select(type,indets(convert(sys_eqs,list)),name);
drivers:= {ig, ICE_T,ICE_W,FD_T,FD_W};
not_drivers := symvarnames minus drivers;

#Assumptinons

assume(BAT_V::nonnegative);
assume(FD_W::nonnegative);

sol:=(solve(sys_eqs,not_drivers) assuming real);

symb_sol:=unapply(sol,convert(drivers,list)): ---> Error, (in unapply) variables must be unique and of type name

Subsequent parts don't work...

count := 0;
for i1 from 1 to 40 do
     for i2 from 1 to 40 do
          for i3 from 1 to 40 do
               for i4 from 1 to 40 do
                    for i5 from 1 to 40 do
                         count := count + 1;
                         solsol2(count) := symb_sol2(i1,i2,i3,i4,5);
                    od;
               od; 
          od;
     od;
od;
count;

While running the last line sol:, 1 of 2 things will happen, depending on the solver. Maple17 will take a long time (30+ minutes) to solve, then report nothing, or sol will solve, but will report "some solutions have been lost".

Afterwards, evaluating symb_sol(0,0,0,0,0) will return a viable solution (real values for each of the variables).  Whereas evaluating symb_sol(0,X,0,0,0), where X <> 0, will return and empty list [].

Does anyone know how to (i) speed up the symbolic solve time?  (ii) Return ALL of the solutions?

 

Thanks in advance for reading this.  I've really no idea why this isn't working.  I've also attached two worksheets with the code: noGB.mw   withGB.mw

 Adam

Hi,

I'm new to these forums. I'm using Maple 17. What am I missing about the odd behaviour exhibited below? (the code can be copy pasted into Maple)

Suppose I define m,n,p,q as integers and x as real, then define the function h(x,m,n,p,q) below.

assume(m::integer, n::integer, p::integer, q::integer, x::real);
h:=(x,m,n,p,q)->-(1/8*I)*(exp((2*I)*Pi*x)-1)^2*(exp(-(2*I)*Pi*x*(n-q+2))-exp(-(2*I)*Pi*x*(n-q+1)))/(Pi^3*x*(m-x)*(p-x));

If I do:

int(h(x, m, n, p, q), x = -infinity .. infinity)

It says it's 0, but that's not true. The integral is not always 0 but depends on m,n,p,q ... and even Maple acknowledges this. If I do:

int(h(x, 1, 1, 1, 1), x = -infinity .. infinity)

I get -(1/2*I)/Pi ... so clearly not 0.

Also, if I do:

int(h(x, m, n, m, n), x = -infinity .. infinity)

I get -(1/2*I)/(m*Pi) ... again, not 0.

What am I missing? How can I correct this and obtain the analytic expression for int(h(x, m, n, p, q), x = -infinity .. infinity)?

Trying without the assume() causes Maple to run into issues not knowing anything about m,n,p,q.

[ Edit: I finally solved the integral on paper, see my post below if you're curious. The Maple inconsistency and wrong result explained above are still there though ]

Any help would be greatly appreciated.

Regards,

Alex.

Hi.  I'm using Maple 16 to model a quantum harmonic oscillator.  If I leave the constants k, mu, hbar unspecified, I get a correct solution to the Schrodinger equation:

 

For example, fill in the follwing blanks with 1~9 numbers to make it as an identity, the numbers are MutuallyExclusive.
()/()+()/()+()/()+()/()=()
Thank you very much for any method.

Hello,

I got problem with assuming and solve.

`assuming`([solve(abs(-2*r*(-1/2)*(1+sqrt(1+4*r))/r)<1)],[r>-1/4]);

There is nothing happens... Neither solution or some errors

What am I doing wrong?

Could you please look at the following piace of code:

>assume(d::complex):
>z:=t=a/d:
>additionally(d≠0):
>z:=z*d;

The result of last command is

z:=d~t=d~*a/d~

that is not z:=d~t=a.

If I skip the command additionally(d≠0): then everything is good. However I need this command. Could you help to handle this problem?

Hello.

I have following peace of code:

>restart;
>assume(a::complex);
>z1:=t=conjugate(a)*b;
>z2:=a^2;
>a:=solve(z1,a);
>z2;

I need to get (conjugate(t))^2/b as a result of last operation but get a~^2. What do I have to change in code? Of course, I can skip

>assume(a::complex);

and it will get me exactly what I need. But I have to use this command for other reasons.

Thank you.

######################################

Hi all,

I have the following functions.

restart:
with(IntegrationTools):
N:=4:

i:='i':
for i from 1 to N do
assume(x[i-1]::constant):
assume(x[i+1]::constant):
assume(x[i-1]::constant):
assume(h::constant):
 phi[i](t):=piecewise(t>=x[i-1] and x[i]>t, (t-x[i])/(h), x[i]
(x[i+1]-t)/(h), 0);
end do;
## my goal is solve the integrals involving phi[i]'s as integrand and x[i]'s as its limits.

I am trying to evalute a double integral symbolically using Maple 15.  I have gotten it to work when some of the parameters are specific numbers, but it won't work if I use variables, even if I assume sufficient conditions on them for the integral to make sense.  I have tried to use AllSolutions but it didn't work.  Breaking it down into steps isn't working either. 

I am working on a file on a remote server and I don't think I can upload it here. ...

1 2 3 4 Page 1 of 4