Maple 2016 Questions and Posts

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

How can these eight equations q[0]...q[7] be solved for the eight unknowns a1[0]...a1[7] and with the lowest CPU time

11.mw

Good day everyone,

I am trying to rotate the plots of pde solution using transplot, but it is giving me errors. Anyone with better suggestions should help. The code is attached below. Thanks

Transplot_not_working.mw

I want to use union, intersection and minus to find. Help me

What is the best and accurate way to export a large symbolic matrix (200*300) from Maple to Matlab? The Marix have a lot of variables, symbols and operators such as diiff, int, ....

Here is a simple example:

NULL

restart

NULL

A := Matrix(2, 6, {(1, 1) = x*y*z, (1, 2) = (1/2)*tau[2], (1, 3) = sin(x*y*z), (1, 4) = ln(x*y*z), (1, 5) = tau[1]*exp(x*y*z), (1, 6) = sin(x+y)+cos(x+y), (2, 1) = x^2+1, (2, 2) = x^2+1/sin(x*y*z), (2, 3) = 2*exp(y), (2, 4) = tau[1], (2, 5) = diff(f(x, y, z), x), (2, 6) = int(f(x, y, z), x)})

A := 1/sin(protected)

(1)

``

CodeGeneration[Matlab](codegen[makeproc](A, [x, y, tau[1], tau[2]]))

Error, (in codegen/makeproc) optional arguments must be equations [x, y, tau[1], tau[2]]

 

``

``

``

``

``

``

Download export.mw

Where is the problem within this procedure which I can not get the numerical values of V[1] , V[2], ...

restart

A := Matrix([[2*t, 2, 3], [4, 5*t, 6], [7, 8*t, 9]])

A := Matrix(3, 3, {(1, 1) = 2*t, (1, 2) = 2, (1, 3) = 3, (2, 1) = 4, (2, 2) = 5*t, (2, 3) = 6, (3, 1) = 7, (3, 2) = 8*t, (3, 3) = 9})

(1)

B := LinearAlgebra:-Transpose(Matrix([t, 2*t, 3*t]))

B := Matrix(3, 1, {(1, 1) = t, (2, 1) = 2*t, (3, 1) = 3*t})

(2)

``

test:=proc(n)
  local s,t,M,V;
  s:=1:
  for t from 1 to n do
    M:=A+A^(-1);
    V[s]:=(M.B):
    s:=s+1:
  end do;
  V;
end proc:

``

test(4)

V

(3)

V[1]

V[1]

(4)

``

``

Download ProcPropl.mw

In part of my program, I have a loop that the iterative calculations are performed there. During running the program when it comes to the loop the memory usage become full in a short period of time and I face the memory shortage. Since my program is so long and huge, I only can show the loop part of it here, you may look at where is the problem of high memory usage in loop and how to deal with it. Any comment will be appreciated.

I again note that, this segment can not be run independently since it is a part of big program. I put it just to see and mmake comment if any.

M := 3; Nm := 1

w0 := Matrix(M+Nm, 1)

wd0 := Matrix(M+Nm, 1)

taim := 1

F0 := convert([seq(Quadrature(Quadrature(simplify(add(add(W[i, j, 4, r]*LegendreP(i, 1)*LegendreP(j, 0), i = 0 .. II), j = 0 .. JJ)), `ζ__1` = -1 .. 1, method = romberg[3]), `η__1` = -1 .. 1, method = romberg[3]), r = 1 .. M), seq(0, n = 1 .. Nm)], Matrix)

T := 1/(2*Pi*`ω__km`[M][2])

dt := (1/10)*T

0.1123479896110e-4

(1)

for i to M do tau[i](t) := tau[i] end do

for i to Nm do p[i](t) := p[i] end do

`α__N` := .5; `β__N` := .25; a__0 := 1/(`β__N`*dt^2); a__1 := `α__N`/(`β__N`*dt); a__2 := 1/(`β__N`*dt); a__3 := 1/(2*`β__N`)-1; a__4 := `α__N`/`β__N`-1; a__5 := dt*(`α__N`/(2*`β__N`)-1); a__6 := dt*(1-`α__N`); a__7 := `α__N`*dt

q := Matrix(1 .. M+Nm, 1 .. floor(taim/dt)+1)

dq := Matrix(1 .. M+Nm, 1 .. floor(taim/dt)+1)

ddq := Matrix(1 .. M+Nm, 1 .. floor(taim/dt)+1)

q(1 .. M+Nm, 1) := w0

dq(1 .. M+Nm, 1) := wd0

for i to M do tau[i] := q(i, 1) end do

for i to Nm do p[i] := q(M+i, 1) end do

ddq(1 .. M+Nm, 1) := 1/ML.(diff((diff(sin(`ω__b`*t__0), t__0))*LinearAlgebra:-Transpose(F0), t__0)-CL.dq(1 .. M+Nm, 1 .. 1)-KL.q(1 .. M+Nm, 1 .. 1)-eqMNL)

