Maple 2017 Questions and Posts

These are Posts and Questions associated with the product, Maple 2017

hi

i have expression like

z:=f0(x) + f1(x)*diff(y(x),x) + f2(x)*diff(y(x),x,x) + f4(x)*diff(y(x),x,x,x,x) ... etc ;

always linear terms diff((y(x),x) etc, never like diff((y(x),x)^2

want vector with coeffs of diff((y(x),x) etc in order low to high so want

<f1(x), f2(x), 0, f4(x) ...>

if z:=f0(x) + f2(x)*diff(y(x),x,x) + f4(x)*diff(y(x),x,x,x,x) ... etc ; want <0, f2(x), 0, f4(x) ...>

first term in vector always for diff((y(x),x)

how to do thanks

 

 

 

 

Any could you please help me to write program using for loop of 

U(0, h, m)=0 for h=1 .. 10, m=0..10.?

Hello everyone,

I am trying to represent a set of data using the errorplot command as follows

plotlims50 := ErrorPlot(xcoords = vectorl, sigmasl50, yerrors = [0.1e-1, 0.4e-1, 0.1e-1, 0.3e-1, 0.3e-1, 0.6e-1, 0.6e-1, 0.1e-1, 0.4e-1, 0.6e-1, 0.5e-1, 0.3e-1, 0.2e-1, 0.2e-1], color = "green")

I guess it's okey, but I would like to have that kind of small lines at the end of the bar and perpendicular to it (like in the image below). Is it possible?

Thank you so much in advance

Hi,

I'm working on a procedure involving conic equations such as follows... 

Conic:=a*x^2+2*h*x*y+b*y^2+2*f*x+2*g*y+c;

and I have a file filled with values in order of the variables I want them assigned to.

e.g 2,-6,3,0,0

I'm only looking for the specific command I need for maple to link the two.

Any help would be greatly apreciated.

Hello everyone,


I'm trying to generate plots in Maple so that I can export the image and be easily read in a document. I usually use the plots [display] command as I often reuse "subplots". The main problem appears when entering a legend, as it disrupts the proportions and I have to rescale everything manually. In doing so I sometimes get small, hard-to-read images or captions. Is there any way to resize the image and caption other than manually? Even better, is there a way to scale both to a certain image size and to make the caption legible at that size (e.g. image 7 cm wide and font equivalent to 10 pt in Word)?

Thank you so much in advance

Hi, I'm having trouble setting up a procedure for an assignment, we're trying to find root mean square error and remove variable by variable to find the best line of fit etc etc... hopefully from the coding you can see what I'm am trying to do, but I don't understand why it is not working? I wonder if it has something to do with the X and Y being read in?
 
M:=readdata("C:\\Users\\bjense04.CSUMAIN.001\\Documents\\ass1Q2.txt",[float,float,float,float,float]):
convert(M,matrix):
with(LinearAlgebra):
n:=RowDimension(convert(M,matrix));
X:=convert(M[1..n,1..4],matrix):
Y:=convert(M[1..n,5..5],vector):
with(Statistics):
FullEQN:=LinearFit([1,a,b,c,d],X,Y,[a,b,c,d]);
#the next part is incomplete
rmse_mlr:=proc(Full)
local i, sq, n, predicted;
sq:=0:
for i from 1 to n do
 predicted:=subs([a=X[i,1],b=X[i,2],c=X[i,3],d=X[i,4]],Full);
 sq:=sq+(Y[i]-predicted)^2;
end do:
return sqrt(sq/n);
end proc;
 
 
I then test the procedure with 
rmse_mlr(FullEQN,X,Y);
 
and the response i get is

Error, (in rmse_mlr) final value in for loop must be numeric or character
 
help?

I can't figure out how to write a program to work out the classification of a conic and if it is a degenerate given a data file.

So far I have programed the following which reads the conic coefficients (a,h,b,f,g,c) and displays it as an equation: 

conic :=proc(a,h,b,f,g,c)
local C;
C:= a*x^2+h*x*y+b*y^2+f*x+g*y+c=0;
end proc:

Can anyone help me work this out

Hi I have product of function Q along with its derivative.  

Q'j(x)*Qi(x) for j=0,1 and i=0,...n.

how can i make loop  to collect all coefficeints for this function for j=0,1 and i=0,1,..n.

i hope some one will help me.

Thanks

Hi Everyone, So i have a pretty ugly function which i am interesting in plotting. When i plot it seems that all values are real however when i do evalf with specific values of variable i am plotting over it shows that it is complex. Any thoughts on how to get it to stop plotting once it becomes complex? See attached maple file.

ComplexPlotQuestion.mw

Thanks. 

I am trying to count of the number of primes p such that when p is concatenated with 1 (ie p1, or 10*p+1),  if p1 is composite then we record the result 1, else  2. This gives the minimum k for which the concatenation pk is composite, and k is always either 1 or 2. It would be interesting to compare the number of primes with 1 and those with 2 up to a given max. I have already written a code which calculates the 1 or 2 for each prime but have not managed to adapt it keep count.
 

I would like to have a code to keep a count  of the 1s and 2s, thus being able to say that up to 10^k we see {a, b} where a is the number of primes with "1" and b is the number with "2".

Ideally I would like to be able to output plots of these data for any k =1,2,3,... up to a pre declared maximum k value, so as to make comparative graphs. I do not know how to organise the counting process, or if it is possible to get Maple to do the plots as well. Can anyone please assist me with this? I have Maple 2017.

Best regards,

David.

 

Hi,

Maple 2017.3 has these problems which hamper my work with it. I shown three examples.

Example 1: Maple cannot recognize automatically that two complex numbers are equal:

[>eq1:=9*exp((1/9)*(5*I)*Pi)-9*exp((1/9)*(2*I)*Pi) = -8*exp((1/9)*(2*I)*Pi)+7*exp((1/9)*(5*I)*Pi)+exp((1/18)*(13*I)*Pi)*sqrt(3);

Here, lhs(eq1) and rhs(eq1) are in fact equal. Yes, evela(simplify(lhs(eq1)-rhs(eq1)) reduces to zero but not when solving equations (see Example 2).

Example 2:

[>sys1:=[_xx[1]+lhs(eq1),_xx[1]+rhs(eq1)];
[>solve(sys1,[_xx[1],_xx[2]]);

yields no answer.

Example 3:

[>alias(omega=RootOf(_Z^2+_Z+1));
[>rt:=(-1+I*sqrt(3))/2;

Maple fails to substitute the alias and recognize that rt=omega.

Any suggestion on a work-around problems 2 and 3 would be helpful.

Thanks,

Rafal Ablamowicz
www.math.tntech.edu/rafal/


 

Hi everyone, I hope you are staying safe from coronavirus.

I have a table of data points in excel (attached file) and want to plot a smooth surface plot in Maple, the plot will look like in the image below. How can I do it in Maple (2017)? I tried matrixplot(matrix) and the surface is good. However, I couldn't change the X, Y axes value since it should be the default value. 

Thank you very much.PlotTest.xlsx

Hello

Unfortunately I run out of ideas on how to solve the problem of searching and removing elements in a variable size list.  Below you can find an example.

parms:=[seq(seq(alpha[i,j],j=0..9),i=1..3)];
abc:=combinat:-choose(parms,3):

the condition to remove the element of the list is given by the following procedure.

conds:= proc(varCoef::list,vars::name:=alpha)
local T1,T2,res;
#
T1 := table([2=3,3=2,5=6,6=5,7=9,9=7]):
T2 := table([2=3,3=2]):
#
res:=map(u->vars[`if`(assigned(T2[op(1,u)]),T2[op(1,u)],op(1,u)),
         `if`(assigned(T1[op(2,u)]),T1[op(2,u)],op(2,u))],
    varCoef);
res:=convert(convert(res,set),list):
end proc:

Something like

member(conds(abc[1]),abc,'k')

if it is a member, the element indexed by k should be removed from abc and then the search continues using the next element in abc (that now has one less element).   Otherwise, the element is kept and the search moves to next one.  The process ends when the last element in a short version of abc is tested.

Thanks all for the help and patience.

 

Ed

 

 

Hello

I need to test a huge amount of subsets and for doing that I was thinking of using combinat:-subset, since it avoids allocating memory for all subsets.  The problem with subset for my specific application is that it generates sets with all possible sizes and I just need subsets with a chosen number of elements.  Can that be done in maple?  

Many thanks

Ed

 

Hello

Moving from Mathematica to Maple and back these couple of days is driving me insane.  I get stuck trying to translate very simple things for not knowing each command belongs to each software.  Therefore I do apologize for another silly question. 

Given the list of indexed variables

varA := [A[1, 0], A[1, 1], A[1, 2], A[1, 3], A[1, 4], A[1, 5], A[1, 6], A[1, 7], A[1, 8], A[1, 9], A[2, 0], A[2, 1], A[2, 2], A[2, 3], A[2, 4], A[2, 5], A[2, 6], A[2, 7], A[2, 8], A[2, 9], A[3, 0], A[3, 1], A[3, 2], A[3, 3], A[3, 4], A[3, 5], A[3, 6], A[3, 7], A[3, 8], A[3, 9]]

how to apply the following substitution 

varA/. {Subscript[A, m_, 2] -> Subscript[B, m, 3], 
  Subscript[A, m_, 3] -> Subscript[B, m, 2], 
  Subscript[A, m_, 5] -> Subscript[B, m, 6], 
  Subscript[A, m_, 6] -> Subscript[B, m, 5], 
  Subscript[A, m_, 7] -> Subscript[B, m, 9], 
  Subscript[A, m_, 9] -> Subscript[B, m, 7]}

After trying a couple of commands such as map, subs, etc. I decide to try fromMma but no avail.  

Many thanks for the patience and help.

 

Ed

 

 

2 3 4 5 6 7 8 Last Page 4 of 40