Unanswered Questions

This page lists MaplePrimes questions that have not yet received an answer

Description of program: To try to find 'similar shaped' words.  eg the word 'qwirky' is similar to 'ywivhg' because q, y and g have downstrokes and h, k have an 'upstroke'.  ..at present the 'words' are not words in the dictionary sense.

   I have posed several questions throughout the program, but will focus on the most puzzling which is in the last section of the program, reproduced below.  The variable ii is set at 1 - relating to the first letter, q, of the 'word' qwirky. It correctly outputs the list, listy[4], which contains the letter q.  Similarly if ii is set to 2 it ouputs listy[8] - w.  However when ii is set to 3, it ouputs the number 7, when listy[7] (=[i]) was expected.  Values of ii from 4 to 6 (thelength of 'qwirky') work as expected.  Ideally I would like to dispense with  the ii:=1 statement, and uncomment the for .. do loop:

> for ii from 1 to nops(letters) do
> seq(listy[listsuffix[  Ord(letters[ii] )-96] ][kk], kk=1..nops(listy[listsuffix[Ord(letters[ii] )-96] ]) );
> end do:

  Another question was how to incorporate the sequence, seq() statement in a printf statement - but that's enough for now!!:-)

    After reading thris through and seeing theTags, I see I have used a variable 'letters' in my program - perhaps this is causing problems?  I initially thought Maple had a bug in it - but probably a common thought by students!:-)

 ##End part of program  

> ii:=1:   #####Try putting equal to 2, 3, 4, 5, 6
> #ii:=2 returns w - which is correct, but ii:=3 returns 7 when i is expected. Values 4 to 6 work OK
> printf("List of the listy which contains the particular letter, %d  of 'qwirky'  ie the letter %s",ii, letters[ii]);
> printlevel:=5:
> printf("Nops(word)=%d  nops(letters)=%d\n",nops(word),nops(letters));
> #for ii from 1 to nops(letters) do
> seq(listy[listsuffix[  Ord(letters[ii] )-96] ][kk], kk=1..nops(listy[listsuffix[Ord(letters[ii] )-96] ]) );
> #end do:

Thanks, David S

START of MAPLE PROGRAM here