t__0 := dt

V := LinearAlgebra:-Transpose(convert([seq(Tau[i], i = 1 .. M), seq(P[i], i = 1 .. Nm)], Matrix))

Qn__2 := LinearAlgebra:-Transpose(Matrix(1, M+Nm))

Qn__3 := LinearAlgebra:-Transpose(Matrix(1, M+Nm))

External force

 

`ω__b` := 25

``

F := diff((diff(sin(`ω__b`*t), t))*LinearAlgebra:-Transpose(convert(F0, Matrix)), t)

``

s := 1

k__d := 100000

with(Student[NumericalAnalysis]); dt

``

Loop

 

for t from t__0 by dt to taim do EQ := KL.V+a__0*ML.V+a__1*CL.V-ML.(a__0*q(1 .. M+Nm, s .. s)+a__2*dq(1 .. M+Nm, s .. s)+a__3*ddq(1 .. M+Nm, s .. s))-CL.(a__1*q(1 .. M+Nm, s .. s)+a__4*dq(1 .. M+Nm, s .. s)+a__5*ddq(1 .. M+Nm, s .. s))-F-Qn__2-Qn__3; G := Matrix(M+Nm, proc (i, j) options operator, arrow; (diff(EQ[i], V[j, 1]))[1] end proc); G1 := 1/G; if t = t__0 then X[1] := 1/(CL*a__1+ML*a__0+KL).(F+ML.(a__0*q(1 .. M+Nm, s .. s)+a__2*dq(1 .. M+Nm, s .. s)+a__3*ddq(1 .. M+Nm, s .. s))+CL.(a__1*q(1 .. M+Nm, s .. s)+a__4*dq(1 .. M+Nm, s .. s)+a__5*ddq(1 .. M+Nm, s .. s))) else X[1] := q(1 .. M+Nm, s .. s) end if; for k to 11 do X[k+1] := eval(V-G1.EQ, Equate(V, X[k])) end do; q(1 .. M+Nm, s+1 .. s+1) := X[k]; ddq(1 .. M+Nm, s+1 .. s+1) := a__0*(q(1 .. M+Nm, s+1 .. s+1)-q(1 .. M+Nm, s .. s))-a__2*dq(1 .. M+Nm, s .. s)-a__3*ddq(1 .. M+Nm, s .. s); dq(1 .. M+Nm, s+1 .. s+1) := dq(1 .. M+Nm, s .. s)+a__6*ddq(1 .. M+Nm, s .. s)+a__7*ddq(1 .. M+Nm, s+1 .. s+1); Wxy2 := add(add(add(h*W[i, j, 2, o]*LegendreP(i, `&zeta;__2`)*LegendreP(j, `&eta;__2`)*q[o, s+1], i = 0 .. II), j = 0 .. JJ), o = 1 .. M); Wxy3 := add(add(add(h*W[i, j, 3, o]*LegendreP(i, `&zeta;__2`)*LegendreP(j, `&eta;__2`)*q[o, s+1], i = 0 .. II), j = 0 .. JJ), o = 1 .. M); Plt := plots:-implicitplot(Wxy2-Wxy3, `&zeta;__2` = -1 .. 1, `&eta;__2` = -1 .. 1, color = red, thickness = 2, gridrefine = 3); j := 111111; Hvs2 := 1; for i while i <= j do Pnt[i] := op([1, i], Plt); if Wxy2-Wxy3 = 0 then j := 0 elif convert(Pnt[i], string)[1] = "C" then j := 0 else a__e[i] := (1/2)*abs(max(Column(Pnt[i], 1))-min(Column(Pnt[i], 1))); if a__e[i] = 0 then a__e[i] = 0.1e-5 end if; b__e[i] := (1/2)*abs(max(Column(Pnt[i], 2))-min(Column(Pnt[i], 2))); if b__e[i] = 0 then b__e[i] = 0.1e-5 end if; xc[i] := (max(Column(Pnt[i], 1))+min(Column(Pnt[i], 1)))*(1/2); yc[i] := (max(Column(Pnt[i], 2))+min(Column(Pnt[i], 2)))*(1/2); Hv2[i] := ((`&zeta;__2`-xc[i])/a__e[i])^2+((`&eta;__2`-yc[i])/b__e[i])^2-1; Hvs2 := Hv2[i]*Hvs2 end if end do; Qn__2 := LinearAlgebra:-Transpose(convert([(1/2)*k__d*Grid:-Seq(Quadrature(Quadrature(Heaviside(-Hvs2)*abs(Wxy2-Wxy3)*add(add(W[i, j, 2, r]*LegendreP(i, `&zeta;__2`)*LegendreP(j, `&eta;__2`), i = 0 .. II), j = 0 .. JJ), `&zeta;__2` = -1 .. 1, method = romberg[5]), `&eta;__2` = -1 .. 1, method = romberg[5]), r = 1 .. M), seq(0, n = 1 .. Nm)], Matrix)); Qn__3 := -Qn__2; s := s+1 end do

