Items tagged with assumptions

Feed

I want to find the first positive solution of the system of trigonometric equations inside the loop.

The solutions are in the form of "d=number*_Z +number" but I need one exact solution to use it for next run of the loop.
 

restart;
L[0]:=0:
for i from 1 by 1 to 3 do
assume(0<d[i], d[i]<1):
assume(-0.01<a[i], a[i]<0):
L[i]:= L[i-1]+ d[i]:
sys[i]:={Re((-80*Pi*I*a[i]/((a[i]+1)^3))*exp(4*Pi*I*L[i])) = -0.4, Im((-80*Pi*I*a[i]/((a[i]+1)^3))*exp(4*Pi*I*L[i])) = 0.8}:
solve(sys[i], {a[i],d[i]}, useassumptions = true,AllSolutions=true):
end do;
 

These are the solutions:

d[1] = 0.03689590440 + 0.5000000000 _Z1

d[2] = -1.000000000 d[1] + 0.03689590440 + 0.5000000000 _Z2

d[3] = -1.000000000 d[1] - 1.000000000 d[2] + 0.03689590440 + 0.5000000000 _Z3

 

I want to solve this equation with assumptions!!!

restart;
assume(d::real, d>0):
assume(a::real, -0.01 < a, a < 0):
sys:={-800*Pi*a*cos(6.557377048*Pi*(3.470797713+d))/(a+1)^3 = -.9396060697, 800*Pi*a*sin(6.557377048*Pi*(3.470797713+d))/(a+1)^3 = -.3238482794};
solve(sys, {a,d},useassumptions=true, AllSolutions=true);

one of the solutions has true "a" but "d" is wrong, I want one true solution!

In the below calculations, I get some solutions after solving the system. I am not sure if this is done assuming that all the values that are under the radicals are positive or indeed they are positive without further assumptions. I mean can I be sure that each given set of solution is a feasible solution? I suspect that Maple may ignore the assumptions sometimes.  

How do I assume variables as  Matrixs for calculation?
Please help me to solve this problem :

assume(M11::Matrix);
assume(M12::Matrix);
assume(M21::Matrix);
assume(M22::Matrix);
assume(A::Matrix);


A := M12*M21+M11;
                         M12 M21 + M11
solve(A = 0, M12);
Warning, solve may be ignoring assumptions on the input variables.
                               M11
                             - ---
                               M21
solve(A = 0, M12, useassumptions = true);
                               M11
                             - ---
                               M21


How can I get solution being a matrix?
Thank you very much !!!

I don' t understand what do these notations stand for? I know that there are some notations like these in Maple. How can I find meanings of the all of them?

 

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

What is the Maple command to simplify  -x^(a)+x^n  to zero under the assumption that a=n?

I have attempted the following command

simplify(-x^(a)+x^n) assuming a=n;

However, it did not produce zero. The following command however produces zero

subs(a=n,-x^(a)+x^n);

 How to do this operation using assumptions. How to inform Maple to assume that a=n.

 

Hi,

I am designing a power transformer using Maple, and I am trying to solve for the minimum number of turns around my core for the desired effect. The equations to solve include numbers of turns (must be positive integers) and other constraints (positive floats).

To validate my worksheet, I am beta-testing it on an existing transformer, so I know of at least one solution that works. But when I submit the equations to Maple, it can't find the solution I know with integer solutions.

 

The equation is :

SOL := `assuming`([solve({N__2/N__1 = m__t, k__c*L__L(g__ap*Unit('m'), N__1)*I__M__pk = (1/2)*V__sec*T__res/m__t, g__ap <= 2*10^(-3), B__max(g__ap*Unit('m'), N__1, I__M__pk) <= B__max__core}, {N__1, N__2, g__ap, I__M__pk}, UseAssumptions)], [N__1::posint, N__2::posint, g__ap::positive])

 

And Maple's answer : 

