## 60 Reputation

3 years, 351 days

## How to numericaly solve a system of diff...

Maple 2018

I'm trying to obtain the dynamical response of a simply-supported beam with a cantilever extension, coupled to a spring-mass system. In mathematical terms, this system is ruled by three PDEs (relative to each bare part of the main structure) and one ODE (relative to the spring-mass system). I think my mathemical model is finely formulated, but Maple keeps telling me this:

`Error, (in pdsolve/numeric/process_IBCs) improper op or subscript selector`

I believe it is because my PDEs depend on "x" and "t", while the ODE depends solely on "t". I have tried to transform my ODE into a "PDE", making it also dependent of "x", but without imposing any boundary conditions relative to "x". However, after this Maple points a new error message:

`Error, (in pdsolve/numeric) initial/boundary conditions must be defined at one or two points for each independent variable`

Could someone help me finding a solution? My algorythm in shown in the attached file below.

Worksheet.mw

## Numeric solve of a system with coupled p...

Maple 2018

I am studying the motion of a beam coupled to piezoelectric strips. This continuous system is modelled by two DE:

`YI*diff(w(x,t), x\$4)-N[0]*cos(2*omega*t)*diff(w(x,t), x\$2)+c*diff(w(x,t), t)+`&rho;A`*diff(w(x,t), t\$2)+C[em,m]*v(t) = 0;`

And:

`C[p]*diff(v(t), t)+1/R[l]*v(t) = C[em,e]*(D[1,2](w)(0,t)-D[1,2](w)(ell,t));`

where "w(x,t)" stands for the beam's vibration and "v(t)" means the electric voltage, which is constant throught the beam. I would like to numerically solve both DE simultaneosly, but maple will not let me do it. I would like to know why. I am getting the following error:

`Error, (in pdsolve/numeric/process_PDEs) number of dependent variables and number of PDE must be the same`

I suppose it is because "w(x,t)" depends on "x" and "t", while "v(t)" depends solely on time, but I am not sure. Could someone help me out? Here is my current code:

```restart:
with(PDEtools):
declare(w(x,t), v(t)):

YI*diff(w(x,t), x\$4)-N[0]*cos(2*omega*t)*diff(w(x,t), x\$2)+c*diff(w(x,t), t)+`&rho;A`*diff(w(x,t), t\$2)+C[em,m]*v(t) = 0;
pde1:= subs([YI = 1e4, N[0] = 5e3, c = 300, omega = 3.2233993, C[em,m] = 1], %):
ibc1:= w(0,t) = 0, D[1,1](w)(0,t) = 0, w(ell,t) = 0, D[1,1](w)(ell,t) = 0, D[2](w)(x,0) = 0, w(x,0) = sin(Pi*x/ell):

C[p]*diff(v(t), t)+1/R[l]*v(t) = C[em,e]*(D[1,2](w)(0,t)-D[1,2](w)(ell,t));
pde2:= subs([C[p] = 10, R[l] = 1000, C[em,e] = 1, ell = 5], %):
ibc2:= v(0) = 0:

pdsolve({pde1, pde2}, {ibc1, ibc2}, numeric);```

Thanks.

## Finding roots of a complex trigonometric...

Maple

I have the following trigonometric expression:

`detA:= -(-((-16*cosh(beta*`&ell;`*xi[2])*sinh(beta*`&ell;`)+16*sinh(beta*`&ell;`*xi[2])*cosh(beta*`&ell;`))*sinh(beta*xi[1]*`&ell;`)+(-16*sin(beta*`&ell;`*xi[2])*cos(beta*`&ell;`)+16*cos(beta*`&ell;`*xi[2])*sin(beta*`&ell;`))*sin(beta*xi[1]*`&ell;`)-(16*(-sin(beta*`&ell;`*xi[2])*sin(beta*`&ell;`)+cosh(beta*`&ell;`*xi[2])*cosh(beta*`&ell;`)-sinh(beta*`&ell;`*xi[2])*sinh(beta*`&ell;`)-cos(beta*`&ell;`*xi[2])*cos(beta*`&ell;`)))*(cos(beta*xi[1]*`&ell;`)-cosh(beta*xi[1]*`&ell;`)))*sin(beta*`&ell;`*xi[2])+16*cos(beta*`&ell;`*xi[2])*((sin(beta*`&ell;`*xi[2])*sin(beta*`&ell;`)-cosh(beta*`&ell;`*xi[2])*cosh(beta*`&ell;`)+sinh(beta*`&ell;`*xi[2])*sinh(beta*`&ell;`)+cos(beta*`&ell;`*xi[2])*cos(beta*`&ell;`))*sin(beta*xi[1]*`&ell;`)+(sin(beta*`&ell;`*xi[2])*cos(beta*`&ell;`)-cos(beta*`&ell;`*xi[2])*sin(beta*`&ell;`))*(cos(beta*xi[1]*`&ell;`)-cosh(beta*xi[1]*`&ell;`))))*sinh(beta*`&ell;`*xi[2])+16*cosh(beta*`&ell;`*xi[2])*((sin(beta*`&ell;`*xi[2])*sin(beta*`&ell;`)-cosh(beta*`&ell;`*xi[2])*cosh(beta*`&ell;`)+sinh(beta*`&ell;`*xi[2])*sinh(beta*`&ell;`)+cos(beta*`&ell;`*xi[2])*cos(beta*`&ell;`))*sinh(beta*xi[1]*`&ell;`)+(sinh(beta*`&ell;`*xi[2])*cosh(beta*`&ell;`)-cosh(beta*`&ell;`*xi[2])*sinh(beta*`&ell;`))*(cos(beta*xi[1]*`&ell;`)-cosh(beta*xi[1]*`&ell;`)))*sin(beta*`&ell;`*xi[2])-(16*(cos(beta*`&ell;`*xi[2])*cosh(beta*`&ell;`*xi[2])-1))*((sin(beta*`&ell;`*xi[2])*cos(beta*`&ell;`)-cos(beta*`&ell;`*xi[2])*sin(beta*`&ell;`))*sinh(beta*xi[1]*`&ell;`)+sin(beta*xi[1]*`&ell;`)*(sinh(beta*`&ell;`*xi[2])*cosh(beta*`&ell;`)-cosh(beta*`&ell;`*xi[2])*sinh(beta*`&ell;`)))`

where:

```xi1_val:= 0.05:
xi2_val:= 0.10:
ell_val:= 12:

```

I want to determine the roots "beta[1]..beta[N]" of this expression. For this, I have tried:

```evalf(subs([xi[1] = xi1_val, xi[2] = xi2_val, `&ell;` = ell_val], detA)):
sol_beta:= Student[Calculus1][Roots](%, 1e-5..15);
```

which yields:

`sol_beta:= [10.4719755]`

However, I'm pretty sure there is another root before this, as we can see by the plot of the function:

```plot(subs([xi[1] = xi1_val, xi[2] = xi2_val, `&ell;` = ell_val], detA), beta = 5.2..5.3,
axes = boxed,
gridlines = true,
labels = [typeset(beta), typeset(`det A`)],
size = [0.5,0.5]
);```

it is clear that there is a root about beta = 5.2359, which is not captured by "Roots" function.

Can someone help me build an algorythm that will get all roots wihtin a given interval? Particularly, I need it to be an efficient routine, because I will later vary parameters "xi[1]" and "xi[2]" and make a surface with the solutions. So I will run it several times.

## System of differential equations from th...

Maple

I need to solve a system of differential equations, which have been obtained from the method of multiple scales. However, for some reason Maple returns an error and will not give a solution. Could someone help me find a solution? The associated filed is attached.

File.mw

## Exporting two plots as one single EPS fi...

Maple 2018

I am developping an algorythm in which I need to obtain a 3D plot and its respective colorbars. As far as I know, Maple does not have a function with includes such a colorbar automatically (like Matlab, for example). So, I have had to get 3D plot and colorbar separatelly, as independent plots. It has worked fine, but now I need to export such graphics as EPS files, which imply merging them as a single graphic.

Here is a small example, where I try to put such graphics inside a table for then exporting it as EPS:

```restart:

with(plots):
with(DocumentTools):

graph:= plot3d(x^2+y^2, x = -10..10, y = -10..10, colorscheme = ["zgradient", ["Red","Blue"]]):