# Similar Words - idea is to create words which look similar in shape to other words
> restart:
> with(StringTools):
> #abcdefghijklmnopqrstuvwxyz
> #a  c, e, o, s, u, x, z
> #b  d, h, k,
> #f  l, t
> #g  j, p, q, y
> #i
> #m  n
> #r  v
> #w
>
> #  Take a word eg 'qwirky' & make words which appear similar -
>
> word:="qwirky":
> numLetters:=length(word):
> printf("Length of word is %d",length(word));
> printf("Why is the length of x+2*y equal to %d - as opposed to just 5?",length(x+2*y));
> printf("Is it because x and y each take up 3 'storage locations' - and one each for +2* ?");  
>
> # Help says:For other objects, the length of each operand of expr is computed recursively and added to the number of words used to represent expr. In this way, the measure of the size of expr is returned.
> #...but I'm not much wiser!:-(
> #I ended up using 'nops' instead, but not sure which is better.
> listy[1]:=[a,c,e,o,s,u,x,z]:
> #printf("Number of letters in listy[1] seq(%s, kk=1..nops(listy[1]))   is %d\n",seq(listy[1][kk], kk=1..nops(listy[1])));
> printf("The previous printf statement - commented out - does not work.  The one below does\n - but that's because I've put in eight 'per cents'\n - I'd like the program to work this out.\n");    
>
> printf("Number of letters in listy[1] %s,%s,%s,%s,%s,%s,%s,%s is %d\n",seq(listy[1][kk], kk=1..nops(listy[1])  ),nops(listy[1]) );
> listy[2]:=[b, d, h, k]:
> listy[3]:=[f, l, t]:
> listy[4]:=[g, j, p, q, y]:
> listy[5]:=[m, n]:
> listy[6]:=[r, v]:
> listy[7]:=[i]:
> listy[8]:=[w]:
> #Which list number, for each letter of the 26 letters?
> #Nos below correspond to a, b,c... ..z
> listsuffix:=[1,2,1,2,1,3,4,2,7,4,2,3,5,5,1,4,4,6,1,3,1,6,8,1,4,1]:
> #printf("listsuffix[12]=%d",listsuffix[12]);
> #printf("listy[4][2]=%s",listy[4][2]);
> printf("Ascii number of Second letter in list 4 is %d",Ord(listy[4][2]));
> printf("Second letter in list 4 is %s",Char(Ord(listy[4][2])));
> #printf("listsuffix[listy[4][2]]=%d",listsuffix[listy[4][2]]);
> #Split into a list of letters
> letters:=convert(word, list):
> #Consider the letters close to the letters - go through all combinations and check to see if any match words in the dictionary.
> #printf("1");
> #printf("%d",Ord(letters[2]));
> #printf("2");
> #printf("Suffix number is %d",listsuffix[Ord(letters[2])-71]);
> #printf("3");
> for i from 1 to length(word) do
> #See which list letter belongs to
> #printf("Letter number %d, %A belongs to list %d\n",i,letters[i],listsuffix[Ord(letters[i])-96]);
> printf("Ascii number of letter number %d, %s in list %d is %d\n",i,letters[i],listsuffix[Ord(letters[i])-96],Ord(letters[i]));
>
> #printf("Ascii number of letter number %d, %s is %d in list %d which is \n",i,letters[i],Ord(letters[i]),listsuffix[Ord(letters[i])-96]);
> #printf("Below may not work");
> #printf("Ascii number of letter number %d, %s is %d in list %d which is seq(%s, kk=1..nops(listy[listsuffix[Ord(letters[ii] )-96] ]) ))\n",i,letters[i],Ord(letters[i]),listsuffix[Ord(letters[i])-96],seq(listy[listsuffix[  Ord(letters[ii] )-96] ][kk], kk=1..nops(listy[listsuffix[Ord(letters[ii] )-96] ]) ) );
>
> #Check out all letters in list, listy[listsuffix[Ord(letters[i])-96]
>
> #seq(  listy[  listsuffix[  Ord(letters[i] )-96]  ], 1..length(listy[                listsuffix[  Ord(letters[i] )-96]);
> #seq(listy[listsuffix[  Ord(letters[ii] )-96] ][kk], kk=1..nops(listy[listsuffix[Ord(letters[ii] )-96] ]) )
> end do:
> #seq(listy[2][kk], kk=1..4);
> #List of listy[2]
> printf("List of listy[2] below:");
> seq(listy[2][kk], kk=1..nops(listy[2]));
> #List of the listy which contains the particular letter of 'qwirky'
> ii:=1:   #####Try putting equal to 2, 3, 4, 5, 6
> #ii:=2 returns w - which is correct, but ii:=3 returns 7 when i is expected. Values 4 to 6 work OK
> printf("List of the listy which contains the particular letter, %d  of 'qwirky'  ie the letter %s",ii, letters[ii]);
> printlevel:=5:
> printf("Nops(word)=%d  nops(letters)=%d\n",nops(word),nops(letters));
> #for ii from 1 to nops(letters) do
> seq(listy[listsuffix[  Ord(letters[ii] )-96] ][kk], kk=1..nops(listy[listsuffix[Ord(letters[ii] )-96] ]) );
> #end do:

#####  END of program.   Below is output for Maple 7   ##########


Warning, the assigned name Group now has a global binding

Length of word is 6
Why is the length of x+2*y equal to 9 - as opposed to just 5?
Is it because x and y each take up 3 'storage locations' - and one each for +2* ?
The previous printf statement - commented out - does not work.  The one below does
 - but that's because I've put in eight 'per cents'
 - I'd like the program to work this out.
Number of letters in listy[1] a,c,e,o,s,u,x,z is 8
Ascii number of Second letter in list 4 is 106
Second letter in list 4 is j
Ascii number of letter number 1, q in list 4 is 113
Ascii number of letter number 2, w in list 8 is 119
Ascii number of letter number 3, i in list 7 is 105
Ascii number of letter number 4, r in list 6 is 114
Ascii number of letter number 5, k in list 2 is 107
Ascii number of letter number 6, y in list 4 is 121
List of listy[2] below:
                                          b, d, h, k