{N__1 = 7.701193685, N__2 = 12.50000000*N__1, I__M__pk = (-1.855203719*10^9*g__ap^2+1.523613883*10^11*g__ap+5.590656409*10^6)*Unit('A')/(5.000000*10^6+2.43902439*10^8*g__ap), I__M__pk = (-1.100291349*10^11*g__ap^2+9.036307746*10^12*g__ap+3.315727980*10^8)*Unit('A')/(N__1^2*(5.000000*10^6+2.43902439*10^8*g__ap)), g__ap <= 0.2000000000e-2, 0. < g__ap}

 

Except I know there is a solution with N__1 = 6 and N_82 = 75. If I force n__1:=75 and solve again for the other variables, the solution is OK : 

X := `assuming`([solve({N__2/N__1 = m__t, k__c*L__L(g__ap*Unit('m'), N__1)*I__M__pk = (1/2)*V__sec*T__res/m__t, g__ap <= 2*10^(-3), B__max(g__ap*Unit('m'), N__1, I__M__pk) <= B__max__core}, {N__2, g__ap, I__M__pk}, UseAssumptions)], [N__2::posint, g__ap::positive])

And the answer :

X := {N__2 = 75., I__M__pk = -0.3759328777e-1*Unit('Wb')*(8.130081300*10^10*g__ap^2-6.676951220*10^12*g__ap-2.45000000*10^8)/(Unit('H')*(5.000000*10^6+2.43902439*10^8*g__ap)), g__ap <= 0.2000000000e-2, 0. < g__ap}

 

I am a bit puzzled about why Maple doesn't find this solution...

 

Thank you very much for your help.

 

After manually working out answer for problem 4-4 in Mathews & Walker's Mathematical Methods of Physics , I tried to check my solution with maple2015. Briefly the problem involves inputs periodic with period T, being transformed into outputs, through a kernal G.  The net result is that all input frequencies omega periodic in T are multiplied by (omega_0/omega)^2, except for constant frequency which transforms to zero.  The problem asks to evaluate the kernal G.

Maple2015 correctly evaluated the integral for a constant input, a cosine input, and a sine input, but gave undefined when I tried an exponential(i*x) input which is just a linear combination of the two previous inputs.  I found this interesting because the integral is finite, well defined, and only has an absolute function (in the kernal), which may cause Maple problems, as it correctly evaluated integral when I split it into two regions.  Interestingly if instead of working with a period of T, I used 2*pi, and redfined my G function accordingly, Maple evaluated the exp input integral without any problems.  So the problem appears to be with the T variable, but I correctly used assumptions of T>0, and 0<t<T, so I am not sure why it would work correctly when I use T=2*pi, but failed when using a general period T.  Any help would be welcome.

 

 

restart

assume(T > 0)

assume(0 < t and t < T)

about(T)

Originally T, renamed T~:

  Involved in the following expressions with properties
    T-t assumed RealRange(Open(0),infinity)
  is assumed to be: real
  also used in the following assumed objects
  [T-t] assumed RealRange(Open(0),infinity)

 

about(t)

Originally t, renamed t~:

  Involved in the following expressions with properties
    T-t assumed RealRange(Open(0),infinity)
  is assumed to be: RealRange(Open(0),infinity)
  also used in the following assumed objects
  [T-t] assumed RealRange(Open(0),infinity)

 

assume(n::integer, n > 0)

about(n)

Originally n, renamed n~:

  is assumed to be: AndProp(integer,RealRange(1,infinity))

 

G := proc (x) options operator, arrow; (1/2)*omega0^2*T^2*((1/6)*Pi^2-(1/2)*Pi*abs(2*Pi*x/T)+Pi^2*x^2/T^2)/Pi^2 end proc

proc (x) options operator, arrow; (1/2)*omega0^2*T^2*((1/6)*Pi^2-(1/2)*Pi*abs(2*Pi*x/T)+Pi^2*x^2/T^2)/Pi^2 end proc

(1)

(int(G(t-tp), tp = 0 .. T))/T

0

(2)

(int(G(t-tp)*sin(2*Pi*n*tp/T), tp = 0 .. T))/T

(1/2)*T^2*omega0^2*cos(t*Pi*n/T)*sin(t*Pi*n/T)/(Pi^2*n^2)

(3)

(int(G(t-tp)*cos(2*Pi*n*tp/T), tp = 0 .. T))/T

