Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

how we can solve an ode with boundaries by using RK4 and any other technique??

how we can solve an ode with exat soltuion n calculate the unknw constant which aries after solving an ode.???

The 5th International Congress on Mathematical Software was  held in Berlin from July, 11 to July,14, 2016.

I'd like to pay attention to the following sessions:

The talks demonstrate what is going on at the frontiers of math soft nowadays and what are the cutting edge research topics in it.

This post is about the relationship between the number of processors used in parallel processing with the Threads package and the resultant real times and cpu times for a computation.

In the worksheet below, I perform the same computation using each possible number of processors on my machine, one thru eight. The computation is adding a list of 32 million pre-selected random integers. The real times and cpu times are collected from each run, and these are analyzed with a variety of metrics that I devised. Note that garbage-collection (gc) time is not an issue in the timings; as you can see below, the gc times are zero throughout.

My conclusion is that there are severely diminishing returns as the number of processors increases. There is a major benefit in going from one processor to two; there is a not-as-great-but-still-substantial benefit in going from two processors to four. But the real-time reduction in going from four processors to eight is very small compared to the substantial increase in resource consumption.

Please discuss the relevance of my six metrics, the soundness of my test technique, and how the presentation could be better. If you have a computer capable of running more than eight threads, please modify and run my worksheet on it.

Diminishing Returns from Parallel Processing: Is it worth using more than four processors with Threads?

Author: Carl J Love, 2016-July-30 

Set up tests

 

restart:

currentdir(kernelopts(homedir)):
if kernelopts(numcpus) <> 8 then
     error "This worksheet needs to be adjusted for your number of CPUs."
end if:
try fremove("ThreadsData.m") catch: end try:
try fremove("ThreadsTestData.m") catch: end try:
try fremove("ThreadsTest.mpl") catch: end try:

#Create and save random test data
L:= RandomTools:-Generate(list(integer, 2^25)):
save L, "ThreadsTestData.m":

#Create code file to be read for the tests.
fd:= FileTools:-Text:-Open("ThreadsTest.mpl", create):
fprintf(
     fd,
     "gc();\n"
     "read \"ThreadsTestData.m\":\n"
     "CodeTools:-Usage(Threads:-Add(x, x= L)):\n"
     "fd:= FileTools:-Text:-Open(\"ThreadsData.m\", create, append):\n"
     "fprintf(\n"
     "     fd, \"%%m%%m%%m\\n\",\n"
     "     kernelopts(numcpus),\n"
     "     CodeTools:-Usage(\n"
     "          Threads:-Add(x, x= L),\n"
     "          iterations= 8,\n"
     "          output= [realtime, cputime]\n"
     "     )\n"
     "):\n"
     "fclose(fd):"
):
fclose(fd):

#Code review
fd:= FileTools:-Text:-Open("ThreadsTest.mpl"):
while not feof(fd) do
     printf("%s\n", FileTools:-Text:-ReadLine(fd))
end do:

fclose(fd):

gc();
read "ThreadsTestData.m":
CodeTools:-Usage(Threads:-Add(x, x= L)):
fd:= FileTools:-Text:-Open("ThreadsData.m", create, append):
fprintf(
     fd, "%m%m%m\n",
     kernelopts(numcpus),
     CodeTools:-Usage(
          Threads:-Add(x, x= L),
          iterations= 8,
          output= [realtime, cputime]
     )
):
fclose(fd):

 

Run the tests

restart:

kernelopts(numcpus= 1):
currentdir(kernelopts(homedir)):
read "ThreadsTest.mpl":

memory used=0.79MiB, alloc change=0 bytes, cpu time=2.66s, real time=2.66s, gc time=0ns

memory used=0.78MiB, alloc change=0 bytes, cpu time=2.26s, real time=2.26s, gc time=0ns

 

Repeat above test using numcpus= 2..8.

 

restart:

kernelopts(numcpus= 2):
currentdir(kernelopts(homedir)):
read "ThreadsTest.mpl":

