MaplePrimes Questions

Definition Let "F"  be a field with f(x), g(x), p(x) being polynomials in F[x] and "p(x)" nonzero. Then if "p(x)|f(x)-g(x)" we say "f(x)" is congruent to "g(x)" modulo "p(x)". 
               
For example, in Q[x], x^2+x+1 is congruent to x+2 modulo x+1 because (x^2+x+1)-(x+2) = x^2-1=(x+1)(x-1).

This congruence among polynomials is similar, but not quite the same as congruence among integers.

Is there a way, in Maple, to solve problems like this? Could Maple tell me, for example, what polynomials are congruent to x^2+x+1 modulo x+1? An answer might be in the form x^2 +x+1 belongs to [x-1], an  equivalence class of polynomials.

I have not been able to find any such function in Maple, nor any calculator for it on the web. Maybe I'm not using the right search terms.

Hello, consider 0<x<1, 0<y<1 and t >0 (t: fixed)

Let the region:
R={(x,y) | x*(1-y)/y*(1-x) < t}

How can I draw the region R in Maple. thanks.

I am attaching the sheet, I want to solve for w or find range of w. 
q1.mw

I noticed sometimes Maple dsolve solves an ode using a method different than what odeadvisor says it is.

In this example ode, advisor said it is separable. But when solving it, dsolve actually solved it as dAlembert.

Why is that? Should not these be the same?

I also noticed Maple does not verify the solution of the ode when asked to solve it as separable, which is what the advisor says. But it does verify the solution using dAlembert.