(1/4)*T^2*omega0^2*(2*cos(t*Pi*n/T)^2-1)/(Pi^2*n^2)

(4)

(int(G(t-tp)*exp((I*2)*Pi*n*tp/T), tp = 0 .. T))/T

undefined/T

(5)

(int(G(t-tp)*(cos(2*Pi*n*tp/T)+I*sin(2*Pi*n*tp/T)), tp = 0 .. T))/T

undefined/T

(6)

simplify((int(G(t-tp)*exp((I*2)*Pi*n*tp/T), tp = 0 .. t))/T+(int(G(t-tp)*exp((I*2)*Pi*n*tp/T), tp = t .. T))/T)

(1/4)*omega0^2*exp((2*I)*t*Pi*n/T)*T^2/(Pi^2*n^2)

(7)

assume(0 < t and t < 2*Pi)

G2 := proc (x) options operator, arrow; 2*omega0^2*((1/6)*Pi^2-(1/2)*Pi*abs(x)+(1/4)*x^2) end proc

proc (x) options operator, arrow; 2*omega0^2*((1/6)*Pi^2-(1/2)*Pi*abs(x)+(1/4)*x^2) end proc

(8)

(int(G2(t-tp)*exp(I*n*tp), tp = 0 .. 2*Pi))/(2*Pi)

omega0^2*exp(I*n*t)/n^2

(9)

 

Download MathewsWalkerProblem4-4.mwMathewsWalkerProblem4-4.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

 

I want to solve numerically the PDE:

u_xx + u_yy= = u^{1/2}+(u_x)^2/(u)^{3/2}

 