List of the listy which contains the particular letter, 1  of 'qwirky'  ie the letter q
{--> enter printf, args = "Nops(word)=%d  nops(letters)=%d\n", 1, 6
Nops(word)=1  nops(letters)=6
                                              30
<-- exit printf (now at top level) = }
{--> enter StringTools:-Ord, args = "q"
                                             113
<-- exit StringTools:-Ord (now at top level) = 113}
{--> enter StringTools:-Ord, args = "q"
                                             113
<-- exit StringTools:-Ord (now at top level) = 113}
{--> enter StringTools:-Ord, args = "q"
                                             113
<-- exit StringTools:-Ord (now at top level) = 113}
{--> enter StringTools:-Ord, args = "q"
                                             113
<-- exit StringTools:-Ord (now at top level) = 113}
{--> enter StringTools:-Ord, args = "q"
                                             113
<-- exit StringTools:-Ord (now at top level) = 113}
{--> enter StringTools:-Ord, args = "q"
                                             113
<-- exit StringTools:-Ord (now at top level) = 113}
                                        g, j, p, q, y

 

i use a not good example's polynomials to illustrate the idea

u1:=3*a*c+b^2+c;
u2:=7*a^5*b*c^3;
u3:=a+3*b^2;
T := lexdeg([a,b,c],[e1,e2, e3]);
GB := Basis([e1-u1, e2-u2, e3-u3],T);
result := NormalForm(a*b+b*c, GB, T);

now result is to express a*b+b*c in terms of e1, e2, e3 which represent u1, u2, u3.

is it possible to use preimage to find possible u1,u2,u3 if unknown u1,u2,u3 and given known eqx?

How to use preimage to find possible eqx if given known u1,u2,u3 to find eqx in NormalForm(eqx, GB, T)?

 

what i confused in code below is that if i know it in terms of -1*e1+2*e2+*e3

it already can be used to find eqx, it seems reasonable to put source1list as unknown to find eqx  or find unknown eq1, eq2, eq3 if given known eqx.

with(RegularChains):
with(ConstructibleSetTools):
source1 := PolynomialRing([e1, e2, e3]);
target1 := PolynomialRing([a, b, c]);
source1list := [...];
target1list := [eq1, eq2, eq3];
cs := PolynomialMapPreimage(target1list, source1list, source1, target1);
Info(cs, source1);
[[e1-e2-e3], [1]]
-1*eq1+2*eq2+*eq3;

Hi, I am using Maple 18 and struggling with plotting Newton's Method.

I am wanting use the function f(x)=x^3 +cx + 1 where c is a parameter and uses 100 parameter values between -2 and 0, with 100 iterations of each parameter.

Any help would be brilliant.

Thanks in advance,

Neil

deqn4 := {4*eta^4*(diff(f(eta), eta, eta, eta))*(diff(f(eta), eta))-12*eta^3*(diff(f(eta), eta, eta, eta))*f(eta)+12*eta^4*(diff(f(eta), eta, eta))*(diff(f(eta), eta))-36*eta^3*(diff(f(eta), eta, eta))*f(eta)-24*eta^3*(diff(f(eta), eta))^2+12*eta^2*(diff(f(eta), eta))*f(eta)-36*eta*f(eta)^2-4*eta^3*(diff(f(eta), eta, eta))*(diff(f(eta), eta))-12*eta^2*(diff(f(eta), eta, eta))*f(eta)+12*eta^3*f(eta)*(diff(f(eta), eta))+36*eta^2*f(eta)^2-4*eta^3*(diff(f(eta), eta, eta, eta, eta))-12*eta^3*(diff(f(eta), eta, eta, eta))+12*eta^2*(diff(f(eta), eta, eta))-12*eta*(diff(f(eta), eta))+24*f(eta) = 0};
/
| 4 / d / d / d \\\ / d \
< 4 eta |----- |----- |----- f(eta)||| |----- f(eta)|
| \ deta \ deta \ deta /// \ deta /
\

3 / d / d / d \\\
- 12 eta |----- |----- |----- f(eta)||| f(eta)
\ deta \ deta \ deta ///

4 / d / d \\ / d \
+ 12 eta |----- |----- f(eta)|| |----- f(eta)|
\ deta \ deta // \ deta /

3 / d / d \\
- 36 eta |----- |----- f(eta)|| f(eta)
\ deta \ deta //

2
3 / d \ 2 / d \
- 24 eta |----- f(eta)| + 12 eta |----- f(eta)| f(eta)
\ deta / \ deta /

2
- 36 eta f(eta)

3 / d / d \\ / d \
- 4 eta |----- |----- f(eta)|| |----- f(eta)|
\ deta \ deta // \ deta /

2 / d / d \\
- 12 eta |----- |----- f(eta)|| f(eta)
\ deta \ deta //

3 / d \ 2 2
+ 12 eta f(eta) |----- f(eta)| + 36 eta f(eta)
\ deta /

