Adri van der Meer

Adri vanderMeer

1400 Reputation

19 Badges

20 years, 136 days
University of Twente (retired)
Enschede, Netherlands

My "website" consists of a Maple Manual in Dutch

MaplePrimes Activity


These are answers submitted by Adri van der Meer

This differential equation can be solved by

DE := EI*diff(y(x),x$4)+P*diff(y(x),x$2)-p+W=0;
BC := y(0)=0, D(y)(0)=0, y(L)=0, D(y)(L)=0; # boundary conditions
dsolve({DV,BC},y(x)): Y := unapply( subs(%,y(x)), x );

(1) with(LinearAlgebra); with(linalg); is not necessary. But in any case, don't use both packages: Linalg is an old version of LinearAlgebra.

(2) In the differential equation you use omega, but you assign a value to omega1.

(3) What is u2(t) supposed to be? If I take u2(t)=1, I get

restart; with(plots): with(LinearAlgebra):
m1 := 2280; m2 := 2243; m3 := 2220; k1 := 300; k2 := 200; k3 := 100; F0 := 4.1; omega1 := sqrt((k1+k2)/m1);
Sys := m1*(diff(u1(t), t, t))+(k1+k2)*u1(t)-k2 = F0*cos(omega1*t);
IC := u1(0) = 0, D(u1)(0) = 0;
csol := dsolve({IC, Sys}, {u1(t)});
p1 := subs(csol, u1(t));
plot(p1, t = 0 .. 10*Pi, 'color' = "red", 'thickness' = 2, labels = ['t', 'u(t)'], title = "red=First Floor");


fsolve computes a numerical approximation, so evalf is not needed. Use Pi instead of pi. The errormessage shows what is going wrong:

fsolve(sin(xx*a)=0,xx,0..Pi);
Error, (in fsolve) a is in the equation, and is not solved for

A numerical answer is only possible if there are no other variables than the unknown.
But in this case the exact solutions are found by

 solve( {sin(xx*a)=0}, xx, AllSolutions = true);
                         /     Pi _Z2~\
                        { xx = -------- }
                         \       a~ /
about(_Z2);
Originally _Z2, renamed _Z2~:
  is assumed to be: integer

With two independent variables (Y and Z), you probably don't intend to find a 3d curve, but a 3d surface.
Use ?Regression in the Statistics package.

cf Kitonum: for a Hermitian matrix, or a symmetric matrix, only the nonzero elements have to be provided. All other entries are automatically set to zero. And Matrix(2) gives a 2×2 zero matrix. So you can do:

restart: with(LinearAlgebra):
HA := Matrix(2, {(1, 2) = f}, shape = hermitian):
P := DiagonalMatrix([HA,HA]):
Q := Matrix(4, [Matrix(2),DiagonalMatrix(<-t,-t>)], shape = hermitian);
HAA := P+Q;


replace the square brackets by parentheses (square brackets are used for lists)

f := i*x^2/(2*M)+(1/2)*iM+(1-i)*x; x := e*(w^2+M^2)/(2*M)+(1-e)*w;
s := solve(y*log(x) = y + x*log(x), {y}):  # cf Joe Riel
k := subs( s, [x,y,y*log(x)] ):
plots:-spacecurve( k, x=2..4, color=black, thickness=3, axes=boxed );

entries(Y)

gives the rows in a random order.
So you can do

Matrix( [seq(op(Y[i]), i=1..6)] );

to get the rows in the right order.

while not Equal(B,E) do
is((1)=(2));
                              true

I'm not sure if this is what tou mean. I make a 4 × 4 matrix with row totals 10:

with(LinearAlgebra):
A := RandomMatrix(4,4,generator=0..10);
B := A.Matrix(4,fill=1); # row totals
C := 10*A/~B;  # all row totals equal 10

The last entry has to be 2*a (multiplication sign), but:

A := Matrix(4,5,[a,1,1,1,1,1,1,-1,-1,1,-a,0,1,1,-a,b,1,-1,b,1,-2*a]);
Error, (in Matrix) too many entries in the initializer parameter

I don't like to count ones, so you can better make the coefficient matrix by:

A := Matrix( 4,5, [[a,1,1,1,1], [1,-1,-1,1,-a], 
                   [0,1,1,-a,b], [1,-1,b,1,-2*a]] );

or better:

A := Matrix( 4,4, [[a,1,1,1], [1,-1,-1,1], 
                   [0,1,1,-a], [1,-1,b,1]] ):
r := Vector( [1,-a,b,-2*a] ):
Aa := <A|r>;

Now try

GaussianElimination(A);

and see what you get.
You can substitute special values for a and/or b:

GaussianElimination(subs(a=-1,Aa));
LinearSolve( subs(a=-1,A), r );

First question: A wireframe of a sphere with radius 1

plot3d( [1,phi,theta], phi=0..Pi, theta=0..2*Pi, coords=spherical, style=wireframe, 
  color=black, grid=[10,20] ); wire := %:

Second question:

v := LinearAlgebra:-RandomVector(15):
# datapoints as [r,φ,θ]:
data := [seq([seq([ 1+.001*v[i+j], i*Pi/5, j*Pi/5], i=1..5)], j=1..10)]:
dataplot := plots:-surfdata( data, coords=spherical, style=point, symbolsize=25 ):
plots:-display( {wire,dataplot}, axes=boxed );

Mac Dude, indeed, I overlooked some more syntax problems.
Now the code to plot the function, including the discontinuity at t=0:

f0 := .999622717187366642185009937: a := 5/6:
f := t -> piecewise( t=0, f0, a*f0*(1-f0)*exp(-a*f0*t) ):
plot( f(t), t=-2..2, discont=[showremovable], axes=framed );

This works in Maple 16.

First 18 19 20 21 22 23 24 Page 20 of 27