My assumptions are that  |sqrt(2)u_x/u|<<1 (but I cannot neglect the first term since its in my first order approximation of another PDE.

 

So I tried solving by using pdsolve in maple, but to no cigar.

 

Here's the maple file:

 nonlinear.mw

PDE := diff(diff(u(x, y), x), x)+diff(diff(u(x, y), y), y) = u^(1/2)+(diff(u(x, y), x))^2/u^(3/2); IBC := {D[1](u)*(1, t) = 0, D[2](u)*(x, 1) = 0, u(0, t) = 1, u(x, 0) = 1}; pds := pdsolve(PDE, IBC, type = numeric); pds:-plot3d(t = 0 .. 1, x = 0 .. 1, axes = boxed, orientation = [-120, 40], color = [0, 0, u])

diff(diff(u(x, y), x), x)+diff(diff(u(x, y), y), y) = u^(1/2)+(diff(u(x, y), x))^2/u^(3/2)

 

{D[1](u)*(1, t) = 0, D[2](u)*(x, 1) = 0, u(0, t) = 1, u(x, 0) = 1}

 

Error, (in pdsolve/numeric/process_PDEs) all dependent variables in PDE must have dependencies explicitly declared, got {u}

 

Error, `pds` does not evaluate to a module

 

``

 

Download nonlinear.mw

Trying a few integrals in Maple -- doesn't seem to handle them very well. Any workarounds please?

 

f1(p,b):= 1/(p^2 + b^2)^2 ;

f2(p,b):= exp(-p/b)^2;

T1pbm := Int(q*f1(q, b)*ln((p+q)^2+m^2), q = 0 .. infinity);

T2pbm := Int(q*f1(q, b)*ln((p-q)^2+m^2), q = 0 .. infinity);

with(IntegrationTools):

PT1 := evalf(Parts(T1pbm, q*f1(q, b), ln((p+q)^2+m^2)));

PT2 := evalf(Parts(T2pbm, q*f1(q, b), ln((p-q)^2+m^2)));

Ev := evalf(-pi*c*Int*(p*f1(p, b)*(PT1-PT2), p = 0 .. infinity))

Hello every one,

Is any one knows how to solve the following inequality with assumptions that all parameters are real positive and k<1 and delta > c*alpha

(1/2)*((alpha*k^2-3*alpha*k-2*beta)*sqrt(delta^2*(k-1)*(k-2)*(c*alpha-delta)^2)-k*delta*(alpha*k^2-3*alpha*k+2*alpha-2*beta)*(c*alpha-delta))/(delta^2*(alpha*k^2-3*alpha*k-2*beta))<0

I tried the following code but it  dosn't make sense:

u:=(1/2)*((alpha*k^2-3*alpha*k-2*beta)*sqrt(delta^2*(k-1)*(k-2)*(c*alpha-delta)^2)-k*delta*(alpha*k^2-3*alpha*k+2*alpha-2*beta)*(c*alpha-delta))/(delta^2*(alpha*k^2-3*alpha*k-2*beta))

solve({u < 0,alpha > 0, beta > 0, c > 0, delta > 0, delta > c*alpha, k > 0, k < 1, })

In fact I want to know under which circumastances the above inequality is negative.

THX

What is the best way to solve for the simple equation X^2+y^2=1[m]^2 symbolically for either x or y? I actually have a huge list of equations and want to solve the group but my problem boils down to the issue here where I get two possible solutions though using the assumption one is clearly negative and the assumption used should exclude negative results (see attempt below). Also solve doesn't seem to work with units either...  any ideas? Can I give the variables units in a meaningful way?

--------------------------------------------------------------------------------------------------------------------------

restart;

with(RealDomain);
f := x^2+y^2 = 1;

                            x^2+y^2 = 1

assume(y > 0)

a := y > 0

y1 = solve(f, y, useassumptions = true)

                          y1 = (sqrt(-x^2+1), -sqrt(-x^2+1))

 

y2 = solve({a, f}, y)

                          y2 = ({y = sqrt(-x^2+1)}, {y = -sqrt(-x^2+1)})

-------------------------------------------------------------------------------------------

Why is y = -sqrt(-x^2+1) a solution?

Also, how do I use units when trying to solve 

-------------------------------------------------------------------------------------------

restart;
f := x^2+y^2 = Unit('m')^2;
                           x^2+y^2 = Unit('m')^2

assume(x > 0);
assume(y > 0);
d = solve(f, y, useassumptions = true);

Error, (in Units:-Standard:-+) the units `m^2` and `1` have incompatible dimensions

---------------------------------------------------------------------------------------------

 

THANKS!

Hi MaplePrime-ers,

I'm using the following piece of code to (i) solve the system of symbolically, so I can (ii) evaluate equations quickly at many points of time.  This works quite well for 4 defined values, but I'm having problems adding a 5th defined value.  Specifically, solve leaves the "solution may be lost" message after taking forever.  As the symbolic solution will be run mulitple times by a optimziation algorithm, I'd ideally like to get the solve time under 2 minutes.  I've attached both executed worksheets.  Is there anything I can do to have solve work as I intend?

This first code snippet achieves what I would like to do Series_noGear.mw:

 

#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= ICE_T * ICE_W;

#BAT
eq_c[2] := BAT_V = 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 * 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 * 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);

termeqs := {eq_c[1],eq_c[2],eq_c[3],eq_c[4],eq_c[5],eq_c[6]};

sys_eqs2 := termeqs union convert(eq2,set);

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

sol2:=solve(sys_eqs2,notdrivers2) assuming real;

symb_sol2:=unapply(sol2,[drivers2[]]);

symb_sol2(1,2,3,5);

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

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

This second code snippet includes the changes in bold, which make solve take forever Series_addGear.mw:

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

#ICE
eq_c[1] := ICE_mdot_g= ICE_T * ICE_W;

#BAT
eq_c[2] := BAT_V = 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 * 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 * 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
eq_c[7] := GBb_T = -1/GB_R * GBa_T;
eq_c[8] := GBb_W = GB_R * GBa_W;

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

termeqs := {eq_c[1],eq_c[2],eq_c[3],eq_c[4],eq_c[5],eq_c[6],eq_c[7],eq_c[8]};

sys_eqs2 := termeqs union convert(eq2,set);

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

sol2:=solve(sys_eqs2,notdrivers2) assuming real;

symb_sol2:=unapply(sol2,[drivers2[]]);

 

Does assume make solve work faster, or just complicate things?  Any help is greatly appreciated!

 

Series_addGear.mw

Series_noGear.mw

1 2 Page 1 of 2