memory used=0.79MiB, alloc change=2.19MiB, cpu time=2.73s, real time=1.65s, gc time=0ns

memory used=0.78MiB, alloc change=0 bytes, cpu time=2.37s, real time=1.28s, gc time=0ns

 

restart:

kernelopts(numcpus= 3):
currentdir(kernelopts(homedir)):
read "ThreadsTest.mpl":

memory used=0.79MiB, alloc change=4.38MiB, cpu time=2.98s, real time=1.38s, gc time=0ns

memory used=0.78MiB, alloc change=0 bytes, cpu time=2.75s, real time=1.05s, gc time=0ns

 

restart:

kernelopts(numcpus= 4):
currentdir(kernelopts(homedir)):
read "ThreadsTest.mpl":

memory used=0.80MiB, alloc change=6.56MiB, cpu time=3.76s, real time=1.38s, gc time=0ns

memory used=0.78MiB, alloc change=0 bytes, cpu time=3.26s, real time=959.75ms, gc time=0ns

 

restart:

kernelopts(numcpus= 5):
currentdir(kernelopts(homedir)):
read "ThreadsTest.mpl":

memory used=0.80MiB, alloc change=8.75MiB, cpu time=4.12s, real time=1.30s, gc time=0ns

memory used=0.78MiB, alloc change=0 bytes, cpu time=3.74s, real time=910.88ms, gc time=0ns

 

restart:

kernelopts(numcpus= 6):
currentdir(kernelopts(homedir)):
read "ThreadsTest.mpl":

memory used=0.81MiB, alloc change=10.94MiB, cpu time=4.59s, real time=1.26s, gc time=0ns

memory used=0.78MiB, alloc change=0 bytes, cpu time=4.29s, real time=894.00ms, gc time=0ns

 

restart:

kernelopts(numcpus= 7):
currentdir(kernelopts(homedir)):
read "ThreadsTest.mpl":

memory used=0.81MiB, alloc change=13.12MiB, cpu time=5.08s, real time=1.26s, gc time=0ns

memory used=0.78MiB, alloc change=0 bytes, cpu time=4.63s, real time=879.00ms, gc time=0ns

 

restart:

kernelopts(numcpus= 8):
currentdir(kernelopts(homedir)):
read "ThreadsTest.mpl":

memory used=0.82MiB, alloc change=15.31MiB, cpu time=5.08s, real time=1.25s, gc time=0ns

memory used=0.78MiB, alloc change=0 bytes, cpu time=4.69s, real time=845.75ms, gc time=0ns

 

Analyze the data

restart:

currentdir(kernelopts(homedir)):

(R,C):= 'Vector(kernelopts(numcpus))' $ 2:
N:= Vector(kernelopts(numcpus), i-> i):

fd:= FileTools:-Text:-Open("ThreadsData.m"):
while not feof(fd) do
     (n,Tr,Tc):= fscanf(fd, "%m%m%m\n")[];
     (R[n],C[n]):= (Tr,Tc)
end do:

fclose(fd):

plot(
     (V-> <N | 100*~V>)~([R /~ max(R), C /~ max(C)]),
     title= "Raw timing data (normalized)",
     legend= ["real", "CPU"],
     labels= [`number of processors\n`, `%  of  max`],
     labeldirections= [HORIZONTAL,VERTICAL],
     view= [DEFAULT, 0..100]
);

The metrics:

 

R[1] /~ R /~ N:          Gain: The gain from parallelism expressed as a percentage of the theoretical maximum gain given the number of processors

C /~ R /~ N:               Evenness: How evenly the task is distributed among the processors

1 -~ C[1] /~ C:           Overhead: The percentage of extra resource consumption due to parallelism

R /~ R[1]:                   Reduction: The percentage reduction in real time

1 -~ R[2..] /~ R[..-2]:  Marginal Reduction: Percentage reduction in real time by using one more processor