``

Download HighMemUseProb.mw

Good day everyone, 

Can I plot the graph of the sheet attached below such that x will be on the vertical component and y will be on the horizontal component? Can this be done on Maple? Anyone with useful information should please help.

plot_graph.mw

I am trying to do the following computation. I  extracted n*1 matrix from n*n matrix which unbelievably gives vector?

How I can do the following multiplication without using convert command? Or how to extract n*1 matrix (not vector) from n*n matrix without using convert?

``

restart

``

``

A := Matrix(4, 4, {(1, 1) = m[1, 1], (1, 2) = m[1, 2], (1, 3) = m[1, 3], (1, 4) = m[1, 4], (2, 1) = m[2, 1], (2, 2) = m[2, 2], (2, 3) = m[2, 3], (2, 4) = m[2, 4], (3, 1) = m[3, 1], (3, 2) = m[3, 2], (3, 3) = m[3, 3], (3, 4) = m[3, 4], (4, 1) = m[4, 1], (4, 2) = m[4, 2], (4, 3) = m[4, 3], (4, 4) = m[4, 4]})

A := Matrix(4, 4, {(1, 1) = 0, (1, 2) = m[1, 2], (1, 3) = m[1, 3], (1, 4) = m[1, 4], (2, 1) = 0, (2, 2) = m[2, 2], (2, 3) = m[2, 3], (2, 4) = m[2, 4], (3, 1) = 0, (3, 2) = m[3, 2], (3, 3) = m[3, 3], (3, 4) = m[3, 4], (4, 1) = 0, (4, 2) = m[4, 2], (4, 3) = m[4, 3], (4, 4) = m[4, 4]})

(1)

A(1 .. 4, 1) := Matrix(4, 1):

A

Matrix([[0, m[1, 2], m[1, 3], m[1, 4]], [0, m[2, 2], m[2, 3], m[2, 4]], [0, m[3, 2], m[3, 3], m[3, 4]], [0, m[4, 2], m[4, 3], m[4, 4]]])

(2)

B := A(1 .. 4, 2)

B := Vector(4, {(1) = m[1, 2], (2) = m[2, 2], (3) = m[3, 2], (4) = m[4, 2]})

(3)

A.B

4

(4)

F := Matrix(4, 1, {(1, 1) = 0.4279668887e-7, (2, 1) = -0.3901148183e-7, (3, 1) = 0.3900685346e-7, (4, 1) = 0.})

Typesetting:-delayDotProduct(A, B)-F

Error, (in rtable/Sum) invalid input: dimensions do not match: Vector[column](1 .. 4) cannot be added to Matrix(1 .. 4, 1 .. 1)

 

A.convert(B, Matrix)-F

Matrix(4, 1, {(1, 1) = m[1, 2]*m[2, 2]+m[1, 3]*m[3, 2]+m[1, 4]*m[4, 2]-0.4279668887e-7, (2, 1) = m[2, 2]^2+m[2, 3]*m[3, 2]+m[2, 4]*m[4, 2]+0.3901148183e-7, (3, 1) = m[3, 2]*m[2, 2]+m[3, 3]*m[3, 2]+m[3, 4]*m[4, 2]-0.3900685346e-7, (4, 1) = m[2, 2]*m[4, 2]+m[3, 2]*m[4, 3]+m[4, 2]*m[4, 4]})

(5)

``

Download soalzarb.mw

If i have p := 8*T(x, 7)*T(x, 2)+4*T(x, 5)*T(x, 1)+6*T(x, 3)*T(x, 3)+7*T(x, 1)*T(x, 4)

 I want to convert the the multiplication functions like T(x, 7)*T(x, 2) into summation T(x, 7)+T(x, 2)

I want to plot a number created in a loop to monitor how it varies while keeping all previous ones on the figure. This is simply done in Matlab by hold on command, but I dont know how it is possible in Maple?

for i to 22 do
plot([i], [i^.5], style = point) :
end do

Note I want to monitor points during the loop running not after it finishes.

I am trying to find a fast method for integration of a function composed of several Heavisides. I used Quadrature-Romberg, but no success. What is the problem with it and what method do you recommend instead?

``

restart

``

