acer

32363 Reputation

29 Badges

19 years, 332 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by acer

Perhaps you could simplify at each step, to reduce the burden.

(I wonder also whether there is a pattern; perhaps iteration is not necessary?)

restart

with(inttrans)

with(PDEtools)

with(DEtools)

with(Physics)

declare(u(x, t), quiet); declare(v(x, t), quiet); declare(U(x, t), quiet)

undeclare(prime)

`There is no more prime differentiation variable; all derivatives will be displayed as indexed functions`

``

pde0 := I*(Diff(U(x, t), t))+Diff(U(x, t), `$`(x, 2))+2*(Diff(U(x, t)*conjugate(U(x, t)), x))*U(x, t)+U(x, t)^2*conjugate(U(x, t))^2*U(x, t)

I*(Diff(U(x, t), t))+Diff(U(x, t), x, x)+2*(Diff(U(x, t)*conjugate(U(x, t)), x))*U(x, t)+U(x, t)^3*conjugate(U(x, t))^2

pde := expand(-I*pde0)

Diff(U(x, t), t)-I*(Diff(Diff(U(x, t), x), x))-(2*I)*U(x, t)*(Diff(U(x, t), x))*conjugate(U(x, t))-(2*I)*U(x, t)^2*(Diff(conjugate(U(x, t)), x))-I*U(x, t)^3*conjugate(U(x, t))^2

LLu := Diff(U(x, t), t); RRu := I*(Diff(U(x, t), x, x)); NNu := -pde+LLu-RRu

B[0] := -I*U[0](x, t)^3*conjugate(U[0](x, t))^2

B1[0] := -(2*I)*U[0](x, t)^2*(diff(U[0](x, t), x))

T[0] := -(2*I)*U[0](x, t)*(diff(U[0](x, t), x))*conjugate(U[0](x, t))

for n to 4 do B[n] := expand(-I*simplify(diff((sum(U[k](x, t)*lambda^k, k = 0 .. n))^3*(sum(conjugate(U[k](x, t))*lambda^k, k = 0 .. n))^2/factorial(n), [`$`(lambda, n)]))); B1[n] := expand(-(2*I)*simplify(diff((sum(U[k](x, t)*lambda^k, k = 0 .. n))^2*(sum((diff(U[k](x, t), x))*lambda^k, k = 0 .. n))/factorial(n), [`$`(lambda, n)]))); T[n] := expand(-(2*I)*simplify(diff((sum(U[k](x, t)*lambda^k, k = 0 .. n))*(sum(conjugate(U[k](x, t))*lambda^k, k = 0 .. n))*(sum((diff(U[k](x, t), x))*lambda^k, k = 0 .. n))/factorial(n), [`$`(lambda, n)]))) end do

lambda := 0; for n from 0 to 4 do P[n] := B[n]; Q[n] := B1[n]; R[n] := T[n] end do

for i from 0 to 4 do A[i] := P[i]+Q[i]+R[i] end do

``

# By writing this

Transformations := [ seq(seq(abs(U[i](x, t))^(2*n) = U[i](x, t)^n*(conjugate(U[i](x, t))^n), n=1..5), i=0..3) ]:

for i from 0 to 4 do
  Ad[i] := eval(A[i], Transformations)
end do:

for i from 0 to 6 do
    U[i](x, t) := u[i] assuming real;
end do:

u[0] := beta*exp(I*x)

beta*exp(I*x)

for i from 0 to 4 do u[i+1] := combine(simplify(evalc(invlaplace(laplace(I*(diff(u[i], `$`(x, 2)))+Ad[i], t, s)/s, s, t)))) end do

-(I*u[0]^5+beta*(I*cos(x)-sin(x)))*t

(1/2)*(-(4*I)*beta^8*sin(3*x)-(6*I)*beta^8*sin(5*x)+4*beta^8*cos(3*x)-6*beta^8*cos(5*x)-(25*I)*beta^4*sin(5*x)-(2*I)*beta^4*sin(x)-25*beta^4*cos(5*x)-2*beta^4*cos(x)-I*sin(x)-cos(x))*t^2*beta