C[2..] /~ C[..-2] -~ 1:  Marginal Consumption: Percentage increase in resource consumption by using one more processor

 

plot(
     [
          (V-> <N | 100*~V>)~([
               R[1]/~R/~N,             #gain from parallelism
               C/~R/~N,                #how evenly distributed
               1 -~ C[1]/~C,           #overhead
               R/~R[1]                 #reduction
          ])[],
          (V-> <N[2..] -~ .5 | 100*~V>)~([
               1 -~ R[2..]/~R[..-2],   #marginal reduction rate
               C[2..]/~C[..-2] -~ 1    #marginal consumption rate        
          ])[]
     ],
     legend= typeset~([
          'r[1]/r/n',
          'c/r/n',
          '1 - c[1]/c',
          'r/r[1]',
          '1 - `Delta__%`(r)',
          '`Delta__%`(c) - 1'       
     ]),
     linestyle= ["solid"$4, "dash"$2], thickness= 2,
     title= "Efficiency metrics\n", titlefont= [HELVETICA,BOLD,16],
     labels= [`number of processors\n`, `% change`], labelfont= [TIMES,ITALIC,14],
     labeldirections= [HORIZONTAL,VERTICAL],
     caption= "\nr = real time,  c = CPU time,  n = # of processors",
     size= combinat:-fibonacci~([16,15]),
     gridlines
);

 

 

Download Threads_dim_ret.mw

Hello, I am using PDEtools to evaluate an equation but got system inconsistent in respect of a parameter used after the command map(pdsolve). I am afraid the result sebsequently given may not be correct, did I do something wrong?

Thanks.

 

test.mw

 

 

 

Hello

I'm preparing for my analysis exam but i'm having some trouble finding particular solutions for this differential equation. I used both the command to fully solve it and the command for particular solutions but neither gives me a proper result. Am I doing something wrong?

Thanks in advance

 

Hi everyone,

I'm tryng to find the equations of motion of a 5 DOF arm using Lagrange's method, but I'm pretty new at using Maple. So far, the code is:

restart:

#Método de lagrange
with(VectorCalculus):
with(LinearAlgebra):
#Origem

Orig:= <0|0|0>:
#Cinematica direta

T43:= Matrix([[1,0,0,0],[0,1,0,0],[0,0,1,L1],[0,0,0,1]]):
T76:= Matrix([[1,0,0,0],[0,1,0,0],[0,0,1,L2],[0,0,0,1]]):
R10:= Matrix([ [1,0,0,0] , [0,cos(q1(t)),-sin(q1(t)),0] , [0,sin(q1(t)),cos(q1(t)),0] , [0,0,0,1] ]):
R21:= Matrix([ [cos(q2(t)),0,-sin(q2(t)),0] , [0,1,0,0] , [sin(q2(t)),0,cos(q2(t)),0] , [0,0,0,1] ]):
R32:= Matrix([ [cos(q3(t)),sin(q3(t)),0,0] , [-sin(q3(t)),cos(q3(t)),0,0] , [0,0,1,0] , [0,0,0,1] ]):
R54:= Matrix([ [cos(q4(t)),0,-sin(q4(t)),0] , [0,1,0,0] , [sin(q4(t)),0,cos(q4(t)),0] , [0,0,0,1] ]):
R65:= Matrix([ [cos(q5(t)),sin(q5(t)),0,0] , [-sin(q5(t)),cos(q5(t)),0,0] , [0,0,1,0] , [0,0,0,1] ]):
Rr10:= Matrix([ [1,0,0] , [0,cos(q1(t)),-sin(q1(t))] , [0,sin(q1(t)),cos(q1(t))] ]):
Rr21:= Matrix([ [cos(q2(t)),0,-sin(q2(t))] , [0,1,0] , [sin(q2(t)),0,cos(q2(t))] ]):
Rr32:= Matrix([ [cos(q3(t)),sin(q3(t)),0] , [-sin(q3(t)),cos(q3(t)),0] , [0,0,1] ]):
Rr54:= Matrix([ [cos(q4(t)),0,-sin(q4(t))] , [0,1,0] , [sin(q4(t)),0,cos(q4(t))] ]):
Rr65:= Matrix([ [cos(q5(t)),sin(q5(t)),0] , [-sin(q5(t)),cos(q5(t)),0] , [0,0,1] ]):