A := Heaviside(zeta__2-.6429162216568)*Heaviside(eta__2+.5050000000000-10.98537767108*sqrt(492.5151416233-zeta__2^2))+Heaviside(zeta__2-.9999999999936)*Heaviside(eta__2+.9875792458758+3.881485663812*10^9*sqrt(9.765625000000*10^22-zeta__2^2))+Heaviside(zeta__2+1.000000000000)*Heaviside(eta__2-.4637698986762+2.327456686822*10^11*sqrt(2.777777777778*10^24-zeta__2^2))-Heaviside(zeta__2+1.000000000000)*Heaviside(eta__2-.4637698986762-2.327456686822*10^11*sqrt(2.777777777778*10^24-zeta__2^2))+Heaviside(zeta__2+1.000000000000)*Heaviside(eta__2+.1619291800251+3.018371923484*10^11*sqrt(4.000000000000*10^24-zeta__2^2))-Heaviside(zeta__2+1.000000000000)*Heaviside(eta__2+.1619291800251-3.018371923484*10^11*sqrt(4.000000000000*10^24-zeta__2^2))+Heaviside(zeta__2+1.000000000000)*Heaviside(eta__2+.7243706106403+1.382194833711*10^11*sqrt(1.562500000000*10^24-zeta__2^2))-Heaviside(zeta__2+1.000000000000)*Heaviside(eta__2+.7243706106403-1.382194833711*10^11*sqrt(1.562500000000*10^24-zeta__2^2))+Heaviside(zeta__2-1.000000000000)*Heaviside(eta__2+.9875792458758-3.881485663812*10^9*sqrt(9.765625000000*10^22-zeta__2^2))-Heaviside(zeta__2-1.000000000000)*Heaviside(eta__2+.9875792458758+3.881485663812*10^9*sqrt(9.765625000000*10^22-zeta__2^2))+Heaviside(zeta__2-1.000000000000)*Heaviside(eta__2-.8341191288491-1.298592148442*10^10*sqrt(9.706617486471*10^21-zeta__2^2))-Heaviside(zeta__2-1.000000000000)*Heaviside(eta__2-.8341191288491+1.298592148442*10^10*sqrt(9.706617486471*10^21-zeta__2^2))-Heaviside(zeta__2-.9999999999796)*Heaviside(eta__2-.8341191288491-1.298592148442*10^10*sqrt(9.706617486471*10^21-zeta__2^2))-Heaviside(zeta__2-.5527964251744)*Heaviside(eta__2+.5050000000000-10.98537767108*sqrt(492.5151416233-zeta__2^2))+Heaviside(zeta__2-.5527964251744)*Heaviside(eta__2+.5050000000000+10.98537767108*sqrt(492.5151416233-zeta__2^2))+Heaviside(zeta__2-.7684252323012)*Heaviside(eta__2-.5050000000000-8.127372424924*sqrt(269.5813999936-zeta__2^2))-Heaviside(zeta__2-.6466146460206)*Heaviside(eta__2-.5050000000000-8.127372424924*sqrt(269.5813999936-zeta__2^2))-Heaviside(zeta__2-.7684252323012)*Heaviside(eta__2-.5050000000000+8.127372424924*sqrt(269.5813999936-zeta__2^2))+Heaviside(zeta__2-.6466146460206)*Heaviside(eta__2-.5050000000000+8.127372424924*sqrt(269.5813999936-zeta__2^2))-Heaviside(zeta__2-.9999999999936)*Heaviside(eta__2+.9875792458758-3.881485663812*10^9*sqrt(9.765625000000*10^22-zeta__2^2))+Heaviside(zeta__2-.9999999999796)*Heaviside(eta__2-.8341191288491+1.298592148442*10^10*sqrt(9.706617486471*10^21-zeta__2^2))+Heaviside(zeta__2+.9999999999972)*Heaviside(eta__2+.9842650870048-1.085166413462*10^10*sqrt(4.756242568371*10^23-zeta__2^2))-Heaviside(zeta__2+.9999999999972)*Heaviside(eta__2+.9842650870048+1.085166413462*10^10*sqrt(4.756242568371*10^23-zeta__2^2))+Heaviside(zeta__2+.9999999999990)*Heaviside(eta__2+.1619291800251-3.018371923484*10^11*sqrt(4.000000000000*10^24-zeta__2^2))-Heaviside(zeta__2+.9999999999990)*Heaviside(eta__2+.1619291800251+3.018371923484*10^11*sqrt(4.000000000000*10^24-zeta__2^2))+Heaviside(zeta__2+.9999999999988)*Heaviside(eta__2-.4637698986762-2.327456686822*10^11*sqrt(2.777777777778*10^24-zeta__2^2))-Heaviside(zeta__2+.9999999999988)*Heaviside(eta__2-.4637698986762+2.327456686822*10^11*sqrt(2.777777777778*10^24-zeta__2^2))+Heaviside(zeta__2+.9999999999984)*Heaviside(eta__2+.7243706106403-1.382194833711*10^11*sqrt(1.562500000000*10^24-zeta__2^2))-Heaviside(zeta__2+.9999999999984)*Heaviside(eta__2+.7243706106403+1.382194833711*10^11*sqrt(1.562500000000*10^24-zeta__2^2))+Heaviside(zeta__2+.9999999999984)*Heaviside(eta__2-.9031048925918-8.123652892875*10^10*sqrt(1.562500000000*10^24-zeta__2^2))-Heaviside(zeta__2+.9999999999984)*Heaviside(eta__2-.9031048925918+8.123652892875*10^10*sqrt(1.562500000000*10^24-zeta__2^2))-Heaviside(zeta__2+1.000000000000)*Heaviside(eta__2+.9842650870048-1.085166413462*10^10*sqrt(4.756242568371*10^23-zeta__2^2))+Heaviside(zeta__2+1.000000000000)*Heaviside(eta__2+.9842650870048+1.085166413462*10^10*sqrt(4.756242568371*10^23-zeta__2^2))-Heaviside(zeta__2-.6429162216568)*Heaviside(eta__2+.5050000000000+10.98537767108*sqrt(492.5151416233-zeta__2^2))-Heaviside(zeta__2+1.000000000000)*Heaviside(eta__2-.9031048925918-8.123652892875*10^10*sqrt(1.562500000000*10^24-zeta__2^2))+Heaviside(zeta__2+1.000000000000)*Heaviside(eta__2-.9031048925918+8.123652892875*10^10*sqrt(1.562500000000*10^24-zeta__2^2)):

