## 355 Reputation

11 years, 285 days

## series solution...

restart:
PDE:=diff(u(x,t),t)=diff(u(x,t),x\$2);

BCs:=u(0,t)=0, u(Pi/4,t)=0 , u(x,0)=x*(Pi/4-x);

pde := [PDE,BCs];

pdsolve(pde,u(x,t));

u(x, t) = Sum(-(1/4)*(-1+(-1)^_Z1)*sin(4*_Z1*x)*exp(-16*_Z1^2*t)/(Pi*_Z1^3), _Z1 = 1 .. infinity)

## not really...

I don't think so that this is possible. Automatic updates are availablewithin the version not upgradation from one version into another.

## dsolve(....)...

I think you are looking for dsolve.

## VectorAngle(U, V, options)...

restart:with(Student[LinearAlgebra]):

U := <-6*a, b , c>;

V := <3*a, -4*b , c>;

VectorAngle(U, V);

## ExportMatrix(..,...)...

Check here ExportMatrix for details.

Maple 17

restart:

2*sin(x+Pi/4);

expand(%,trig);

## solve...

restart:

eq1:=10*a+3*b+4*C+d+e=0;

eq2:=11*b+2*C+2*d+3*e+f=0;

eq3:=15*c+4*d+5*e+4*f+g=0;

eq4:=2*a+b-3*C+12*d-3*e+f+g=0;

eq5:=6*a-5*b+3*C-d+17*e+f=0;

eq6:=3*a+2*b-3*C+4*d+e-16*f+2*g=0;

eq7:=4*a-6*b+C+d+3*e+19*g=0;

solve({eq1,eq2,eq3,eq4,eq5,eq6,eq7},{a,b,C,d,e,f,g});

{C = -109230135/444478, a = 19922550/222239, b = 11044095/222239, d = -36041235/444478, e = 8246205/444478, f = 22834035/444478, g = 4930605/444478}

## Optimization:-Maximize...

restart:

F := (-x*y+12.)*x*y/(2*x+2*y);

Optimization:-Maximize(F);

[4., [x = 1.99999999999999, y = 1.99999999999999]]

## dsolve()...

restart:

ODE:=m*diff(x(t),t\$2)+ c*diff(x(t),t\$1) + k*x(t) = F(t);

dsolve(ODE);

For a complete solution, you need to input m, c, k, F(t) and two conditions.

For example

m:=1:c:=1:k:=1:F(t):=t^2: # say

ics:=x(0)=0, D(x)(0)=0; # say

dsolve({ODE,ics});

x(t) = (4/3)*exp(-(1/2)*t)*sin((1/2)*sqrt(3)*t)*sqrt(3)+t^2-2*t

For some info about the mass-spring-damper model see this paper.

## <,> and <<>|<>>...

restart:
interface(rtablesize= infinity):
m:=3:

Omega1 := Vector(m, proc (i) options operator, arrow; psi[1, i-1] end proc);

Omega2 := Vector(m, proc (i) options operator, arrow; psi[2, i-1] end proc);

<Omega1,Omega2>;

and

<<Omega1>|<Omega2>>;

## fsolve(..., complex)...

As correctly mentioned by @Carl Love complex solution exists for ur equations.

plot(subs(a=2,{eq[1],eq[2]}),x=0..1);

fsolve({eq[1],eq[2]},{x,a}, complex);

{a = 6.564724757-.8471874060*I, x = -9.103579665-.3568635315*I}

## Errors...

restart:

N:=10: #Error, final value in for loop must be numeric or character

for i from 1 to N do

t:=h*i:
X[i,0]:=x1+h*(-x1)*x2+x1:
X[i,1]:=x2+h*x1*x2-x2:
xx1:=X[i,0]:  #Error, too many levels of recursion
xx2:=X[i,1]:   #Error, too many levels of recursion
print('Iteration',i,'AtTime',t,x1,x2)
end do;
print(X);

## DEtools[symgen]...

restart:

with(DEtools):

ode1 := x*(diff(y(x), x))-y(x)*(x*ln(x^2/y(x))+2) = 0;

symgen(ode1);

-> Computing symmetries using: way = 2-> Computing symmetries using: way = 3
-> Computing symmetries using: way = 4

<- successful computation of symmetries.

DEtools-symgen.mw

## Euler vs dsolve...

restart:with(plots):

#dsolve

ODE := diff(y(t),t) = t*(1-.3*t)-t*y(t)/(1+.6*t);

ics := y(0) = 1;

p:=dsolve({ODE,ics},numeric,y(t));

p1:=odeplot(p,[t,y(t)],0..2,color=red,legend = ["dsolve"]):

#Euler's method

t[0]:= 0: y[0] := 1.0: h:= 0.1:

f := (t,y) -> t*(1-0.3*t)-(t*y(t))/(1+0.6*t);

for n from 1 to 20 do
t[n] := n*h;
y[n] := y[n-1] + h*f(t[n-1],y[n-1]);
od:

data := [seq([t[n],y[n]],n=0..20)]:

p2 := plot(data,style=point,color=green,legend = ["Euler's method"]):

#Modified Euler’s method

for n from 1 to 20 do
t[n]:=n*h:
y[n]:=y[n-1]+h*f(t[n-1]+(h/2),y[n-1]+(h/2)*f(t[n-1],y[n-1])):
end do:

m_data:= [seq([t[n],y[n]],n=0..20)]:

p3 := plot(m_data,style=point,color=blue,thickness=5,legend=["Modified Euler's Method"]):

plots[display]({p1,p2,p3});

## complexplot...

restart:with(plots):

k:=n*Pi/L;L:=1;n:=1;l[2]:=1;

psi:=sin(k*x)+I*k*l[2]*cos(k*x);

complexplot(psi,x=0..5);

plot(Re(psi),x=0..5); # real part plot

 1 2 3 4 Page 2 of 4
﻿