#Coordenadas das juntas

A:= <0|0|0>:
Br:= R10.R21.R32.T43:

B:= <Br[1,4]|Br[2,4]|Br[3,4]>:
Cr:= R10.R21.R32.T43.R54.R65.T76:
C:= <Cr[1,4]|Cr[2,4]|Cr[3,4]>:

#Coordenadas dos centros de massa

TC43:= Matrix([[1,0,0,0],[0,1,0,0],[0,0,1,L1/2],[0,0,0,1]]):
MC1:=R10.R21.R32.TC43:
C1:=<MC1[1,4]|MC1[2,4]|MC1[3,4]>:
C1z := C1[3]:
TC76:= Matrix([[1,0,0,0],[0,1,0,0],[0,0,1,L2/2],[0,0,0,1]]):
MC2:=R10.R21.R32.T43.R54.R65.TC76:
C2:=<MC2[1,4]|MC2[2,4]|MC2[3,4]>:
C2z := C2[3]:

#Calculo da velocidade dos centros de massa

VPc1:= diff(C1,t):

VPc2:= diff(C2,t):


#Calculo da velocidade angular

wC1 := Transpose(Rr10.<v1,0,0> + Rr10.Rr21.<0,v2,0> + Rr10.Rr21.Rr32.<0,0,v3>):
wC2 := Transpose(Rr10.<v1,0,0> + Rr10.Rr21.<0,v2,0> + Rr10.Rr21.Rr32.<0,0,v3> + Rr10.Rr21.Rr32.Rr54.<0,v4,0>):

#Momento de inercia

Ic1:= (1/12)*m1*L1^2:
Ic2:= (1/12)*m2*L2^2:

#Energia cinética

Ec11:= (m1/2)*(VPc1.Transpose(VPc1)) + (Ic1/2)*(wC1.Transpose(wC1)):
Ec1:= simplify(Ec11):
Ec22:= (m2/2)*(VPc2.Transpose(VPc2)) + (Ic2/2)*(wC2.Transpose(wC2)):
Ec2:= simplify(Ec22):

#Energia potencial
Uc1:=m1.g.C1z:
Uc2:=m2.g.C2z:


#Energia cinetica - energia potencial

T1 := Ec1 + Ec2 - Uc1 - Uc2:

#T:= subs(diff(q1(t),t)=v1(t),diff(q2(t),t)=v2(t),diff(q3(t),t)=v3(t),diff(q4(t),t)=v4(t),diff(q5(t),t)=v5(t),diff(v1(t),t)=a1(t),diff(v2(t),t)=a2(t),diff(v3(t),t)=a3(t),diff(v4(t),t)=a4(t),diff(v5(t),t)=a5(t), T1):
T:= subs(diff(q1(t),t)=v1,diff(q2(t),t)=v2,diff(q3(t),t)=v3,diff(q4(t),t)=v4,diff(q5(t),t)=v5,q1(t)=q1,q2(t)=q2,q3(t)=q3,q4(t)=q4,q5(t)=q5, T1):

Eq11:=diff(T,v1):
#Tv1:=convert(Tv1,diff):


Eq12:=diff(T,q1):
#Tq1:=convert(Tq1,diff):


Eq13 := subs(q1=q1(t),q2=q2(t),q3=q3(t),q4=q4(t),q5=q5(t),v1=diff(q1(t),t),v2=diff(q2(t),t),v3=diff(q3(t),t),v4=diff(q4(t),t),v5=diff(q5(t),t), Eq11):