3 / d / d / d / d \\\\
- 4 eta |----- |----- |----- |----- f(eta)||||
\ deta \ deta \ deta \ deta ////

3 / d / d / d \\\
- 12 eta |----- |----- |----- f(eta)|||
\ deta \ deta \ deta ///

2 / d / d \\ / d \
+ 12 eta |----- |----- f(eta)|| - 12 eta |----- f(eta)|
\ deta \ deta // \ deta /

\
|
+ 24 f(eta) = 0 >
|
/
init4 := { {f(0) = 1, (D(f))(0) = 0, ((D@@2)(f))(0) = 0, ((D@@3)(f))(0.1e-2) = 0} };
{{f(0) = 1, D(f)(0) = 0, @@(D, 2)(f)(0) = 0,

@@(D, 3)(f)(0.001) = 0}}
dsol4 := dsolve(deqn4 union init4, numeric, method=rkf45);

Error, (in dsolve/numeric/process_input) system must be entered as a set/list of expressions/equations

Hi,

I have a eight different size lists.

I want to put it into the Array with simplest and clear way as possible respect to first column and containg symbols.
I enclose workseet.

Could you help somone?.
Thank you in advanced

wzel

fill_the_array.mw

i find maple help using regular chain library, but it has ideal source and ideal target,

when compare with singular, seems different, i am not sure singular code whether correct or not.

so, would like to ask how to do this in maple

if you know singular, i would like to know too.

 

ring r = 32003, (x,y), lp;
setring r;
ideal Z;
ideal i = x-x2-2*x*y+2*x2*y-2*x*y2+y+y2, 1-x2-2*x*y+2*x2*y-2*x*y2+y2;
map phi = r, i;
ideal i1 = preimage(r,phi,Z);
i1;
ideal i2 = preimage(r,i,i);
i2;
ideal i3 = preimage(r,i,Z);
i3;
ideal i4 = preimage(r,Z,i);
i4;

 

would like to apply to find Cohen Maculay

 

While(NewKer <> 0)

Mapping = Basis(M – N) ^ K[M]

NewKer = ker(Mapping, M, N)

N = M

M = NewKer

If IsCM(NewKer) = true then

    NewKer

End if

Do

Dear All,

I need your help to plot the phase portrait using DEtools[DEplot]  these are the lines of the code. But when I make RUN, there is an error. I need your help to fix the error. Many thinks.

 

r1:=1; r2:=1; q2:=2; q1=0.5;  a1:=1;

Sys1 := {diff(N(t),t) = r1*N*(1-N/q1)-P*N/(1+N), diff(P(t),t) = r2*P*(exp(-a1*P)-q2)+P*N/(1+N)};

DEtools[DEplot](Sys1,[N(t),P(t)],t=-10..10,N=0..2,P=0..2);

 

Many thinks

Hello, Maple wizards.

I have a problem with Tasks for parallel computations. In each task my programm should execute this command:

>B:=SignalProcessing:-DFT(A)

"A" and "B" are Arrays (1..m). "m" is integer. I have 8 tasks. Each task is a loop ("for i from 1 to n do..." n is integer), where my command is executing. "A" and "B" are local for each task. In this case each task should execute my command n times.

So, I obtain this:

"Error, (in SignalProcessing:-Engine:-DFT) attempting to assign to `FwdDFT` which is protected"

What is it? In Maple Help I read that ">SignalProcessing:-DFT" is Thread-Safe Function.

 

I have a characteristic equation. some times It has polar roots . sometimes It has real roots and sometimes both of them.

I want to extract real roots and extract polar roots if they are.

for instance:

q:=m3*r^3+m2*r^2+m1*r+m0:

rot:=solve(q=0,r);

I want to know how can I use if in this part ?

Can maple solve maximization problem like

q := proc (a, b, c) options operator, arrow; .2*b+.1*c end proc;
print(`output redirected...`); # input placeholder
(a, b, c) -> 0.2 b + 0.1 c
w := proc (a, b, c) options operator, arrow; .7*a+.1*c end proc;
print(`output redirected...`); # input placeholder
(a, b, c) -> 0.7 ab + 0.1 c
e := proc (a, b, c) options operator, arrow; .7*a+.2*b*c end proc;
print(`output redirected...`); # input placeholder
(a, b, c) -> 0.7 a + 0.2 b c

with(Optimization)

Maxmize(int(min(100+(.7*a+q)*(1/2), a), q)+int(min(100+(.2*b+w)*(1/2), b), w)+int(min(100+(.1*c+e)*(1/2), c), e)-a-b-c-ab-ac-bc)