-(1/6)*t^3*beta*(-(90*I)*cos(3*x)*beta^8+(36*I)*beta^12*cos(x)-(30*I)*beta^8*cos(x)-I*cos(x)-6*beta^12*sin(7*x)+18*beta^12*sin(9*x)+30*beta^12*sin(5*x)-36*sin(x)*beta^12-(375*I)*cos(5*x)*beta^8-(625*I)*cos(5*x)*beta^4-(18*I)*beta^12*cos(9*x)+375*beta^8*sin(5*x)+30*beta^8*sin(x)-90*beta^8*sin(3*x)-(30*I)*beta^12*cos(5*x)-(6*I)*beta^12*cos(7*x)+625*beta^4*sin(5*x)+5*beta^4*sin(x)-(5*I)*cos(x)*beta^4+sin(x))

-(1/24)*t^4*beta*(1824*beta^12*cos(3*x)-15625*beta^4*cos(5*x)+168*beta^16*cos(3*x)-24*beta^16*cos(13*x)-312*beta^16*cos(9*x)-72*beta^16*cos(7*x)-216*beta^16*cos(5*x)-3186*beta^12*cos(9*x)+234*beta^12*cos(7*x)+60*beta^12*cos(x)-4626*beta^12*cos(5*x)-146*beta^8*cos(x)-(312*I)*beta^16*sin(9*x)+(72*I)*beta^16*sin(7*x)-(216*I)*beta^16*sin(5*x)-(168*I)*beta^16*sin(3*x)-(1824*I)*beta^12*sin(3*x)-(3086*I)*sin(3*x)*beta^8-(9*I)*beta^4*sin(x)-(146*I)*beta^8*sin(x)-(16875*I)*beta^8*sin(5*x)-(234*I)*beta^12*sin(7*x)-(3186*I)*beta^12*sin(9*x)-(4626*I)*beta^12*sin(5*x)+(60*I)*beta^12*sin(x)-(24*I)*beta^16*sin(13*x)+(336*I)*sin(x)*beta^16-(15625*I)*beta^4*sin(5*x)+336*beta^16*cos(x)+3086*beta^8*cos(3*x)-16875*beta^8*cos(5*x)-9*beta^4*cos(x)-I*sin(x)-cos(x))

(1/120)*t^5*beta*(-(84156*I)*beta^8*cos(3*x)-(656250*I)*beta^8*cos(5*x)-(380496*I)*beta^12*cos(9*x)-(8808*I)*beta^16*cos(3*x)-(25278*I)*beta^16*cos(7*x)-(49950*I)*beta^16*cos(5*x)-(110922*I)*beta^16*cos(9*x)-(2880*I)*beta^20*cos(3*x)+1440*beta^20*sin(13*x)-2880*beta^20*sin(3*x)-1800*beta^20*sin(5*x)-3600*beta^20*sin(7*x)+8160*beta^20*sin(9*x)+480*beta^20*sin(11*x)-11640*sin(x)*beta^20-(8160*I)*beta^20*cos(9*x)-(3600*I)*beta^20*cos(7*x)+(1800*I)*beta^20*cos(5*x)+(480*I)*beta^20*cos(11*x)-(1440*I)*beta^20*cos(13*x)-(8316*I)*beta^16*cos(13*x)-(23824*I)*beta^12*cos(7*x)-(347755*I)*beta^12*cos(5*x)-(87644*I)*beta^12*cos(3*x)+(11640*I)*beta^20*cos(x)+(43836*I)*beta^16*cos(x)+(35470*I)*beta^12*cos(x)-(451*I)*beta^8*cos(x)-(14*I)*beta^4*cos(x)+8316*beta^16*sin(13*x)+110922*beta^16*sin(9*x)-25278*beta^16*sin(7*x)+49950*beta^16*sin(5*x)-8808*beta^16*sin(3*x)-87644*beta^12*sin(3*x)+390625*beta^4*sin(5*x)-23824*beta^12*sin(7*x)+380496*beta^12*sin(9*x)+347755*beta^12*sin(5*x)-35470*sin(x)*beta^12+451*beta^8*sin(x)-(390625*I)*beta^4*cos(5*x)-I*cos(x)-84156*beta^8*sin(3*x)+656250*beta^8*sin(5*x)+14*beta^4*sin(x)+sin(x)-43836*sin(x)*beta^16)

 

``