Eq14 := subs(q1=q1(t),q2=q2(t),q3=q3(t),q4=q4(t),q5=q5(t),v1=diff(q1(t),t),v2=diff(q2(t),t),v3=diff(q3(t),t),v4=diff(q4(t),t),v5=diff(q5(t),t), Eq12):

Eq15:= diff(Eq13,t):

Eqqqq16 := Eq15-Eq14=0:

##Lagrangiano

Eqqq16:=expand(Eqqqq16):
Eqq16:=convert(Eqqq16,diff):
Eq16:=collect(Eqq16,diff):

Eq21:=diff(T,v2):
#Tv1:=convert(Tv1,diff):


Eq22:=diff(T,q2):
#Tq1:=convert(Tq1,diff):


Eq23 := subs(q1=q1(t),q2=q2(t),q3=q3(t),q4=q4(t),q5=q5(t),v1=diff(q1(t),t),v2=diff(q2(t),t),v3=diff(q3(t),t),v4=diff(q4(t),t),v5=diff(q5(t),t), Eq21):

Eq24 := subs(q1=q1(t),q2=q2(t),q3=q3(t),q4=q4(t),q5=q5(t),v1=diff(q1(t),t),v2=diff(q2(t),t),v3=diff(q3(t),t),v4=diff(q4(t),t),v5=diff(q5(t),t),Eq22):

Eq25:= diff(Eq23,t):

Eqqqq26 := Eq25-Eq24=0:

##Lagrangiano

Eqqq26:=expand(Eqqqq26):
Eqq26:=convert(Eqqq26,diff):
Eq26:=collect(Eqq26,diff):


Eq31:=diff(T,v3):
#Tv1:=convert(Tv1,diff):


Eq32:=diff(T,q3):
#Tq1:=convert(Tq1,diff):


Eq33 := subs(q1=q1(t),q2=q2(t),q3=q3(t),q4=q4(t),q5=q5(t),v1=diff(q1(t),t),v2=diff(q2(t),t),v3=diff(q3(t),t),v4=diff(q4(t),t),v5=diff(q5(t),t), Eq31):

Eq34 := subs(vq1=q1(t),q2=q2(t),q3=q3(t),q4=q4(t),q5=q5(t),v1=diff(q1(t),t),v2=diff(q2(t),t),v3=diff(q3(t),t),v4=diff(q4(t),t),v5=diff(q5(t),t), Eq32):

Eq35:= diff(Eq33,t):

Eqqqq36 := Eq35-Eq34=0:

##Lagrangiano

Eqqq36:=expand(Eqqqq36):
Eqq36:=convert(Eqqq36,diff):
Eq36:=collect(Eqq36,diff):


Eq41:=diff(T,v4):
#Tv1:=convert(Tv1,diff):


Eq42:=diff(T,q4):
#Tq1:=convert(Tq1,diff):


Eq43 := subs(q1=q1(t),q2=q2(t),q3=q3(t),q4=q4(t),q5=q5(t),v1=diff(q1(t),t),v2=diff(q2(t),t),v3=diff(q3(t),t),v4=diff(q4(t),t),v5=diff(q5(t),t), Eq41):

Eq44 := subs(q1=q1(t),q2=q2(t),q3=q3(t),q4=q4(t),q5=q5(t),v1=diff(q1(t),t),v2=diff(q2(t),t),v3=diff(q3(t),t),v4=diff(q4(t),t),v5=diff(q5(t),t), Eq42):

Eq45:= diff(Eq43,t):

Eqqqq46 := Eq45-Eq44=0:

##Lagrangiano

Eqqq46:=expand(Eqqqq46):
Eqq46:=convert(Eqqq46,diff):
Eq46:=collect(Eqq46,diff):


Eq51:=diff(T,v5):
#Tv1:=convert(Tv1,diff):

Eq52:=diff(T,q5):
#Tq1:=convert(Tq1,diff):


