## 8679 Reputation

11 years, 274 days

## select...

may be there is better way, but try

```r:=[[5,7],[],[1,3],[],[5,4]];
select(X->nops(X)>0,r)
```

Yes, this happens, but the important thing is that the corresponding order with the correct eigenvalue do not change.

i.e the way to read the outout is that the first eigenvalue goes with the first column, the second eigenvalue goes with the second column and so on.

So it does not matter if the eigenvector columns change positions, as long the the corresponding eigenvalues change in same way

btw, if you for some reason need to have same order of eigenvectors each time, you could always sort the eigenvector matrix columns using the numerical values of the corresponding eigenvalues as key for sorting. Something like

 > LI:=LinearAlgebra; M:=Matrix([[0,1],[1,0]]);

 > a,b:=LI:-Eigenvectors(M): b[.., sort(a,output=permutation)]

 > a,b:=LI:-Eigenvectors(M): b[.., sort(a,output=permutation)]

 > a,b:=LI:-Eigenvectors(M): b[.., sort(a,output=permutation)]

 > a,b:=LI:-Eigenvectors(M): b[.., sort(a,output=permutation)]

 > a,b:=LI:-Eigenvectors(M): b[.., sort(a,output=permutation)]

 > a,b:=LI:-Eigenvectors(M): b[.., sort(a,output=permutation)]

Maple 2024

I have feeling there is a better or more direct way to do this but could not find it so far. But here is an attempt

Opps. Fix to make true matrix

```R:=Vector[row]([1,2,3]);
C:=Vector([d,e,f]);
convert(convert(map(X->X*C,R),listlist),Matrix);
whattype(%);
LinearAlgebra:-Dimension(%%);
```

You should really post plain text code. One can't copy code from image. But you can try

```sol:=signum(-sigma+q)^2;
simplify(sol) assuming real;
```

You should really post plain text code next time or at least worksheet.

I tried this in Maple 2024 and Mathematica 14. Both give solution that validate.  Here is Maple's

```ode1:= diff(c(T),T)=-2*c(T)*(1+beta__c*c(T)^2/p__c(T)^2);
ode2:= diff(p__c(T),T)=2*(1+beta__c*c(T)^2/p__c(T)^2)*p__c(T);
sol:=[dsolve([ode1,ode2],[c(T),p__c(T)],'explicit')]
```

 > interface(version);

 > restart;

 > ode1:= diff(c(T),T)=-2*c(T)*(1+beta__c*c(T)^2/p__c(T)^2); ode2:= diff(p__c(T),T)=2*(1+beta__c*c(T)^2/p__c(T)^2)*p__c(T); sol:=[dsolve([ode1,ode2],[c(T),p__c(T)],'explicit')]

 > map(X->odetest(X,[ode1,ode2]),sol)

 >

Here is Mathematica code I tried.

```ClearAll["Global`*"]
ode1 = c'[T] == -2*c[T]*(1 + \[Beta]*c[T]^2/pc[T]^2);
ode2 = pc'[T] == 2*(1 + \[Beta]*c[T]^2/pc[T]^2)*pc[T];
sol = DSolve[{ode1, ode2}, {c, pc}, T]```

Solution also verifies OK

Since both solutions from Maple and Mathematica verfiy OK, then both are correct even though they look different.

set has no implied ordering. So need to use list.  Here is one way out of many

```X:=[x12, x1, x3, x15, x2, x9];

f:=proc(a,b)::truefalse;
:-parse(String(a)[2..]) < :-parse(String(b)[2..]) ;
end proc:

sort(X,f);
```

may be

```n:=294912:
d:=8:
eq:=d^m=n/2:
floor(solve(eq,m)):
n/(d^%);
```

9

This assume n is even

You can easily modify it for odd

Need to tell is x is not negative

`simplify(g(f(x))) assuming x>=0`

x

This is a guess. When expression is product, such as a*b internally it is   a^1*b^1  so  when you do subs 1=2 you get a^2*b^2. It replaced the exponents by 2.

same for division. You can see this from

```subs(1=2,a*b^9)
```

a^2*b^9

And

```dismantle(a*b)
```

PROD(5)
NAME(4): a
INTPOS(2): 1  ------->
NAME(4): b
INTPOS(2): 1  ----->

Compare to

```dismantle(a*b^9)
```

PROD(5)
NAME(4): a
INTPOS(2): 1   --->
NAME(4): b
INTPOS(2): 9   ---->

So internally for a  PROD   , each term has hidden exponent of by default unless overriden.

For SUM, the same thing. There is a hidden or implied  `1`. You can see this from

```dismantle( a + b);
```

SUM(5)
NAME(4): a
INTPOS(2): 1 --->
NAME(4): b
INTPOS(2): 1  --->

Compare to

```dismantle( a + 9*b);
```

SUM(5)
NAME(4): a
INTPOS(2): 1  ------->
NAME(4): b
INTPOS(2): 9  ------->1

So when you do

```subs(1=2,a+b)
```

It is as if  you typed

`subs(1=2, 1*a+ 1*b)`

And that is why you get

2*a + 2*b

It is by design. This is called "infinite scroll"

Google search also introduced this not long ago on its search result. It is terrible feature and Maplesoft seems to copy this.

Many web sites seem to imitate this now.

I much prefer the old way. One page at a time, and click next page to see the next page of result.

I could not find a way to turn it off from google search result.

For Maple's page above, you'd have to ask Maplesoft if they can turn off Infinite Scroll as it is part of the page design and they are the ones who add the javascript in the page to control this.

Outside users has no control as far as I can see on how to prevent Infinite Scroll

So what you see as repositions arbitrarily. is actually a side effect of this automatic scrolling. If not done right, it looks like what you describe and I've seen this in many other sites.

It also makes one lose track of what they were looking on the page when this happens.

The web is a big mess and Maplesoft is just following the trend.

another possibility

```e:=(10*(5+sqrt(41)))/(sqrt(70+10*sqrt(41))*sqrt(130+10*sqrt(41)));
simplify(numer(e)/expand(combine(denom(e))))
```

btw, Mathematica does it with FullSimplify command.

another possibility

```A := LinearAlgebra:-RandomMatrix(5);
Vector~(convert(A^+,listlist))[]
```

use assumptions

```int((t/a)*exp(-t/a),t=0..infinity) ;
simplify(%) assuming a>0
```

Unable to upload worksheet. here is screen shot

Here is another approach

```find_element:=proc(e,L::list)
local idx;
idx:=ListTools:-Search(e,L);
if idx=0 then
RETURN([]);
elif idx=nops(L) then
RETURN([L[idx]]);
else
RETURN(L[idx+1..-1]);
fi;
end proc;

is_in_order:=proc(N::list,lis::list)::truefalse;
local final_result::truefalse:=true;
local item,r::list:=lis;
for item in N do
r:=find_element(item,r);
if nops(r)=0 then
final_result:=false;
break;
fi;
od:
RETURN(final_result);
end proc:
```

and now

is_in_order([7,2,4],[2,6,5,7,3,2,9,4])
true

is_in_order([7,2,4],[2,1,4,2,6,7,3,9])
false

is_in_order([7,2,4],[7,4,2,7,2,4])

true

is_in_order([7,2,4],[7,7,7,7,2,2,2,7,4])

true

Yes, a bug. Seems it went wrong in integration somewhere.

These are two temporary workarounds .

One is to use `useint`

Second is to replace (Heaviside(t-1)-Heaviside(t-2) with (Heaviside(t-a)-Heaviside(t-b) and then replace a=1 and b=2 back in the solution.

Both of these give same exact result, but with unresolved integral in the solution.  But at least they do not give y=0 as solution. Maple could not integrate this integral.

You might want to report this hopefully this will be fixed in future version.

 > restart;

 > F := (t-1)*(t-2)/(t^2+1)^3*(Heaviside(t-a)-Heaviside(t-b)); ode := diff(y(t),t,t) + diff(y(t),t) = F; ic := y(0)=0, D(y)(0)=0; sol:=dsolve([ode,ic]);

 > simplify(value(eval(sol,[a=1,b=2])))

 > F := (t-1)*(t-2)/(t^2+1)^3*(Heaviside(t-2)-Heaviside(t-1)); ode := diff(y(t),t,t) + diff(y(t),t) = F; dsolve([ode,ic],useint);

 > F := (t-1)*(t-2)/(t^2+1)^3*(Heaviside(t-2)-Heaviside(t-1)); ode := diff(y(t),t,t) + diff(y(t),t) = F; ic := y(0)=0, D(y)(0)=0; dsolve([ode,ic], y(t),method='laplace');

 > odetest(y(t)=0,[ode,ic])

To see why it gave zero, we can replace initial conditions by unknown values instead of zero

```F := (t-1)*(t-2)/(t^2+1)^3*(Heaviside(t-1)-Heaviside(t-2));
ode := diff(y(t),t,t) + diff(y(t),t) = F;
ic := y(0)=a, D(y)(0)=b;
sol:=dsolve([ode,ic]);
```

and now it gives

Which is zero when b and a are zero which is the case in the original input.