plot3d(A, zeta__2 = -1 .. 1, eta__2 = -1 .. 1, color = green)

 

Digits := 22:

with(Student[NumericalAnalysis]):

Quadrature(Quadrature(A, zeta__2 = -1 .. 1, method = romberg[8]), eta__4 = -1 .. 1, method = romberg[8])

Float(undefined)*Heaviside(eta__2+1212964270000000000001.)+Float(undefined)*Heaviside(eta__2-1279401131003415700657.)-0.1513022270849353690226e-1*Heaviside(eta__2-133.8411610374164929382)+Float(undefined)*Heaviside(eta__2-7483906296259851792359.)+Float(undefined)*Heaviside(eta__2+7483906296259851792361.)+Float(undefined)*Heaviside(eta__2-0.1015456611625000000000e24)+Float(undefined)*Heaviside(eta__2+0.1015456611625000000000e24)+Float(undefined)*Heaviside(eta__2+0.3879094478488497112464e24)+Float(undefined)*Heaviside(eta__2+1279401131003415700655.)-0.4538512794872905686682e-1*Heaviside(eta__2-133.8360207224718595497)+0.4538512794872905686682e-1*Heaviside(eta__2+132.8260207224718595497)+0.4538512794872905686682e-1*Heaviside(eta__2+132.8042477794001150390)-0.4538512794872905686682e-1*Heaviside(eta__2-133.8253766167816064928)-0.4538512794872905686682e-1*Heaviside(eta__2-243.1883998382669648802)+0.1513022270849353690226e-1*Heaviside(eta__2+132.8311610374164929382)+Float(undefined)*Heaviside(eta__2-0.1727743542500000000000e24)-0.1513022270849353690226e-1*Heaviside(eta__2-243.2027260661341424950)+0.1513022270849353690226e-1*Heaviside(eta__2+244.2127260661341424950)+0.4538512794872905686682e-1*Heaviside(eta__2+244.1983998382669648802)-0.4538512794872905686682e-1*Heaviside(eta__2-243.1980716456433769010)+0.4538512794872905686682e-1*Heaviside(eta__2+244.2080716456433769010)+0.4538512794872905686682e-1*Heaviside(eta__2+132.8153766167816064928)+0.1513022270849353690226e-1*Heaviside(eta__2+132.8098727970154075001)+Float(undefined)*Heaviside(eta__2-0.3879094478488497112464e24)-0.4538512794872905686682e-1*Heaviside(eta__2-243.2072595071292620415)+Float(undefined)*Heaviside(eta__2+0.6036743846000000000000e24)+Float(undefined)*Heaviside(eta__2-0.6036743846000000000000e24)+Float(undefined)*Heaviside(eta__2+0.1727743542500000000000e24)-0.1916322521366165064753e-1*Heaviside(eta__2-133.8307592537082147847)+0.1916322521366165064753e-1*Heaviside(eta__2+132.8207592537082147847)-0.1916322521366165064753e-1*Heaviside(eta__2-243.2116719753798543789)+0.1916322521366165064753e-1*Heaviside(eta__2+244.2216719753798543789)-0.4538512794872905686682e-1*Heaviside(eta__2-133.8026340889186250133)+0.4538512794872905686682e-1*Heaviside(eta__2+132.7926340889186250133)-0.4538512794872905686682e-1*Heaviside(eta__2-133.8142477794001150390)-0.1513022270849353690226e-1*Heaviside(eta__2-133.8198727970154075001)+0.4538512794872905686682e-1*Heaviside(eta__2+244.2172595071292620415)-0.1903631769101229216919e-1*Heaviside(eta__2-133.8085015485931455736)+0.1903631769101229216919e-1*Heaviside(eta__2+132.7985015485931455736)+0.1903531841918040745676e-1*Heaviside(eta__2+244.2032962387251632874)-0.1903531841918040745676e-1*Heaviside(eta__2-243.1932962387251632874)+Float(undefined)*Heaviside(eta__2-1212964269999999999999.)