Eq53 := subs(q1=q1(t),q2=q2(t),q3=q3(t),q4=q4(t),q5=q5(t),v1=diff(q1(t),t),v2=diff(q2(t),t),v3=diff(q3(t),t),v4=diff(q4(t),t),v5=diff(q5(t),t), Eq15):

Eq54 := subs(q1=q1(t),q2=q2(t),q3=q3(t),q4=q4(t),q5=q5(t),v1=diff(q1(t),t),v2=diff(q2(t),t),v3=diff(q3(t),t),v4=diff(q4(t),t),v5=diff(q5(t),t), Eq52):

Eq55:= diff(Eq53,t):

Eqqqq56 := Eq55-Eq54=0:

##Lagrangiano

Eqqq56:=expand(Eqqqq56):
Eqq56:=convert(Eqqq56,diff):
Eq56:=collect(Eqq56,diff):


##Substituicao de dados

Lagran1 := subs[eval](L1=1, m1=1, L2=1, m2=1, g=9.81 , Eq16):
Lagran2 := subs[eval](L1=1, m1=1, L2=1, m2=1, g=9.81 , Eq26):
Lagran3 := subs[eval](L1=1, m1=1, L2=1, m2=1, g=9.81 , Eq36):
Lagran4 := subs[eval](L1=1, m1=1, L2=1, m2=1, g=9.81 , Eq46):
Lagran5 := subs[eval](L1=1, m1=1, L2=1, m2=1, g=9.81 , Eq56):

## Solucao do sistema para encontrar as derivadas segundas ddqn/dt


ini:= q1(0)= Pi/10, q2(0)=0, q3(0)=0, q4(0)=0, q5(0)=0, eval (diff (q1(t), t), t=0)=0,eval (diff (q2(t), t), t=0)=0, eval (diff (q3(t), t), t=0)=0, eval (diff (q4(t), t), t=0)=0, eval (diff (q5(t), t), t=0)=0,eval (diff (q1(t), t$2), t=0)=0,eval (diff (q2(t), t$2), t=0)=0, eval (diff (q3(t), t$2), t=0)=0, eval (diff (q4(t), t$2), t=0)=0, eval (diff (q5(t), t$2), t=0)=0:


sol := dsolve({Lagran1, Lagran2, Lagran3, Lagran4, Lagran5, ini},{q1(t), q2(t), q3(t), q4(t), q5(t)}, numeric, output=listprocedure):

The problem is I'm stuck with the following error using dsolve:

Error, (in dsolve/numeric/process_input) unknown q1(t) present in ODE system is not a specified dependent variable or evaluatable procedure

Could someone show me what's wrong? 

Any help would be greatly appreciated, thanks in advance!

Hi,

I have this maple program, let's call it 1.mw. I need to import the data produced in 1.mw to another file, 2.mw and use it there, how do I go about this? Also how can I export the result produced in 2.mw to a different file (not necessarily a maple file). I am not sure about the right time to use, but maybe the question is, how do I get data from 1.mw to use in 2.mw, and then produce the result from 2.mw in another file?

 

Thanks,

Vic.

I wish to study the trend of medical consultations each day during six years. Thus I expect near 2200 datas to analyse.

But some parameters are to consider :

- I don't have yet the datas per day, but the mean is about 2 consultations per day

- as it is difficult to do more than 3 or perhaps 4 consultations during one day (9h30 am - 13h pm), the others if they exist will probably be seen the next day (aso if the next day 3 news consultations occured)

- then, I don't know actually (as I expect the datas or each day but don't have now these datas) if the better distribution will be simply follow a Poisson' law, or exponential, or negative binomial, ..

- do someone have a clue for the better law given what i said ?

 

Further, I don't have a stastic program especially used for time trend, excepting Systran 13, but I don't believe that this program can be used with a theoric model of distribution, I recall that it does usual tasks, autocorrelations, saisonnal adjustments, .. but with continuous distributions I believe, and a linear model (removing the basic frequencies)

