How to count the number of nonlinear terms in a li...

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

Why are eps plot files in Maple 2017 much large ...

My colleague and I are revising a paper which contains some 3dplots generated I think originally in Maple 2015 on macos as eps converted to pdf.  Originally they were around the 100 KB size.  When I generate them again in Maple 2017 they are more like 10 MB.  He is still running Maple 2015 and get the same 100 KB size.  Any idea what is going on here ?

Thanks Michael

EDIT:  An example is

with(plots);
plotsetup(postscript, plotoutput = `test.eps`, plotoptions = `color,portrait,height=350,width=350`);
plot3d(x^2+y^2+1, x = -1 .. 1, y = -1 .. 1, axes = boxed, grid = [200, 200]);

I get 7.6 MB my colleague with Maple 2015 gets 56 KB.  I tried it wtih Maple 2017 on a server I have access to also 7.6 MB.

Maple Implementation of Euler's method...

``````my_euler := proc (func_y, x_value, y_value, n, h)
local point_list, d_x, true_f, true_f_v; point_list := [10^(-n), 0, n];
true_f := unapply(func_y, x, y);
d_x := abs(point_list[2]-point_list[3]);
while d_x < point_list[1] do
true_f_v := true_f(x_value, y_value);
y_value := y_value+h*true_f_v;
x_value := x_value+h
end do;
return y_value
end proc``````

I am using Maple to implement Euler's method, it requires 5 parameters:

• func_y (The general form of ODE)
• x_value
• y_value
• n (The accurate digits, I do not know how to control the accurate digits)
• h (The step size)

So, I do not how to control accurate digits (4 accurate digits), can you teach me how to finish this part?

How to extract from the implicit plot when ...

Hello.

I'd like to extract numerical data from the plot of a implicit function and write it to the txt file. But, unfortunately due to a strong oscillating function and as a consequence extremely dense meshgrid I got a message that [Length of output exceeds limit of 1000000]. How to resolve this problem? Below is my code

```restart;
R0 := 1+w_c*(sum((2*(-1)^(n+1)*Pi^2/n*n)*t*sin(2*Pi*n*mu/w_c)*cos(Pi*n)*exp(-2*Pi*n*G/w_c)/(w_c*sinh(2*Pi^2*n*t/w_c)), n = 1 .. 3000))/Pi-mu;
with(plots, implicitplot);
G := 0.; t := 0.1e-2;
R1 := implicitplot(R0, w_c = 0 .. 5, mu = 0 .. 3, gridrefine = 10):
data := getdata(R1);
```

How to restrict the domain of a variable when find...

Consider two polynomials p and q in t. For example,  and . I want to find . But before I find it, solve an inequality and obtain that . After that when I evaluate , I dont want maple to return  as Gcd because  and thus the factor  is an unwanted common divisor. Is there a way to tell maple that "find the Gcd over a spesific domain". Because, otherwise maple needlessly spend time for finding the gcd. Any help would be appreciated.

How do I solve an unknown that makes a bivariate p...

I have a bivariate polynomial in x,y,say P, and a parameter, say d, appears in P. I want to find d for which P has at least one non trivial factor. Is there  a fats way to do this in maple. Any help would be appreciated.

Plotting a 3D Array...

Hello everyone,

I have the following problem:

I have an array of data dataarray[i,j,k] whose elements are either 1 or -1. I also have three vectors x[i], y[j] and z[k] (the axis).  I want to represent the data of dataarray so I have two different volumes: A green volume such as dataarray(x,y,z)=1 and a red one with dataarray(x,y,z)=-1. Is that possible? In case that it is, how can I do that?

Thank you very much in advance

How to set kernelopts for running the following co...

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? ...

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

Partition of n into prime parts...

We can say that prime p is a partition prime of n if there is at least one prime partition of n having p as least part. Example 8=3+5 so 3 is a partition prime, but 5 is not.

Furthermore, say that p is a singular partition prime if there is one and only one partition of n with p as least part. I am trying to find numbers n for which the set Q(n) of singular partition primes is {phi}. That is to say, if we take any prime partition of n, then there are at least two partitions associated with its least member. I find so far only two examples: 63 and 161. Clearly no such n can be prime because then n is a singular partition prime of itself (Incidentally, primes having only themselves as singular partition primes are: 2,3,7,13,23,31,41,79,101,107,149..).

I am asking for a code to compute more terms for the case Q(n)={phi}.

David.

Error, (in PDEtools/NumerDenom) invalid input: `PDEtools/NumerDenom` expects its 1st argument, ee, to be of type algebraic, but received {[(s_j*e^sigma*b^m*`σ_m`*y_i-s_j*e^sigma*beta*`σ_i`+s_j*e^sigma*b_ilo+(1/2)*b^(m+2)*`σ_j`*e^sigma*`σ_m`*y_i-b^2*`σ_j`*e^sigma*beta*`σ_i`+(1/2)*b^2*`σ_j`*e^sigma*b_ilo-(1/2)*b^(2*m)*`σ_m`^2*b_j*e^sigma*y_i+(1/2)*b^m*`σ_m`*b_j*e^sigma*beta*`σ_i`-(1/2)*b^m*`σ_m`*b_j*e^sigma*b_ilo+b_j*(s_ilo+(1/2)*(b^2*`σ_i`-b^m*`σ_m`*beta)*_lo)+b_j*(s_jlo+(1/2)*(b^2*`σ_j`-b^m*`σ_m`*beta)*_lo)+s_i*e^sigma*b^m*`σ_m`*y_j-s_i*e^sigma*be... when I use simplify I have this error. please guide me Saberali

Trouble with colorscheme option...

I plot a spacecurve,which is an intersection of two surface,x+y+z=5 and x*y+y*z+z*x=0.The curve is shown below.

Then I want the curve's color changes accroding to the value of x*y*z.From the help page,I learn that the colorscheme option can make the color of different parts of a surface change accroding to the value of an user given function.However,it does not apply to all Plots' package command.You need to use the display command,colorscheme option with the option "overrideoptions",to force the graph's color to changed to desired.

P1 is the graph of the curve.

The first code works well,it is just a test.

display(P1,colorscheme=["Orange","Blue"],overrideoptions)

The second code fail to chage color(In my document,I use 2-D Math Input,following the example)

display(P1, colorscheme = ["xyzcoloring", proc (x, y, z) options operator, arrow; x*y*z end proc], overrideoptions)

This is the trouble I encountered.So,please help me use this option correctly,or is there any other way to achieve my goal?

The file here.

problem_with_colorscheme_option.mw

How do I put a label on my output of a for loop? ...

I performed an iteration of over 300 using for loop, how can I label each of the output? Please help...

NLPSolver, non-numeric result encountered...

test.mw

NLPSolve('f(x,y,'g(x,y)')', x=0..1,y=0..1) is not working...

Plot two functions as one curve (3Dplot)...

Hello everyone, thank you in advance

I am trying to plot two functions in the same graph. I didn't realize how to copy the real functions here but:

At the same 3D plot

I need to use the function F1(x,xi,k,B) for values of x*xi <6  and other function F2(x,xi,k,B) for values of x*xi  >= 6

Thank you again and sorry for my rusty English.

I attached a file with these 2 functions Functions_MAPLE_PLOT_TOGETHER.mw

 4 5 6 7 8 9 10 Last Page 6 of 40
﻿