(1)

int(int(A, zeta__2 = -1 .. 1), eta__2 = -1 .. 1)

.4238607655960000000000

(2)

``

Download romberg.mw

I have a set of equations gathered in a vector. The number of equations varies each time. Here in this example it is 4. How you suggest so solve them with fsolve? I tried to use seq but faced error.

restart

EQ := Matrix(4, 1, {(1, 1) = 32.1640740637930*Tau[1]-0.172224519601111e-4*Tau[2]-0.270626540730518e-3*Tau[3]+0.1570620334e-9*P[1]+0.3715450960e-14*sin(t), (2, 1) = -0.172224519601111e-4*Tau[1]+32.1667045885952*Tau[2]+0.587369829416537e-4*Tau[3]-0.1589565489e-8*P[1]+0.1004220091e-12*sin(t), (3, 1) = -0.270626540730518e-3*Tau[1]+0.587369829416537e-4*Tau[2]+32.1816411689934*Tau[3]-0.7419658527e-8*P[1]+0.5201228088e-12*sin(t), (4, 1) = 0.1570620334e-9*Tau[1]-0.1589565489e-8*Tau[2]-0.7419658527e-8*Tau[3]+601.876235436204*P[1]})

V := Matrix(1, 4, {(1, 1) = Tau[1], (1, 2) = Tau[2], (1, 3) = Tau[3], (1, 4) = P[1]})

q := 0

X := Matrix(4, 1, {(1, 1) = -0.1156532164e-15*sin(t), (2, 1) = -0.3121894613e-14*sin(t), (3, 1) = -0.1616209235e-13*sin(t), (4, 1) = -0.2074537757e-24*sin(t)})

t := 1

Xf := fsolve({seq(EQ[r], r = 1 .. 4)}, {seq(V[r] = q .. X[r], r = 1 .. 4)})

Error, Matrix index out of range``

``

Download SoalNewton.mw

Why GenerateMatrix produces wrong results?

``

restart

N := 2:

a := 1:

with(ArrayTools):

``

Qa := [-0.5379667864e-1*(diff(tau[1, 1](t), t, t))+7.862351349*10^(-11)*tau[2, 1](t)-8.050993899*10^(-12)*(diff(tau[2, 1](t), t, t))+.1166068042*(diff(tau[1, 2](t), t))+2.181309895*10^(-11)*(diff(tau[2, 2](t), t))+.5309519363*tau[1, 1](t) = 0, -1.265965258*10^(-11)*(diff(tau[1, 1](t), t, t))+.4884414390*tau[2, 1](t)-0.4948946475e-1*(diff(tau[2, 1](t), t, t))+2.738892495*10^(-11)*(diff(tau[1, 2](t), t))+.1340883970*(diff(tau[2, 2](t), t))+1.246469610*10^(-10)*tau[1, 1](t) = 0, 3.649366137*10^(-10)*tau[2, 2](t)-9.135908950*10^(-12)*(diff(tau[2, 2](t), t, t))-5.160677740*10^(-11)*(diff(tau[2, 1](t), t))+1.953765755*tau[1, 2](t)-0.4948946473e-1*(diff(tau[1, 2](t), t, t))-.3476543209*(diff(tau[1, 1](t), t)) = 0, 2.246672656*tau[2, 2](t)-0.5690888318e-1*(diff(tau[2, 2](t), t, t))-.3198194887*(diff(tau[2, 1](t), t))+4.602903411*10^(-10)*tau[1, 2](t)-1.159417294*10^(-11)*(diff(tau[1, 2](t), t, t))-8.175817372*10^(-11)*(diff(tau[1, 1](t), t)) = 0]

Q1 := [seq(seq(diff(tau[i, j](t), t), i = 1 .. M), j = 1 .. N)]

[diff(tau[1, 1](t), t), diff(tau[2, 1](t), t), diff(tau[1, 2](t), t), diff(tau[2, 2](t), t)]

(1)

with(LinearAlgebra):

CR := GenerateMatrix(simplify(Qa), Q1)

CR := Matrix(4, 4, {(1, 1) = 0, (1, 2) = 0, (1, 3) = .1166068042, (1, 4) = 0.2181309895e-10, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0.2738892495e-10, (2, 4) = .1340883970, (3, 1) = -.3476543209, (3, 2) = -0.5160677740e-10, (3, 3) = 0, (3, 4) = 0, (4, 1) = -0.8175817372e-10, (4, 2) = -.3198194887, (4, 3) = 0, (4, 4) = 0}), Vector(4, {(1) = 0.5379667864e-1*(diff(diff(tau[1, 1](t), t), t))-0.7862351349e-10*tau[2, 1](t)+0.8050993899e-11*(diff(diff(tau[2, 1](t), t), t))-.5309519363*tau[1, 1](t), (2) = 0.1265965258e-10*(diff(diff(tau[1, 1](t), t), t))-.4884414390*tau[2, 1](t)+0.4948946475e-1*(diff(diff(tau[2, 1](t), t), t))-0.1246469610e-9*tau[1, 1](t), (3) = -0.3649366137e-9*tau[2, 2](t)+0.9135908950e-11*(diff(diff(tau[2, 2](t), t), t))-1.953765755*tau[1, 2](t)+0.4948946473e-1*(diff(diff(tau[1, 2](t), t), t)), (4) = -2.246672656*tau[2, 2](t)+0.5690888318e-1*(diff(diff(tau[2, 2](t), t), t))-0.4602903411e-9*tau[1, 2](t)+0.1159417294e-10*(diff(diff(tau[1, 2](t), t), t))})