As such program (study of temporal series) is usually sold about 3000$ in France, that I don't expect to be a trader, with only one calculus to do, could anyone tell me how to adjust the better model to the 2200 datas that could be expected ?

Thx for your help, friendly yours;

Milos

I apologize because this is not a technical question but I believe that the question and issue that I have is probably of interest to a wide range of Maple users.   I am a retired biophysicist and have been using Maple as a tool in my research since Maple 5.  I recently became aware of the amazing Maple Physics Package.  It seems to offer an incredible advance.  I say “seems” because its notation and complexity is a bit overwhelming.  What I was hoping to find was a complete course (or courses) in physics that used this package.  I was hoping that with such a course I could go through it in detail and could relearn physics and become proficient in using the package.  Unfortunately, after considerable search, I could not find such a course.  (There are some older brief tutorials that do not take advantage of the features in the new Physics package.)  I am sure that there must be some physics courses that are based around this Physics Package, certainly at the University of Waterloo or the Perimeter Institute.  I would like to suggest that these courses be made available online (with a fee if necessary).  If such courses were available I know that I would avidly use them as I am sure would many others.

Hi there,

            I am new to maple. I want to ask a simple question.

            If I have a array, and I want its each component to take natural logarithm. How can I do?

            Eg:[2 3 4]->[ln(2) ln(3) ln(4)]

            Thanks in advance.

Dirichlet

Simple test of GaussianElimination function

Why doesn't this work? 

Also can I just confirm that for GaussianElimination (according to the help this uses LUDecomposition function with the output=['U'] option) the input is the augmented matrix of the system, the coefficient matrix augmented with the RHS)

In a separate test I got an example working using this code, but I've never seen this syntax before for A Matrix (using << it seems?)

 

Thank you for your help.

 

 

ORIGINAL ATTEMPT

with(LinearAlgebra):

A := matrix(3, 3, [-3, 2, 1, 1, -2, 1, 1, 2, -3]);

Matrix(3, 3, {(1, 1) = -3, (1, 2) = 2, (1, 3) = 1, (2, 1) = 1, (2, 2) = -2, (2, 3) = 1, (3, 1) = 1, (3, 2) = 2, (3, 3) = -3})

(1)

GaussianElimination(A)

Error, (in LinearAlgebra:-GaussianElimination) invalid input: LinearAlgebra:-GaussianElimination expects its 1st argument, A, to be of type Matrix() but received A

 

``

 

Download gauss_elimination_2.mw

I wonder why the thole procedure becomes ... when converting from 1-D math to 2-D math.

It's funny how Maple automatically evaluates an expression, it can be frustrating at times, but suppose the user wants it entered the way he types.

a:=sin(-4-Phi)

                   - sin ( 4 + Phi)  #automatically evaluates the negative outside

b:=sin(x+y+z-Phi)

                   - sin (-x -y -z + Phi)

 

Even though both expressions are the same it seems Maple prefers -sin to +sin, in the second example above Maple has now 3 extra negatives. 

Is all we need just a double set of single quotes around our expression so that when we recall that variable it returns exactly how we entered it in?

b:= ''sin(x+y+z-Phi)''

           b:= ' sin(x+y+z-Phi) '

 

b;

      sin( x + y + z - Phi)

 

Would that work?  Where would that fail?  Is there a better way?

hi...please help me for solve this nonlinear equations with pdsolve

thanksoffcenter2.mw

La := .25; Lb := 0.1e-1

h := 0.4e-2

rho := 7900

E := 0.200e12

nu := .3

ve := 5

g := 9.8

M := .5

Z0 := 0.1e-2

K := 5/6

C := sqrt(E/rho)

NULL

 

PDE[1] := diff(u(x, t), x, x)+(diff(w(x, t), x))*(diff(w(x, t), x, x)) = (diff(u(x, t), t, t))/C^2

diff(diff(u(x, t), x), x)+(diff(w(x, t), x))*(diff(diff(w(x, t), x), x)) = 0.3949999999e-7*(diff(diff(u(x, t), t), t))

