Adri vanderMeer

## 19 Badges

19 years, 99 days
University of Twente (retired)
Enschede, Netherlands

My "website" consists of a Maple Manual in Dutch

## Labels...

I suppose that (1) and (2) are intended to be labelnumbers of equations. Enter these via Ctrl-L:

Download Labels.mw

## Functions...

I understand that you read Dutch. So see https://avanmeer.home.xs4all.nl/maple/2010/ , choose Module 7, for a complete explanation.

## Homework?...

I will not do your homework, but here is a hint: f is a polynomial with 5 unknown parameters. So you have to solve 5 equations with 5 unknowns.

## Make z a function...

If you replace

`z:=H/mg*(cosh(mg/H*x+zeta)-cosh(zeta));`

by

`z :=  x -> H/mg*(cosh(mg/H*x+zeta)-cosh(zeta));`

the shifted plot wil be:

plot(z(x+deltax), x=0..1 );

## Refer to global parameters...

Why should you use a procedure if you don't want to use a parameter sequence? But if so, you can refer to parameters outside the procedure via the -: operator. A simple example:

 > restart;
 > p,q := x^2+2*x+1, x^2-3*x+5:
 > f := proc()   solve(:-p + :-q = 0,{x}) end proc:
 > f();
 (1)
 >

Download NoArguments.mw

## x is a Vector...

The assignment x := LinearSolve(A, b) makes x a Vector (with parameter _t2), so it cannot be used as a range parameter. Replace it by v := LinearSolve(A, b), and don't forget to restart.

## Everything is allright:...

R2 is an 1x1-matrix, as to expect:

lprint(R2);
Matrix(1, 1, {(1, 1) = 44}, datatype = anything, storage = rectangular, order = Fortran_order, shape = [])

## D-operator...

Make an operator that for multiplies the identity function with the derivative:

 > restart;
 > xD := f ->(x->x)*D(f);
 (1)
 > (xD@@2)(f)(y);
 (2)
 >

Download D_operator.mw

## replace "sum" by "add"...

Because x and y are constants, there is no reason to try to calculate the sum symbolically.

`add(binomial(y, i)*(1/3)^i*(2/3)^(y-i)*(add(binomial(x, j)*(1/3)^j*(2/3)^(x-j), j = i+1 .. x)), i = 0 .. y);`

## Colorbar...

Make the colorbar as a separate 3D-plot, viewed from above (P2 in the worksheet)

restart; with(plots):
X2 := <seq(i,i=1..25)>:
X3 := <seq(2*i,i=1..25)>:
zz := <seq(-i^2+23*i+53,i=1..25)>:
M,m := max(zz),min(zz):
P1 := pointplot3d(X2, X3, zz, symbol=solidcircle, symbolsize=20, shading=zhue, orientation=[75,60,0]):
P2 := plot3d( y, x=0..20, y=m..M, style=patchnogrid, shading=zhue,orientation=[-90,0,0],tickmarks=[0,default,0], labels=["","zz",""],scaling=constrained ):
display( Array([P1,P2]) );

## Fieldplot...

If you don't want to plot (a) solution curve(s), use dfieldplot:

dfieldplot(DE3, [y(x), z(x)], x = 0 .. 3, y = 0 .. 2, z = -4 .. 4, arrows = medium, dirgrid=[20,20]);

## Construction of a set...

If you use a loop to place (some) answers in a set, it is more efficient to use a sequence as intermediate:

 > restart;
 > S := NULL: #empty sequence
 > for i to 5 do S := S,i end do:
 > S1 := {S}; #makes a set from the sequence S
 (1)
 >

Download Makeset.mw

## Parametrisize...

To interchange the horizontal and the vertical axis, make F13 a parametrisized plot:

F13 := plot([-0.2e-1*sin(6*Pi*y),y, y = 0.25e-1*L .. .475*L], scaling = constrained):

## x=X not needed...

The x=X substitution is not necessary:

Diameters := unapply(subs(Data, piecewise(x<L/2, d0 ,x<2/3*L, 2*d0 ,x>2/3*L, 1.5*d0)),x);
 1 2 3 4 5 6 7 Last Page 1 of 27
﻿