So in this example, should not advisor have said this ode is dAlembert and not separable then?

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1786 and is the same as the version installed in this computer, created 2024, August 10, 8:50 hours Pacific Time.`

ode:=y(x) = x + 3*ln(diff(y(x), x));
DEtools:-odeadvisor(ode);

y(x) = x+3*ln(diff(y(x), x))

[_separable]

infolevel[dsolve]:=5:
sol_1:=dsolve(ode);

Methods for first order ODEs:

-> Solving 1st order ODE of high degree, 1st attempt

trying 1st order WeierstrassP solution for high degree ODE

trying 1st order WeierstrassPPrime solution for high degree ODE

trying 1st order JacobiSN solution for high degree ODE

trying 1st order ODE linearizable_by_differentiation

trying differential order: 1; missing variables

trying d'Alembert

<- d'Alembert successful

y(x) = x, y(x) = x+3*ln(exp(-(1/3)*x)*c__1/(-1+exp(-(1/3)*x)*c__1))

map(X->odetest(X,ode),[sol_1]);

[0, 0]

sol_2:=dsolve(ode,[separable]);

Classification methods on request

Methods to be used are: [separable]

----------------------------

* Tackling ODE using method: separable

--- Trying classification methods ---

trying separable

<- separable successful

y(x) = -3*ln(exp(-(1/3)*x)-(1/3)*c__1)

#notice, solution does not verify.
odetest(sol_2,ode);

-3*ln(3*exp(-(1/3)*x)-c__1)-x-3*ln(exp(-(1/3)*x)/(3*exp(-(1/3)*x)-c__1))

 

 

Download why_different_method_used_august_13_2024.mw

I use a procedure called Isee  to print to screen procedures from my packages.

However if the procedure is overloaded it Isee doesn't print it. Is there a way around this.
I have inserted screen shots to show the outputs for the package.

restart

Test:=proc(a::{vector})
print(a);
end proc;

proc (a::{vector}) print(a) end proc

(1)

Test1:=overload([ proc(a::{vector})
                  option overload;
                  print(a);
                  end proc,

                  proc(a::{Matrix})
                  option overload;
                  print(a);
                  end proc
                ])

proc () option overload; [proc (a::{vector}) option overload; print(a) end proc, proc (a::{Matrix}) option overload; print(a) end proc] end proc

(2)

Isee := proc(a)
interface(verboseproc = 3);
printf("%P", eval(a));
end proc;

proc (a) interface(verboseproc = 3); printf("%P", eval(a)) end proc

(3)

Isee(Test)

proc(a::{vector})
    print(a);
end proc

 

Isee(Test1)

proc()
    option overload;
    [proc(a::{vector}) option overload; print(a); end proc,
        proc(a::{Matrix}) option overload; print(a); end proc];
end proc

 

#with(Routines);
#

#An non overloaded procedure in a package

Isee(ConicMatrix);
#

 

                                  ConicMatrix

 

#An overloaded procecure in a package

Isee(FactReduce);
#

                                  FactReduce

 
 

 

Download 2024-08-12_print_overloaded_procedure.mw

I was looking at the application center about attractors and found the Rossler attractor app that illustrates the Rossler Attractor with animations, as you can see below. But when I try to run it on my laptop  the two last plots remain empty. Why is this happening?

Rossler Flow System - Rossler Attractor

by Yufang Hao, <yhao@student.math.uwaterloo.ca>

This worksheet contains the images of the Rossler Attractor and the animations that follow the trajectory.

restart; with(DEtools): with(plots):

Warning, the name changecoords has been redefined

 

The Rossler attractor is defined by a set of three Differential equations:

x' = -(y+z)

y' = x+a*y

z' = b + x*z - c*z

where the coefficients a, b, and c are adjustable constants.

rosslerEqns := [
diff(x(t),t) = -(y(t)+z(t)),
diff(y(t),t) = x(t) + a*y(t),
diff(z(t),t) = b + x(t)*z(t) - c*z(t) ];

rosslerEqns := [diff(x(t), t) = -y(t)-z(t), diff(y(t), t) = x(t)+a*y(t), diff(z(t), t) = b+x(t)*z(t)-c*z(t)]

(1)

a:=0.17: b:=0.4: c:=8.5:
DEplot3d(rosslerEqns, {x(t),y(t),z(t)}, t=0..300,
         [[x(0)=0, y(0)=0, z(0)=0]],
         x =-15..15, y=-15..15,z=-5..25,
         stepsize=0.05, linecolour=1+sin(t*Pi/3)/2,
         thickness=1, orientation = [-110,71]);

 

a:=0.17: b:=0.4: c:=8.5:
display(
  [seq(
    DEplot3d(rosslerEqns, {x(t),y(t),z(t)}, t=0..4*i,
         [[x(0)=0, y(0)=0, z(0)=0]],
         x =-15..15, y=-15..15,z=-5..25,
         stepsize=0.05, linecolour=1+sin((i-t)*Pi/5)/2,
         thickness=2, orientation = [-110,71]),
    i=1..25) # end seq
  ], # end DEplot3d list
insequence=true);

 

a:=0.17: b:=0.4: c:=8.5:
display(
  [seq(
    DEplot3d(rosslerEqns, {x(t),y(t),z(t)}, t=0..4*i,
         [[x(0)=0, y(0)=0, z(0)=0]],
         x =-15..15, y=-15..15,z=-5..25,
         stepsize=0.05, linecolour=1+sin((i-t)*Pi/5)/2,
         thickness=2, orientation = [-110,71]),
    i=1..25) # end seq
  ], # end DEplot3d list
insequence=true);

 

 

 

 


 

Download rossler_attractor.mws

Good morning, please help me with 2 questions I have:

1) Maple gives me the result in radians and I want it in degrees, example:

evalf(17*sin(34)/sin(115)) = 9.513506993

The result in degrees should be 10.48901874

2) How do I transform degrees into degrees, minutes and seconds?

Example: 15.925º

= 15º 55' 30''

when i do the convert in maple to latex  is do but not fully simplify and some kind of clearer must write for paper and i must do this case by case by hand but how i can simplify before i convert to latex and remove all extra thing like multiply between two squar root


 

restart

K := [A[1] = 0, A[0] = 0, B[1] = `&-+`(sqrt(2)*sqrt(a[5])/sqrt(a[4])), k = k, a[2] = -a[5], w = -2*a[5]*a[3]*(4*k^2-1)/(3*a[4]), a[1] = 8*a[5]*a[3]/(3*a[4]), v = 2*a[1]*k]

[A[1] = 0, A[0] = 0, B[1] = `&-+`(2^(1/2)*a[5]^(1/2)/a[4]^(1/2)), k = k, a[2] = -a[5], w = -(2/3)*a[5]*a[3]*(4*k^2-1)/a[4], a[1] = (8/3)*a[5]*a[3]/a[4], v = 2*a[1]*k]

(1)

latex(K)

\left[A_{1} = 0, A_{0} = 0, B_{1} =
\mp \frac{\sqrt{2}\, \sqrt{a_{5}}}{\sqrt{a_{4}}}, k = k, a_{2} =
-a_{5}, w = -\frac{2 a_{5} a_{3} \left(4 k^{2}-1\right)}{3 a_{4}},
a_{1} = \frac{8 a_{5} a_{3}}{3 a_{4}}, v = 2 a_{1} k\right]

 

NULL


 

Download K.mw

In this post about a vibrating T-shaped structure, the ends of the T are traced over time.
The trace of the end encircled below in yellow fades with time

How to do the same with Maple? For example, can an attractor be animated this way?

restart;
_local(D, O);
with(Student:-MultivariateCalculus);
A := [0, 0, 0];
B := [a, 0, 0];
C := [a, b, 0];
D := [0, b, 0];
S := [0, 0, h];
O := [x, y, z];
lineSC := Line(S, C);
lineSD := Line(S, D);
H := Projection(A, lineSC);
K := Projection(A, lineSD);
OH := H - O;
OK := K - O;
OC := C - O;
M := Matrix([OH, OK, OC]);
O := eval(O, %);
simplify(Distance(O, H));
                               O

Error, invalid input: eval received Matrix(3, 3, {(1, 1) = -x+h^2*a/(a^2+b^2+h^2), (1, 2) = -y+h^2*b/(a^2+b^2+h^2), (1, 3) = -z+h*(a^2+b^2)/(a^2+b^2+h^2), (2, 1) = -x, (2, 2) = -y+h^2*b/(b^2+h^2), (2, 3) = -z+h*b^2/(b^2+h^2), (3, 1) = -x+a, (3, 2) = -y+b, (3, 3) = -z}), which is not valid for its 2nd argument, eqns
How to correct this error ? Thank you.

i am writing code for an iterative process at the end i want to evaluate the summation expression with two loops but it is not evaluating kindly help me out here automatic_differentiation.mw
 

restart

v := 1; a := 2; t := 0.1e-2; dt := 0.1e-3; N := 40; h := 1/40; K := 4

NULL

NULL

for i from 0 to N do x[i] := i*h end do

x[5]

1/8

(1)

initial_condition := []; for i to N do initial_condition := [op(initial_condition), evalf(2*v*Pi*sin(Pi*x[i])/(a+cos(Pi*x[i])))] end do

u := proc (i) local u_x, u_xx, expr, j; u_x := (1/2)*(u[i+1]-u[i-1])/h; u_xx := (u[i-1]-2*u[i]+u[i+1])/h^2; expr := -alpha*u[i]*u_x+v*u_xx; expr end proc
NULL

NULL

odes := [seq(u(i, [seq(u[j], j = 1 .. N-1)]), i = 1 .. N-1)]

for i to N-1 do assign(o[i] = odes[i]) end do

for i to N-1 do printf("u_%d = %s\n", i, convert(u(i), string)) end do

u_1 = -alpha*u[1]*(20*u[2]-20*u[0])+1600*u[0]-3200*u[1]+1600*u[2]
u_2 = -alpha*u[2]*(20*u[3]-20*u[1])+1600*u[1]-3200*u[2]+1600*u[3]
u_3 = -alpha*u[3]*(20*u[4]-20*u[2])+1600*u[2]-3200*u[3]+1600*u[4]
u_4 = -alpha*u[4]*(20*u[5]-20*u[3])+1600*u[3]-3200*u[4]+1600*u[5]
u_5 = -alpha*u[5]*(20*u[6]-20*u[4])+1600*u[4]-3200*u[5]+1600*u[6]
u_6 = -alpha*u[6]*(20*u[7]-20*u[5])+1600*u[5]-3200*u[6]+1600*u[7]
u_7 = -alpha*u[7]*(20*u[8]-20*u[6])+1600*u[6]-3200*u[7]+1600*u[8]
u_8 = -alpha*u[8]*(20*u[9]-20*u[7])+1600*u[7]-3200*u[8]+1600*u[9]
u_9 = -alpha*u[9]*(20*u[10]-20*u[8])+1600*u[8]-3200*u[9]+1600*u[10]
u_10 = -alpha*u[10]*(20*u[11]-20*u[9])+1600*u[9]-3200*u[10]+1600*u[11]
u_11 = -alpha*u[11]*(20*u[12]-20*u[10])+1600*u[10]-3200*u[11]+1600*u[12]
u_12 = -alpha*u[12]*(20*u[13]-20*u[11])+1600*u[11]-3200*u[12]+1600*u[13]
u_13 = -alpha*u[13]*(20*u[14]-20*u[12])+1600*u[12]-3200*u[13]+1600*u[14]
u_14 = -alpha*u[14]*(20*u[15]-20*u[13])+1600*u[13]-3200*u[14]+1600*u[15]
u_15 = -alpha*u[15]*(20*u[16]-20*u[14])+1600*u[14]-3200*u[15]+1600*u[16]
u_16 = -alpha*u[16]*(20*u[17]-20*u[15])+1600*u[15]-3200*u[16]+1600*u[17]
u_17 = -alpha*u[17]*(20*u[18]-20*u[16])+1600*u[16]-3200*u[17]+1600*u[18]
u_18 = -alpha*u[18]*(20*u[19]-20*u[17])+1600*u[17]-3200*u[18]+1600*u[19]
u_19 = -alpha*u[19]*(20*u[20]-20*u[18])+1600*u[18]-3200*u[19]+1600*u[20]
u_20 = -alpha*u[20]*(20*u[21]-20*u[19])+1600*u[19]-3200*u[20]+1600*u[21]
u_21 = -alpha*u[21]*(20*u[22]-20*u[20])+1600*u[20]-3200*u[21]+1600*u[22]
u_22 = -alpha*u[22]*(20*u[23]-20*u[21])+1600*u[21]-3200*u[22]+1600*u[23]
u_23 = -alpha*u[23]*(20*u[24]-20*u[22])+1600*u[22]-3200*u[23]+1600*u[24]
u_24 = -alpha*u[24]*(20*u[25]-20*u[23])+1600*u[23]-3200*u[24]+1600*u[25]
u_25 = -alpha*u[25]*(20*u[26]-20*u[24])+1600*u[24]-3200*u[25]+1600*u[26]
u_26 = -alpha*u[26]*(20*u[27]-20*u[25])+1600*u[25]-3200*u[26]+1600*u[27]
u_27 = -alpha*u[27]*(20*u[28]-20*u[26])+1600*u[26]-3200*u[27]+1600*u[28]
u_28 = -alpha*u[28]*(20*u[29]-20*u[27])+1600*u[27]-3200*u[28]+1600*u[29]
u_29 = -alpha*u[29]*(20*u[30]-20*u[28])+1600*u[28]-3200*u[29]+1600*u[30]
u_30 = -alpha*u[30]*(20*u[31]-20*u[29])+1600*u[29]-3200*u[30]+1600*u[31]
u_31 = -alpha*u[31]*(20*u[32]-20*u[30])+1600*u[30]-3200*u[31]+1600*u[32]
u_32 = -alpha*u[32]*(20*u[33]-20*u[31])+1600*u[31]-3200*u[32]+1600*u[33]
u_33 = -alpha*u[33]*(20*u[34]-20*u[32])+1600*u[32]-3200*u[33]+1600*u[34]
u_34 = -alpha*u[34]*(20*u[35]-20*u[33])+1600*u[33]-3200*u[34]+1600*u[35]
u_35 = -alpha*u[35]*(20*u[36]-20*u[34])+1600*u[34]-3200*u[35]+1600*u[36]
u_36 = -alpha*u[36]*(20*u[37]-20*u[35])+1600*u[35]-3200*u[36]+1600*u[37]
u_37 = -alpha*u[37]*(20*u[38]-20*u[36])+1600*u[36]-3200*u[37]+1600*u[38]
u_38 = -alpha*u[38]*(20*u[39]-20*u[37])+1600*u[37]-3200*u[38]+1600*u[39]
u_39 = -alpha*u[39]*(20*u[40]-20*u[38])+1600*u[38]-3200*u[39]+1600*u[40]

 

initial_conditions := [.1644933719, .3289856976, .4934717144, .6579375992, .8223563570, .9866828090, 1.150848028, 1.314753051, 1.478261707, 1.641192349, 1.803308276, 1.964306617, 2.123805434, 2.281328760, 2.436289364, 2.587968970, 2.735495794, 2.877819368, 3.013682762, 3.141592654, 3.259788188, 3.366210070, 3.458472370, 3.533840560, 3.589220824, 3.621167336, 3.625916040, 3.599455182, 3.537643690, 3.436388151, 3.291886154, 3.100937330, 2.861312732, 2.572157998, 2.234388242, 1.851015873, 1.427342882, .9709526944, .4914580366, 0.]; u := table(); for i to N do u[i] := initial_conditions[i] end do

.1644933719

 

.3289856976

 

.4934717144

 

.6579375992

 

.8223563570

 

.9866828090

 

1.150848028

 

1.314753051

 

1.478261707

 

1.641192349

 

1.803308276

 

1.964306617

 

2.123805434

 

2.281328760

 

2.436289364

 

2.587968970

 

2.735495794

 

2.877819368

 

3.013682762

 

3.141592654

 

3.259788188

 

3.366210070

 

3.458472370

 

3.533840560

 

3.589220824

 

3.621167336

 

3.625916040

 

3.599455182

 

3.537643690

 

3.436388151

 

3.291886154

 

3.100937330

 

2.861312732

 

2.572157998

 

2.234388242

 

1.851015873

 

1.427342882

 

.9709526944

 

.4914580366

 

0.

(2)

for i from 2 to N-1 do T1[i] := (u[i+1]-u[i-1])/(2*h); T2[i] := u[i]*T1[i]; T3[i] := (u[i-1]-2*u[i]+u[i+1])/h^2; uN[i][1] := v*T3[i]-T2[i] end do

6.579566850

 

2.164583390

 

-0.100942400e-1

 

-2.174677630

 

6.579038030

 

3.246569176

 

-0.322112000e-1

 

-3.278780376

 

6.577692850

 

4.327711442

 

-0.754025600e-1

 

-4.403114002

 

6.574904195

 

5.406914261

 

-.1476892800

 

-5.554603541

 

6.569833420

 

6.482341694

 

-.257972800

 

-6.740314494

 

6.561404840

 

7.551179821

 

-.416313600

 

-7.967493421

 

6.548273580

 

8.609362668

 

-.634187200

 

-9.243549868

 

6.528785960

 

9.651254278

 

-.924822400

 

-10.57607668

 

6.500931380

 

10.66927884

 

-1.303544000

 

-11.97282284

 

6.462285360

 

11.65349267

 

-1.788137600

 

-13.44163027

 

6.409943160

 

12.59109376

 

-2.399238400

 

-14.99033216

 

6.340442860

 

13.46586700

 

-3.160785600

 

-16.62665260

 

6.249678600

 

14.25757153

 

-4.100355200

 

-18.35792673

 

6.132804200

 

14.94128564

 

-5.249596800

 

-20.19088244

 

5.984128600

 

15.48673913

 

-6.644451200

 

-22.13119033

 

5.797007960

 

15.85769089

 

-8.325200000

 

-24.18289089

 

5.563739360

 

16.01143689

 

-10.33628800

 

-26.34772489

 

5.275465720

 

15.89858010

 

-12.72560320

 

-28.62418330

 

4.922108520

 

15.46325997

 

-15.54297280

 

-31.00623277

 

4.492348320

 

14.64410399

 

-18.83784320

 

-33.48194719

 

3.973683640

 

13.37625388

 

-22.65533120

 

-36.03158508

 

3.352609800

 

11.59490836

 

-27.03057600

 

-38.62548436

 

2.614969080

 

9.240883798

 

-31.98068160

 

-41.22156540

 

1.746535520

 

6.268701658

 

-37.49400320

 

-43.76270486

 

.7339043200

 

2.657590351

 

-43.51649280

 

-46.17408315

 

-.4342430800

 

-1.574528949

 

-49.93529920

 

-48.36077025

 

-1.765447000

 

-6.354647353

 

-56.56101440

 

-50.20636705

 

-3.261340620

 

-11.53746107

 

-63.11047520

 

-51.57301413

 

-4.915150720

 

-16.89036569

 

-69.19433280

 

-52.30396711

 

-6.709016420

 

-22.08531826

 

-74.31492320

 

-52.22960494

 

-8.611468440

 

-26.70362395

 

-77.88123840

 

-51.17761445

 

-10.57558664

 

-30.26006070

 

-79.24821760

 

-48.98815690

 

-12.53848980

 

-32.25097682

 

-77.78403520

 

-45.53305838

 

-14.42284250

 

-32.22622970

 

-72.96418080

 

-40.73795110

 

-16.14090720

 

-29.87707543

 

-64.48099520

 

-34.60391977

 

-17.60126357

 

-25.12303827

 

-52.34751456

 

-27.22447629

 

-18.71769691

 

-18.17399825

 

-36.96715264

 

-18.79315439

 

-19.41905389

 

-9.543650097

 

-19.14140608

 

-9.597755983

(3)

for i from 3 to N do for k to 4 do T1[i][k] := (uN[i+1][k]-uN[i-1][k])/(2*h); T2[i][k] := 0; for j from 0 to k do T2[i][k] := T1[i][k-j]*uN[i][j]+T2[i][k] end do; T3[i][k] := (uN[i-1][k]-2*uN[i][k]+uN[i+1][k])/h^2; uN[i][k+1] := (-T2[i][k]+T3[i][k])/(k+1) end do end do

NULL

NULL

NULL

NULL

NULL

NULL

NULL

"for i from1 to N do          for j  from 1 to 10  do      uNew[i]:=sum(uN[i][k] *( j*dt)^(k), k=0..K);      end do;      end do;"

Error, controlling variable of for loop must be a name or sequence of 2 names

"for i from1 to N do         for j  from 1 to 10  do  uNew[i]:=sum(uN[i][k] * j*dt, k=0..K);      end do;    end do;"

 

NULL

NULL

NULL

NULL

NULL

NULL

NULL


 

Download automatic_differentiation.mw

 

How to get Li(x) to display as result of int(1/ln(x),x) in Maple instead of -Ei(1,-ln(x))

I'd like to match result of Maple with another software I use and it is also simpler to look at

int(1/ln(x),x)

Now gives

             -Ei(1,-ln(x))

How to make it show  Li(x) instead?

The Maple help page for Li is this

And the other software Li help page is this