8 years, 18 days

## How to preserve the order when extractin...

Maple 2017

Hello (again)

I thought I won't need help with that type of question but I came across an example that says otherwise.  Here it is

vars:=[x,y,z];

model7 := [x*(-RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)-5/4)+y*alpha[1, 2]-33/(32*RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)), x*z*alpha[2, 6]+y*RootOf(64*_Z^3+80*_Z^2+1104*_Z+561), x^2*(17*RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)+17)/(alpha[1, 2]*alpha[2, 6])-17*x*y/alpha[2, 6]+2*z*x-z-(163/32+RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)^2+5*RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)*(1/4))/(alpha[1, 2]*alpha[2, 6])]

then I issued the command

map(w->coeffs(w,vars),model7);

to get

[-33/(32*RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)), -RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)-5/4, alpha[1, 2], RootOf(64*_Z^3+80*_Z^2+1104*_Z+561), alpha[2, 6], -(163/32+RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)^2+5*RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)*(1/4))/(alpha[1, 2]*alpha[2, 6]), -1, (17*RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)+17)/(alpha[1, 2]*alpha[2, 6]), -17/alpha[2, 6], 2]

clearly the order does not follow model7's.

I have also tried

[seq(coeffs(expand(model7[i]), indets(model7[i], suffixed({vars[]}))),i=1..nops(model7))];

Is there a solution to it?

Many thanks (again)

Ed

## How to list only real solutions when the...

Maple 2017

Hello

I have the following set of coefficients

coef7 := [-1, 2, alpha[1, 2], alpha[2, 6], (17*RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)+17)/(alpha[1, 2]*alpha[2, 6]), -17/alpha[2, 6], -33/(32*RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)), -(163/32+RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)^2+5*RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)*(1/4))/(alpha[1, 2]*alpha[2, 6]), -RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)-5/4, RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)]

Considering that alpha[1,2] and alpha[2,6] are always real, how can I extract only the real solution from coef7?

Many thanks.

Ed

## How to count the number of nonlinear ter...

Maple 2017

Hello

I need to count and separate the nonlinear terms in a list.  Example:

w:=[[z, y, x, 1], [x*z, x*y, y, 1], [x*z, z, x*y]];

there are 4 nonlinear terms, x*z, x*y, x*z, and x*y.

The terms can be any combination of the given variables, that is, x, y, and z.

My solution to the problem of counting the nonlinear terms is

aux1:=[seq([seq(nops(w[j,i]),i=1..nops(w[j]))],j=1..nops(w))];

aux2:=[seq(selectremove(x->x>1,aux1[i])[1],i=1..nops(aux1))]

res:=convert([seq(convert(nops(aux2[i]),`+`),i=1..nops(aux2))],`+`);

It works but I wonder whether there is a better solution that includes showing the nonlinear terms themselves.

Many thanks

Ed

## How to set kernelopts for running the fo...

Maple 2017

Hello

Although I am (remotely) running the following piece of code in a linux machine with 256 GB of ram, the error msg "Execution stopped: Stack limit reached" comes out

kernelopts(stacklimit);
NestList:= proc(f, x, n::nonnegint)
local R:= rtable(0..n, [x]), k;
for k to n do R[k]:= simplify(f(R[k-1])) od:
[seq(R)]
end proc:
n:=34;
yreal:=NestList(y-> 4*y*(1-y),1/8,n):

I have tried to increase stacklimit issuing the command "kernelopts(stacklimit=256000)" but to no avail.  Is there anything else I can do?  A similar code run successfully in a mac with Mathematica.

Many thanks

Ed

PS. The default kernelopts(stacklimit) shows 8192 on the linux machine and  but 32736 on the mac pro.  I was expecting a higher number on the linux machine.

## How add legend to a dataplot? ...

Maple 2017

Hello

I need to add a legend to a figure using dataplot (I am not even sure that is the right option).  In what follows I show what I did.

dataplot([28,28,28],[.6481496576, .648149657615473, .6512873548],style='point',colorscheme=["Blue","Orange","Red"],
labels = ["k", "y(k)"], legend = ["10-digit precision", "15-digit precision", "Floating-point iteration"] ,legendstyle = [font = ["HELVETICA", 9], location = right]);

The outcome is

As can be seen some parts of the legend are missing.

How can I get this right? Do I have other ways to do the same thing?

Many thanks

Ed

 First 8 9 10 11 12 13 14 Page 10 of 15
﻿