Download b1_ac.mw

Your attempt,

   pointplot3d(eval(polygon[[0, 0, 0], [x3e, y3e, z3e], [1, 0, 0]], t = 1/100*tt), color = pink)

is not valid syntax.

1) You've used square brackets, but polygon needs round brackets in the usual way for a function call.
2) The pointplot3d bit is wrong. (what did you expect it to do here?)
3) The eval usage is out of place.

It's not helpful to provide only a portion of your code. You could at least provide the obvious missing bits, such as x3e, y3e, z3e, tt, whether you loaded packages, etc. There's no reason not to upload and (at least) attach (insert link) your actual worksheet here.

Here's an example that might help. I've had to make some guesses.

restart;

with(plots): with(plottools):

x3e, y3e, z3e := sin(t), cos(t), sin(2*t):

tt := 300:

g1 := tt -> polygon(eval([[0, 0, 0], [x3e, y3e, z3e], [1, 0, 0]],
                         t = 1/100*tt), color = pink):

plots:-display(g1(1.0), size=[300,300], lightmodel=none);

 animate([g1], [t], t = 0 .. 314, frames = 25,
         size=[400,400], lightmodel=Light1);

Download polygon_ex.mw

Here's one way to get that.

nb. The outer (mapped) sort is to turn terms like z*y and y*x into y*z and x*y, etc.

L := [z^2, y*z, x*z, z, y^2, x*y, y, x^2, x, 1];

[z^2, y*z, x*z, z, y^2, x*y, y, x^2, x, 1]


The order of these terms agrees with that of your requested output.

[op(sort(`+`(op(L)), order=tdeg(z,y,x), ascending))];

[1, x, y, z, x^2, y*x, z*x, y^2, z*y, z^2]


A little polish, to turn z*y back into y*z, etc.

map(sort,
    [op(sort(`+`(op(L)), order=tdeg(z,y,x), ascending))],
    order=plex(x,y,z));

[1, x, y, z, x^2, x*y, x*z, y^2, y*z, z^2]

Download sort_lex_fun.mw

 