Error, (in Optimization:-NLPSolve) cannot convert procedures to piecewise

 

 

Thanks alot if you can help me.Urgent! Really appreciate.

 

Hi there,

I used the following plot command in maple13.

with(plots):

implicitplot(abs(x)+abs(y)=2, x=-2..2, y=-2..2, scaling=constrained)

But the output(square) is not complete at vertices.In fact at the vertex the graph is like a trapezoid.

Any help will be appreciated.

Yegan

 

> restart;
> with(plots);
> Eq1 := diff(f(eta), eta, eta, eta)+f(eta)*(diff(f(eta), eta, eta))-2*(diff(f(eta), eta))^2-M^2*(diff(f(eta), eta)) = 0;
/ d / d / d \\\ / d / d \\
|----- |----- |----- f(eta)||| + f(eta) |----- |----- f(eta)||
\ deta \ deta \ deta /// \ deta \ deta //

2
/ d \ 2 / d \
- 2 |----- f(eta)| - M |----- f(eta)| = 0
\ deta / \ deta /
> Eq2 := 1+(4/3)*R*(diff(theta(eta), eta, eta))+Pr*(f(eta)*(diff(theta(eta), eta))-(diff(f(eta), eta))*theta(eta)) = 0;
4 / d / d \\
1 + - R |----- |----- theta(eta)||
3 \ deta \ deta //

/ / d \ / d \ \
+ Pr |f(eta) |----- theta(eta)| - |----- f(eta)| theta(eta)| = 0
\ \ deta / \ deta / /
> bcs1 := f(0) = S, (D(f))(0) = 1+L*G, (D(D(f)))(0) = .1, f(6) = 0;
f(0) = S, D(f)(0) = 1 + L G, @@(D, 2)(f)(0) = 0.1, f(6) = 0
> fixedparameter := [S = .1, M = .1];
[S = 0.1, M = 0.1]
> Eq3 := eval(Eq1, fixedparameter);
/ d / d / d \\\ / d / d \\
|----- |----- |----- f(eta)||| + f(eta) |----- |----- f(eta)||
\ deta \ deta \ deta /// \ deta \ deta //

2
/ d \ / d \
- 2 |----- f(eta)| - 0.01 |----- f(eta)| = 0
\ deta / \ deta /
> fixedparameter := [R = .1, Pr = .7];
[R = 0.1, Pr = 0.7]
> Eq4 := eval(Eq2, fixedparameter);
/ d / d \\ / d \
1 + 0.1333333333 |----- |----- theta(eta)|| + 0.7 f(eta) |----- theta(eta)|
\ deta \ deta // \ deta /

/ d \
- 0.7 |----- f(eta)| theta(eta) = 0
\ deta /
> bcs2 := theta(0) = 1+T*B, (D(theta))(6) = B, theta(6) = 0;
theta(0) = 1 + T B, D(theta)(6) = B, theta(6) = 0

> T := .1; B := .1;
0.1
0.1
> L := [0., .1, .2, .3];
[0., 0.1, 0.2, 0.3]
> for k to 4 do R := dsolve(eval({Eq3, Eq4, bcs1, bcs2}, L = L[k]), [f(eta), theta(eta)], numeric, output = listprocedure); Y || k := rhs(R[2]); YL || k := rhs(R[3]) end do;
Error, (in dsolve/numeric/bvp/convertsys) too many boundary conditions: expected 6, got 7
> plot([YL || (1 .. 4)], 0 .. 6, 1 .. -.2, labels = [eta, diff(f(eta), eta)]);

 

Dear all;

I need your help to get all the solution of this nonlinear  system  with four parameters: r1, r2, q1, q2  assumed to be positives. Let the system:

the first equation is: r1*x*(1-x/q1)=x*y/(1+x)

the second equation: r2*y*(exp(-y)-q2)=-x*y/(1+x)

How can get the positive solution ( x, y) of the previous system.

Thank you for your help.

Consider the function

 

 

The above definition may result in four cases depening on r and x.

Can Maple calculate automatically all possible cases and the corresponding Maxima, Minima and Values at intervals limits?

 

I have an ode in the form:

 

diff(u(x),x)-f(x)=u(x)^3+B(X)*u(x)+g(x)

how to extaract and name the different coefficients of the equation?

 

Thanks 

Hamada

First 216 217 218 219 220 221 222 Last Page 218 of 334