(2)

``

``

``

Download GenMatrix.mw

Do you know why increasing the number of applications of trapezoidal rule results infinity and imaginary part?

I want get result for Romberg Integration Method with 6 Applications of Trapezoidal Rule.

restart

with(Student[NumericalAnalysis]):

``

fff := (eta__1^2-1.)^2*(zeta__1^2-1.)^2*(-5.6584306313*10^(-8)*eta__1^4*zeta__1^4-1.0454641424*10^(-8)*eta__1*zeta__1^4+5.6161016651*10^(-9)*eta__1^3*zeta__1^4+1.0615594865*10^(-8)*eta__1^5*zeta__1^4+5.4851856568*10^(-9)*eta__1^3*zeta__1^2-1.4132765167*10^(-8)*eta__1^5*zeta__1^2-7.8157365683*10^(-7)*zeta__1*eta__1^4+2.9373057668*10^(-8)*eta__1^5*zeta__1^5-7.032574429*10^(-8)*eta__1^3*zeta__1^5-5.2577413654*10^(-8)*eta__1^5*zeta__1^3+2.3272955826*10^(-8)*eta__1^5*zeta__1+1.5782217112*10^(-7)*eta__1^3*zeta__1^3+2.1771522925*10^(-8)*eta__1*zeta__1^5-8.3051507888*10^(-8)*eta__1^3*zeta__1-2.2997952126*10^(-8)*eta__1*zeta__1^3+0.22608138853e-5*eta__1^4-0.53519692056e-5*eta__1^2+0.62041471332e-4+0.54946587424e-4*zeta__1^2-0.10412827312e-5*zeta__1^4-0.53422910417e-5*zeta__1^3+0.12053033309e-3*zeta__1-4.5961086182*10^(-8)*eta__1^2*zeta__1^4-1.6404108106*10^(-7)*zeta__1^2*eta__1-1.5606093643*10^(-7)*zeta__1*eta__1^2-4.168658171*10^(-7)*zeta__1*eta__1-0.5430102455e-5*eta__1^2*zeta__1^5+0.87015148204e-5*eta__1^2*zeta__1^3+0.25592467903e-5*eta__1^4*zeta__1^5-0.4071733639e-5*eta__1^4*zeta__1^3-0.44664222239e-5*eta__1^4*zeta__1^2+0.84495460425e-5*eta__1^2*zeta__1^2+7.5007400675*10^(-7)*zeta__1^5-6.6427826628*10^(-9)*eta__1^3+3.5821686059*10^(-9)*eta__1^5-2.4361928132*10^(-7)*eta__1)/(-0.32350168299e-2*eta__1^5-0.40854298828e-3*zeta__1^8-0.57170204466e-1*eta__1^8+.26989142602*zeta__1^7+.34307133883*eta__1^6+.14111119517*eta__1^4-0.48267577378e-1*zeta__1^9-1.082755589*eta__1^2-1.3163499567*zeta__1^2+0.75042415188e-3*eta__1^7-0.40463518464e-2*zeta__1^6+.66506159208*zeta__1^4+.58641863992*zeta__1^3-0.18089939414e-3*eta__1^9-.60151130424*zeta__1^5+0.49423587807e-2*eta__1^3-0.22768667085e-2*eta__1-.20653118433*zeta__1-.15635457174*eta__1^8*zeta__1+.64029273264*eta__1^8*zeta__1^3-1.8403657443*eta__1^6*zeta__1^7-0.48478855017e-1*eta__1^8*zeta__1^4-0.22007436935e-2*eta__1^2*zeta__1^8+0.56271163518e-2*eta__1^4*zeta__1^8-.22701198791*eta__1^6*zeta__1^6-0.18753531811e-2*eta__1*zeta__1^9+0.63616448215e-2*eta__1^3*zeta__1^9-0.70972300998e-2*eta__1^5*zeta__1^9+0.26109384594e-2*eta__1^7*zeta__1^9+0.37597513815e-2*eta__1^9*zeta__1^7-.81152175007*eta__1^8*zeta__1^5+.32758358916*eta__1^8*zeta__1^7+.60516338422*eta__1^6*zeta__1-2.7777061884*eta__1^6*zeta__1^3+3.8764153863*eta__1^6*zeta__1^5+0.14976271107e-3*eta__1*zeta__1^8+0.64408301026e-3*eta__1^3*zeta__1^8-0.17374541537e-2*eta__1^5*zeta__1^8+0.9436084324e-3*eta__1^7*zeta__1^8-0.95617026598e-3*eta__1*zeta__1^6-0.79980551762e-3*eta__1^3*zeta__1^6-0.43427014208e-2*eta__1^7*zeta__1^6+0.52833995188e-2*eta__1^5*zeta__1^6-0.39563328597e-2*eta__1^7*zeta__1^2-0.30978282387e-2*zeta__1*eta__1+3.4563944947*eta__1^2*zeta__1^5-2.669958003*eta__1^2*zeta__1^3-5.9197768267*eta__1^4*zeta__1^5+4.2209528188*eta__1^4*zeta__1^3+.1920464905*eta__1^4*zeta__1^2+1.9334990569*eta__1^2*zeta__1^2+0.66050016962e-2*eta__1^7*zeta__1^4+.80614880365*eta__1^6*zeta__1^4-.9191903249*eta__1^6*zeta__1^2-1.724981418*zeta__1^7*eta__1^2+2.9678721471*zeta__1^7*eta__1^4-.94779423754*zeta__1*eta__1^4+.46301464814*zeta__1^6*eta__1^4-.22761063366*zeta__1^6*eta__1^2-0.85894534062e-2*eta__1^5*zeta__1^4+0.8278524871e-2*eta__1^5*zeta__1^2+0.46097207851e-2*eta__1^3*zeta__1^4-0.93963570584e-2*eta__1^3*zeta__1^2-0.81381430978e-3*eta__1*zeta__1^4-.62093209055*eta__1^2*zeta__1^4-.80179945016*eta__1^4*zeta__1^4+.70551660939*zeta__1*eta__1^2+0.38970885732e-2*zeta__1^2*eta__1+0.10746052526e-1*eta__1*zeta__1^7-0.40389225121e-1*eta__1^3*zeta__1^7+0.52300044044e-1*eta__1^5*zeta__1^7+.10999473421*eta__1^8*zeta__1^2-0.45528793761e-1*eta__1^7*zeta__1^3+0.57167454208e-1*eta__1^7*zeta__1^5+0.11770764739e-2*eta__1^9*zeta__1^2-0.18114547653e-2*eta__1^9*zeta__1^4+0.81527768559e-3*eta__1^9*zeta__1^6+0.13191002642e-1*eta__1*zeta__1^3+0.14324735033e-1*eta__1^3*zeta__1-0.18963873748e-1*eta__1*zeta__1^5-0.56315405543e-1*eta__1^3*zeta__1^3-0.21374958034e-1*eta__1^5*zeta__1+0.7601825081e-1*eta__1^3*zeta__1^5+.65574325943+0.80855499912e-1*eta__1^5*zeta__1^3-.10468335582*eta__1^5*zeta__1^5-0.26416622831e-1*eta__1^7*zeta__1^7-0.20189726843e-2*eta__1^9*zeta__1+0.77976967502e-2*eta__1^9*zeta__1^3-0.95384754473e-2*eta__1^9*zeta__1^5+.13649316215*eta__1^6*zeta__1^9+.23302831691*eta__1^2*zeta__1^9-.32125390168*eta__1^4*zeta__1^9+0.12167023924e-1*eta__1^7*zeta__1-0.301782967e-2*eta__1^6*zeta__1^8-0.43456747248e-2*eta__1^8*zeta__1^6):

