## 45 Reputation

1 years, 240 days

## thank you very much !...

@mmcdara

d1 is a centered divided difference approximation of diff(u, x\$3) at "point" [i+1/2, j];not an approximation of the laplacian of u at [i, j]

yes you are right, I am using a 2D finite volume code and I need to evaluate on the faces of given cell  grad(laplacian(u)).n*length_of_face where n is the outward normal. On the right face of a cell located at i+1/2,j I need to evaluate diff(u,x,x,x) and diff(u,y,y,x) my comment was about the first part only.

Could you please comment on the syntax you used for the definition of tau ? I do not understand the double right arrow and the *~ operation.

Thank you again

## thank you !...

thank you very much !

## How to assign alpha_n to be symbolically...

Does anyone have an  idea on how to assign symbolically a series of values, say alpha_n, to be the (infinite number of) roots of a Bessel function ?

Cheers

## Inversion theorem for Laplace transforms...

I am trying to solve the heat conduction problem in an axisymmetric cylindrical bar with Laplace transforms, for which an analytical solution exists. I end up finding the right solution in Laplace space but I can't compute its inverse as I need to use the inversion theorem and compute residuals at poles. It implies that I have to assign a series of values, say alpha_n to be the roots of the Bessel function (of the first kind or order 0) J_0.  Is there a way to do that ?  Here is my maple page that shows the problem     Originally K_1, renamed K_1~:   Involved in the following expressions with properties     constant*K_1 assumed RealRange(Open(0),infinity)   also used in the following assumed objects   [constant*K_1] assumed RealRange(Open(0),infinity)

# Equations for c in physical space, we want to solve the heat equation in an axi-symmetric cylindrical bar  (1)   (2)    (3) # Apply initial condition to simplify the expression  (4)   (5)

# Boundary condition at r = a  (6)

# One can directly inject bc_right in the solver dsolve but we choose here not to  (7)   (Bessel of the second kind of order 0 tends to infinity as r->0)   (8)

#Apply now boundary condition at r=a given above  (9)  (10)  (11)   (12)  (13) and is thus incomplete   (14)  (15)   (16)

# Inversion theorem for the Laplace transforms  (17)

# Pole at lamba = 0   (18)   (19)

# Pole at lambda = -K_1 alpha_n for n = 1,... N which are the N zeros of I_0(sqrt(a*lambda/K_1)) where alpha_n are the zeros of J_0(a*alpha_n) # One needs to assign the alpha_n to the roots of BesselI_0 ## @dharr  I see you have now moved t...

I see you have now moved to Laplace on the other thread, which is how I would have done it

Yes I also think that this is the right way to go.

Here  means differentiate with respect to the first variable, and (a,t) is the point to avaluate at. For example

Thank you, how would you specify second order derivative with respect to the first variable with this notation ?

cheers,

Can

## Thanks...

`simplified_PDEL1 := eval(PDEL1,ic1);`

Thank you, it was indeed a syntax error. Removing the brackets also worked.

And pdsolve should be used for PDEs; whereas dsolve is covering ODEs.

I am using Laplace transforms to end up with an ode to solve instead of the original pde.

Cheers,

## @Rouben Rostamian  Applying your su...

```restart;
with(Physics);
vars := f(x);
sys_ode := diff(xhat(vars), f(x)) = a_1 + a_3*x, diff(yhat(vars), f(x)) = a_2 - a_4*y + f(x), diff(uhat(vars), f(x)) = a_3*u + (2*u)*a_4, diff(vhat(vars), f(x)) = a_4*v + u*diff(f(x), x);

initvars := 0;
ics := xhat(initvars) = x, yhat(initvars) = y, uhat(initvars) = u, vhat(initvars) = v;

dsolve({ics, eval(sys_ode)}, [xhat(f(x)), yhat(f(x)), uhat(f(x)), vhat(f(x))]);

Error, (in dsolve) found the following equations not depending on the unknowns of the input system:
{uhat(0) = u, vhat(0) = v, xhat(0) = x, yhat(0) = y,
(D(uhat))(f(x)) = a_3*u+2*a_4*u,
(D(vhat))(f(x)) = a_4*v+u*(diff(f(x), x)),
(D(xhat))(f(x)) = a_3*x+a_1,
(D(yhat))(f(x)) = a_2-a_4*y+f(x)}
```

If I dont charge the module physics then I cannot go futher than

```vars := f(x);
sys_ode := diff(xhat(vars), f(x)) = a_1 + a_3*x, diff(yhat(vars), f(x)) = a_2 - a_4*y + f(x), diff(uhat(vars), f(x)) = a_3*u + (2*u)*a_4, diff(vhat(vars), f(x)) = a_4*v + u*diff(f(x), x);```

as I get

```Error, invalid input: diff received f(x), which is not valid for its 2nd argument
```

Any idea on how to do ?

Cheers,

Can

## @Rouben Rostamian  Thank you for yo...

Is there a reason for looking at xhat as a function of all those variables?  Why not take xhat to be a function of a_1 only.  The solution will involve the remaining variables as parameters.

Yes, along the example given before, I was also trying to solve the following with maple:

```with(Physics);
vars := x, y, u, v, a_1, a_2, a_3, a_4, f(x);
sys_ode := diff(xhat(vars), f(x)) = a_1 + a_3*x, diff(yhat(vars), f(x)) = a_2 - a_4*y + f(x), diff(uhat(vars), f(x)) = a_3*u + (2*u)*a_4, diff(vhat(vars), f(x)) = a_4*v + u*diff(f(x), x);
vars := x, y, u, v, a_1, a_2, a_3, a_4, f(x)
initvars := x, y, u, v, a_1, a_2, a_3, a_4, 0;
ics := xhat(initvars) = x, yhat(initvars) = y, uhat(initvars) = u, vhat(initvars) = v;
dsolve({ics, eval(sys_ode)}, [xhat, yhat, uhat, vhat]);```

it's an ode with respect to f(x) treaten as a derivative variable but f(x) and its diff(f,x) (its  derivative with respect to x) appears also on the RHS.

The derivative with respect to f(x) is writen as D_9 (as it differentiates with respect to the 9th argument of the variable-list) and does not match the argument f(x) that dsolve seems to be looking for. Hence (I guess) the error:

```Error, (in dsolve) found the following equations not depending on the unknowns of the input system:
{uhat(x, y, u, v, a_1, a_2, a_3, a_4, 0) = u,
vhat(x, y, u, v, a_1, a_2, a_3, a_4, 0) = v,
xhat(x, y, u, v, a_1, a_2, a_3, a_4, 0) = x,
yhat(x, y, u, v, a_1, a_2, a_3, a_4, 0) = y,
(D(uhat))(x, y, u, v, a_1, a_2, a_3, a_4, f(x)) = a_3*u+2*a_4*u,
(D(vhat))(x, y, u, v, a_1, a_2, a_3, a_4, f(x)) = a_4*v+(diff(f(x), x))*u,
(D(xhat))(x, y, u, v, a_1, a_2, a_3, a_4, f(x)) = a_3*x+a_1,
(D(yhat))(x, y, u, v, a_1, a_2, a_3, a_4, f(x)) = a_2-a_4*y+f(x)}
```

 Page 1 of 1
﻿