ps. You seemed to have an extra "x*x" term in your expected output. Perhaps it is a typo, since you had x^2 only once in both input and output. However, if you do indeed have the possibility of repeated terms then please let me know (as the addition trick wouldn't work directly; though it could be amended by removing/reinstating multiplicity fore&aft, or just by using the coefficient.)

I don't think that I'd do it all this way, but is the following the kind of thing that you're trying to do?

(I put in some redundancy, so you can check and compare. And I couldn't tell whether you wanted the mixed conjugate products to be turned into abs form.)

restart

with(PDEtools)

with(Physics)

declare(u(x, t), quiet); declare(v(x, t), quiet)


Either don't make this an equation (=0), or use just it's rhs when needed.
(Hasn't dharr mentioned this, more than once before?)

pde := u(x, t)+I*(diff(u(x, t), `$`(x, 2)))+2*(diff(u(x, t)*conjugate(u(x, t)), x))*u(x, t)+u(x, t)^2*conjugate(u(x, t))^2*u(x, t)

u(x, t)+I*(diff(diff(u(x, t), x), x))+(2*(diff(u(x, t), x))*conjugate(u(x, t))+2*u(x, t)*(diff(conjugate(u(x, t)), x)))*u(x, t)+u(x, t)^3*conjugate(u(x, t))^2

pde_linear, pde_nonlinear := selectremove(proc (term) options operator, arrow; not has((eval(term, u(x, t) = T*u(x, t)))/T, T) end proc, expand(pde))

u(x, t)+I*(diff(diff(u(x, t), x), x)), 2*u(x, t)*(diff(u(x, t), x))*conjugate(u(x, t))+2*u(x, t)^2*(diff(conjugate(u(x, t)), x))+u(x, t)^3*conjugate(u(x, t))^2

oppde := [op(expand(pde))]

[u(x, t), I*(diff(diff(u(x, t), x), x)), 2*u(x, t)*(diff(u(x, t), x))*conjugate(u(x, t)), 2*u(x, t)^2*(diff(conjugate(u(x, t)), x)), u(x, t)^3*conjugate(u(x, t))^2]


It doesn't make sense to consider (in your way) the operands of each
entry in oppde unless the entry is a product. The code needed to protect
against the case that some addend in the pde might not be itself a product.
It was not robust; not guarding against that.


Also, your approach seems designed for a pde in the form of a sum of terms,
so expanding the products of sums seems key to it working as designed.

u_occurrences := map(proc (i) options operator, arrow; numelems(select(has, [ifelse(i::`*`, op(i), i)], u)) end proc, oppde)

[1, 1, 3, 2, 2]

linear_op_indices := [ListTools:-SearchAll(1, u_occurrences)]

[1, 2]

pde_linear := add(oppde[linear_op_indices])

u(x, t)+I*(diff(diff(u(x, t), x), x))

nonlinear_op_indices := [seq(ifelse(u_occurrences[j] > 1, j, NULL), j = 1 .. nops(u_occurrences))]

[3, 4, 5]

pde_nonlinear := add(oppde[nonlinear_op_indices])

2*u(x, t)*(diff(u(x, t), x))*conjugate(u(x, t))+2*u(x, t)^2*(diff(conjugate(u(x, t)), x))+u(x, t)^3*conjugate(u(x, t))^2

pde_nonlinear := expand(pde-pde_linear)

2*u(x, t)*(diff(u(x, t), x))*conjugate(u(x, t))+2*u(x, t)^2*(diff(conjugate(u(x, t)), x))+u(x, t)^3*conjugate(u(x, t))^2

simplify(pde-pde_linear); r1 := expand(%)

u(x, t)*(abs(u(x, t))^4+2*(diff(u(x, t), x))*conjugate(u(x, t))+2*u(x, t)*(diff(conjugate(u(x, t)), x)))

u(x, t)*abs(u(x, t))^4+2*u(x, t)*(diff(u(x, t), x))*conjugate(u(x, t))+2*u(x, t)^2*(diff(conjugate(u(x, t)), x))

simplify(pde-pde_linear, size); r2 := expand(%)

u(x, t)*(u(x, t)^2*conjugate(u(x, t))^2+2*(diff(u(x, t), x))*conjugate(u(x, t))+2*u(x, t)*(diff(conjugate(u(x, t)), x)))

2*u(x, t)*(diff(u(x, t), x))*conjugate(u(x, t))+2*u(x, t)^2*(diff(conjugate(u(x, t)), x))+u(x, t)^3*conjugate(u(x, t))^2

Download solving_ac.mw

ps. Where did you get that code? If it's not originally your own then you'd benefit from picking it apart so that you understood what the various parts do. Otherwise, it's going to be hard to fix/adjust/extend it in future.

The result from a direct solve call is not so nice in your Maple 2019.

But a little preliminary adjustment can help it.

restart

kernelopts(version)

`Maple 2019.2, X86 64 LINUX, Nov 26 2019, Build ID 1435526`

B := w+Ce; A := (1/3)*`ϕ`*(-beta*p1+a)-upsilon*Pu

ineq := (B-A*(2*U*upsilon+1)/upsilon)/(2*(U*upsilon+1)) <= (`&varphi;`*(-beta*p1+a)-A)/upsilon

(w+Ce-((1/3)*varphi*(-beta*p1+a)-upsilon*Pu)*(2*U*upsilon+1)/upsilon)/(2*U*upsilon+2) <= ((2/3)*varphi*(-beta*p1+a)+upsilon*Pu)/upsilon

temp := collect(ineq,p1);

(1/3)*varphi*beta*(2*U*upsilon+1)*p1/(upsilon*(2*U*upsilon+2))+(w+Ce-((1/3)*varphi*a-upsilon*Pu)*(2*U*upsilon+1)/upsilon)/(2*U*upsilon+2) <= -(2/3)*varphi*beta*p1/upsilon+((2/3)*varphi*a+upsilon*Pu)/upsilon

# lhs and rhs are both of type `+`, so select/remove make sense
new := simplify(temp - remove(depends,lhs(temp),p1) - select(depends,rhs(temp),p1));

(1/6)*varphi*beta*p1*(6*U*upsilon+5)/(upsilon*(U*upsilon+1)) <= (1/6)*((6*U*a*varphi-3*Ce+3*Pu-3*w)*upsilon+5*varphi*a)/(upsilon*(U*upsilon+1))

simplify(solve(new,p1));

piecewise(`and`(`&varphi;`*beta*(6*U*upsilon+5)/(6*upsilon*(U*upsilon+1)) = 0, 0 <= ((6*U*a*`&varphi;`-3*Ce+3*Pu-3*w)*upsilon+5*`&varphi;`*a)/(6*upsilon*(U*upsilon+1))), [{p1 = p1}], 0 < `&varphi;`*beta*(6*U*upsilon+5)/(6*upsilon*(U*upsilon+1)), [{p1 <= ((6*U*a*`&varphi;`-3*Ce+3*Pu-3*w)*upsilon+5*`&varphi;`*a)/(`&varphi;`*beta*(6*U*upsilon+5))}], `&varphi;`*beta*(6*U*upsilon+5)/(6*upsilon*(U*upsilon+1)) < 0, [{((6*U*a*`&varphi;`-3*Ce+3*Pu-3*w)*upsilon+5*`&varphi;`*a)/(`&varphi;`*beta*(6*U*upsilon+5)) <= p1}], [])

Download Q_isolate_acc.mw

There are pieces of information missing wrt whether all entries of any given (after the first outer list) are of the same type. Eg., what would be the classification number, if not all entries were of the same type?

But here is something that covers your sole, lonely example. How it extends will depend on your as-yet-unspecified other examples; your choices could make or break it.

restart;

 

H := proc(L::list,N::nonnegint)
  if L::And(list(list), positive &under nops) then
    N+H(L[1],N);
  else
    N;
  end if;
end proc:

 

H2 := proc(LL)
  subsindets(LL,And(list,
                    satisfies(u->(nops(u)>0 and u::list(list)))),
             op);
end proc:

 

L := [[1, 2, 3], [], [[1, 2], [3, 4], [5, 6]], [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]];

[[1, 2, 3], [], [[1, 2], [3, 4], [5, 6]], [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]]

map(H,L,1);

[1, 1, 2, 3]

map(H2,L);

[[1, 2, 3], [], [1, 2], [3, 4], [5, 6], [1, 2], [3, 4], [5, 6], [7, 8]]

L := [ [1, 2, 3],
       [],
       [[[[71,72], [92,93]]]],
       [[1, 2], [3, 4], [5, 6]],
       [[[1, 2], [3, 4]], [[5, 6], [7, 8]]] ];

[[1, 2, 3], [], [[[[71, 72], [92, 93]]]], [[1, 2], [3, 4], [5, 6]], [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]]

map(H,L,1);

[1, 1, 4, 2, 3]

map(H2,L);

[[1, 2, 3], [], [71, 72], [92, 93], [1, 2], [3, 4], [5, 6], [1, 2], [3, 4], [5, 6], [7, 8]]

Download some_list_stuff.mw

It is not necessary to make a separate ZeroMatrix call, or (in general) to simplify all of M+M^%T.

That is, forming mtest:=simplify(M+M^%T) is itself not very efficient, in general. The simplicification action can instead be part of the andmap predicate (with possible early bailout), and there's no need to test both triangles.

Also, the user-defined operator X->evalb(X) is an unnecessary layer; one could just map evalb.

restart;

M:=Matrix([[0,(40*sqrt(7)+140)/(560+sqrt(7)),(80*sqrt(7)+35)/(560+sqrt(7))],
           [(-40*sqrt(7)-140)/(560+sqrt(7)),0,(280-32*sqrt(7))/(560+sqrt(7))],
           [(-80*sqrt(7)-35)/(560+sqrt(7)),(-280+32*sqrt(7))/(560+sqrt(7)),0]]):

Easy to write, but not so efficient, despite using
andmap, since the whole of M+M^%T is computed.
(Also, no need to call ZeroMatrix.)
andmap(evalb,simplify(M+M^%T)=~0)

true

Slightly more efficient, since not doing all the simplifications
of every entry up-front.
andmap(evalb@simplify@`=`,M + M^%T,0);

true

Don't even form all of M+M^%T up front, but compute and
test each entry (or only the triangular portion, without duplicating
effort) in turn (and allow for early bail-out)
andseq(andseq(simplify(M[i,j]+M[j,i])=0,j=1..i),i=1..3);

true


Download Download_ac.mw

You could also set (per session) a new default for output that combines units to those dimensions (eg. volume/time).

restart

with(Units:-Simple)

 

The next command sets a default for simplification/combining of
units that make up a particular "dimension" (here, volume/time).

 

Units:-UseUnit(ml/min)

 

GFR := (18.2*Unit('mg'/'ml')*1.5)*Unit('ml'/'min')/(.201*Unit('mg'/'ml'))

135.8208955*Units:-Unit(mL/min)

13.0*Unit('cm')^3/Unit('day')

0.9027777778e-2*Units:-Unit(mL/min)

-2.3*Unit(kg/s)*Unit(m^3/g)

-0.1380000000e12*Units:-Unit(mL/min)

We can always force it the other way.

convert(GFR, units, m^3/s)

0.2263681592e-5*Units:-Unit(m^3/s)

Download un_useun.mw

Matrix(convert(Q,listlist))

Is this the kind of effect you're after?

nb. It's printing the results to the terminal. Adjust if wanted with strings programmatically returned.

Download CG_ex.mw

I don't see any attempt at calling BarChart (or ColumnGraph) in your worksheet. What did you try and what is the result you expect?

Are you perhaps wanting to do something like, say,

   BarChart(frequences, view = [0 .. ceil(1.08*max(Weights)), default])

or,

   ColumnGraph(frequences, view = 0 .. ceil(1.08*max(Weights)))

or,

   ColumnGraph(map(e -> nprintf(`#mn("%a",fontweight="bold",mathcolor="Red");`, lhs(e)) = rhs(e), frequences), view = 0 .. ceil(1.08*max(Weights)), gridlines)

or a similar effect for BarChart, etc. (Or you could utilize the many options of those commands to change spacing, widths, etc.)

S4_Statistiques_Descriptives_AxeTravail_Complet_ac.mw

That last one produces something like the following, btw,

Your boundary conditions for the plots pltU[j] where you are calling it u(y) = D(psi) are, in fact,

     D(psi)(-1) = 0
     D(psi)(1) = .2e-1

That comes directly from your code,

    D(psi)(1 + x^2/2) = 2*H,
    D(psi)(-1 - x^2/2) = 0

where your parameter data uses x=0 and H=0.01.

So, your claim that "...according to the BCs, they should start from 1" is false, for u(y)=D(psi).

Your plots pltU[j] each show the range y=-1..1, and all use u(-1)=D(psi)(-1)=0 and u(1)=D(psi)(1)=0.02 just as your formulas dictate. They each "start" at y=-1 with boundary value u(-1)=D(psi)(-1)=0.

First let's have a look at an approach using a slightly different "simplification" of the equations, and then simplifying under a simpler extra assumption.

Then we can consider some weaknesses which might be interfering (internally) with the natural attempt using these short assumptions (and why the system seems to need an unnecessarily longer form of the rho-1>beta  assumption).

restart;

eqqq := map(simplify,{sqrt(beta*rho*xi[8]^2 - beta*xi[8]^2)/xi[8] = sqrt(beta*rho - beta), (-rho + 1 + sqrt(beta*rho*xi[8]^2 - beta*xi[8]^2))/(xi[3]*xi[8] - 1) = sqrt(beta*rho - beta), -(-rho*xi[3]*xi[8] + sqrt(beta*rho*xi[8]^2 - beta*xi[8]^2) + xi[3]*xi[8])/(xi[8]*(xi[3]*xi[8] - 1)) = rho - 1}):

eq3 := map(eq->(rhs-lhs)(eq),eqqq);

{(beta*(rho-1))^(1/2)-(beta*xi[8]^2*(rho-1))^(1/2)/xi[8], (beta*(rho-1))^(1/2)-(-rho+1+(beta*xi[8]^2*(rho-1))^(1/2))/(xi[3]*xi[8]-1), rho-1-(-(beta*xi[8]^2*(rho-1))^(1/2)+(rho-1)*xi[3]*xi[8])/(xi[8]*(xi[3]*xi[8]-1))}

Let's reform the equations, then solve, and then use some (short) assumptions
in a
simplify call.
 

alt := solve(evala(eq3),{xi[8],xi[3]});

{xi[3] = -(-beta+(beta*(rho-1))^(1/2))/beta, xi[8] = (-beta+(beta*(rho-1))^(1/2))/(beta*(rho-1))^(1/2)}

simplify(eval(eq3,alt)) assuming rho>1, beta>0, rho-1>beta;

{0}

Some of the following weaknesses might well be getting in the way
of the "original" attempt, also done below.
We'll use these assumptions:
 

conds := rho>1, beta>0, rho-1>beta;

1 < rho, 0 < beta, beta < rho-1

Ideally the following would all return true, since we have rho>1 .
 

is( -1 - sqrt(beta)*sqrt(rho - 1) + rho > 0 ) assuming conds;
is( rho - 1 > sqrt(beta)*sqrt(rho - 1) ) assuming conds;
is( (rho - 1)/sqrt(rho - 1) > sqrt(beta) ) assuming conds;

FAIL

FAIL

true

Dividing the argument of signum by a quantity sqrt(rho-1) which is strictly
greater than zero should not invalidate its result.


We can leverage this second example, further on, for the simplification following
substitution of the solution.

 

signum( (-1 - sqrt(beta)*sqrt(rho - 1) + rho)/sqrt(rho-1) ) assuming conds;
signum( evala((-1 - sqrt(beta)*sqrt(rho - 1) + rho)/sqrt(rho-1)) ) assuming conds;

signum(-1-beta^(1/2)*(rho-1)^(1/2)+rho)

1

The straightward way, solve, then backsubstitute and simplify under the
assumptions. Ideally, the simpler
conds would be enough.
 

sol := solve(eq3,{xi[8],xi[3]});

{xi[3] = (1+(beta*(rho-1))^(1/2)-rho)/(beta*(rho-1))^(1/2), xi[8] = -(1+(beta*(rho-1))^(1/2)-rho)/(rho-1)}

simplify(eval(evala(eq3),sol)) assuming conds; # another weakness

{(1-signum(-1-beta^(1/2)*(rho-1)^(1/2)+rho))*(rho-1)^(1/2)*beta^(1/2), (-1+signum(-1-beta^(1/2)*(rho-1)^(1/2)+rho))*(-beta*(rho-1)^(1/2)+beta^(1/2)*(rho-1))*beta^(1/2)/(-beta^(1/2)*(rho-1)^(1/2)+beta+rho-1), (rho-1)*beta^(1/2)*(-1+signum(-1-beta^(1/2)*(rho-1)^(1/2)+rho))*((-rho+1)*beta^(1/2)+beta*(rho-1)^(1/2))/((beta^(1/2)*(rho-1)^(1/2)-rho+1)*(beta^(1/2)*(rho-1)^(1/2)-beta-rho+1))}

The following is not a general purpose workaround, of course.
But we can show that, with hand-holding
, adequate machinery is there.
 

evalindets( simplify(eval(evala(eq3),sol)),
                     specfunc(signum),
                     term->signum(evala(op(term)/sqrt(rho-1))) ) assuming conds;

{0}


Download solve_ineq_assump_ex.mw

I'll be submitting the various weaknessess in a bug report (if nobody else has).

For example, to import your two files with sparse storage and float[8] double precision data,

M := ImportMatrix("test-km-1_MASS2.txt", source=MATLAB, format=entries, datatype=float[8]):

K := ImportMatrix("test-km-1_STIF2.txt", source=MATLAB, format=entries, datatype=float[8]):

After that, I can optionally check that they're been imported with storage=sparse and datatype=float[8] (ie. hardware double precision).

rtable_options(M, storage), rtable_options(M, datatype);

            sparse, float[8]

rtable_options(M, storage), rtable_options(K, datatype);

             sparse, float[8]

For plots, the typeset option allows you to get multiple things (text, math, etc) rendered in sequence together but without comma separators.

with(Typesetting,':-mtext'):
plot(x^2,'title'=':-typeset'(mtext("sorta",'fontfamily'="Courier",'size'=30),
                             mtext(" kinda",'fontfamily'="Helvetica",'size'=20),
                             mtext(" works\n",'size'=10)));

ps. I also added some quotes, to guard against the situation in which some of the unprotected global names were assigned values. (mint)

1 2 3 4 5 6 7 Last Page 3 of 336