plot3d(sqrt(fff), zeta__1 = -1 .. 1, eta__1 = -1 .. 1, color = green)

 

``

Quadrature(Quadrature(sqrt(fff), zeta__1 = -1 .. 1, method = romberg[3]), eta__1 = -1 .. 1, method = romberg[3])

0.2745463666e-1+0.*I

(1)

Student:-NumericalAnalysis:-Quadrature(Student:-NumericalAnalysis:-Quadrature(sqrt(fff), zeta__1 = -1 .. 1, method = romberg[4]), eta__1 = -1 .. 1, method = romberg[4])

0.3314502549e-1+0.*I

(2)

Student:-NumericalAnalysis:-Quadrature(Student:-NumericalAnalysis:-Quadrature(sqrt(fff), zeta__1 = -1 .. 1, method = romberg[5]), eta__1 = -1 .. 1, method = romberg[5])

0.3621732017e-1+0.*I

(3)

Student:-NumericalAnalysis:-Quadrature(Student:-NumericalAnalysis:-Quadrature(sqrt(fff), zeta__1 = -1 .. 1, method = romberg[6]), eta__1 = -1 .. 1, method = romberg[6])

Float(undefined)+Float(undefined)*I

(4)

``

Download question.mw

1 2 3 4 5 6 7 Last Page 1 of 59