(1)

PDE[2] := K*(diff(phi(x, t), x)+diff(w(x, t), x, x))/(2*(1+nu))+(diff(w(x, t), x))*(diff(u(x, t), x, x))+(diff(u(x, t), x))*(diff(w(x, t), x, x))+(3/2)*(diff(w(x, t), x, x))*(diff(w(x, t), x))^2 = (diff(w(x, t), t, t))/C^2

.3205128205*(diff(phi(x, t), x))+.3205128205*(diff(diff(w(x, t), x), x))+(diff(w(x, t), x))*(diff(diff(u(x, t), x), x))+(diff(u(x, t), x))*(diff(diff(w(x, t), x), x))+(3/2)*(diff(diff(w(x, t), x), x))*(diff(w(x, t), x))^2 = 0.3949999999e-7*(diff(diff(w(x, t), t), t))

(2)

 

PDE[3] := diff(phi(x, t), x, x)-6*K*(diff(w(x, t), x)+phi(x, t))/(h^2*(1+nu)) = (diff(phi(x, t), t, t))/C^2

diff(diff(phi(x, t), x), x)-240384.6154*(diff(w(x, t), x))-240384.6154*phi(x, t) = 0.3949999999e-7*(diff(diff(phi(x, t), t), t))

(3)

 

 

#####################################

(4)

at x= La

PDE[a1] := diff(u(x, t), x)+(1/2)*(diff(w(x, t), x))^2-M*(g-(diff(u(x, t), t, t))-Z0*(diff(phi(x, t), t, t)))/(E*Lb*h) = 0

diff(u(x, t), x)+(1/2)*(diff(w(x, t), x))^2-0.6125000000e-6+0.6250000000e-7*(diff(diff(u(x, t), t), t))+0.6250000000e-10*(diff(diff(phi(x, t), t), t)) = 0

(5)

PDE[a2] := diff(phi(x, t), x)-12*M*Z0*(g-(diff(u(x, t), t, t))-Z0*(diff(phi(x, t), t, t)))/(E*Lb*h^3) = 0

diff(phi(x, t), x)-0.4593750000e-3+0.4687500000e-4*(diff(diff(u(x, t), t), t))+0.4687500000e-7*(diff(diff(phi(x, t), t), t)) = 0

(6)

PDE[a3] := w(x, t) = 0

w(x, t) = 0

(7)

NULL

############################################

``

at x=0 NULL

(8)

PDE[b1] := u(x, t) = 0 

PDE[b2] := w(x, t) = 0

PDE[b3] := diff(phi(x, t), x) = 0

diff(phi(x, t), x) = 0

(9)

################################################

at t=0 for x= [0,La]

u(x, t) = 0

u(x, t) = 0

(10)

w(x, t) = 0

w(x, t) = 0

(11)

phi(x, t) = 0

phi(x, t) = 0

(12)

diff(phi(x, t), t) = 0

diff(phi(x, t), t) = 0

(13)

diff(w(x, t), t) = 0

diff(w(x, t), t) = 0

(14)

diff(phi(x, t), t, t) = 0

diff(diff(phi(x, t), t), t) = 0

(15)

diff(w(x, t), t, t) = 0

diff(diff(w(x, t), t), t) = 0

(16)

######################################################

at t=0 for x= [0,La)

diff(u(x, t), t) = 0

diff(u(x, t), t) = 0

(17)

diff(u(x, t), t, t) = 0

diff(diff(u(x, t), t), t) = 0

(18)

###################################################

at t=0 for x=La

NULL

diff(u(x, t), t) = -ve

diff(u(x, t), t) = -5

(19)

diff(u(x, t), t, t) = g

diff(diff(u(x, t), t), t) = 9.8

(20)

NULL

NULL

 

Download offcenter2.mw

First 1073 1074 1075 1076 1077 1078 1079 Last Page 1075 of 2224