Model involving SOD of two variables

In summary, two differential equations can be used to model the velocity of a river stream as a function of location in the cross-section of the river. By making assumptions and approximations, the equations can be simplified to two functions: v(y) and v(z). However, the challenge lies in finding the general solution for v(y,z) by combining the solutions for v(y) and v(z). Attempts to solve for the solution using Mathematica have resulted in identical solutions for v(y), indicating a possible error in the approach. Further exploration and understanding of differential equations is needed to solve for the general solution.
  • #1
lol_nl
41
0

Homework Statement


I'm going to model the velocity of a river stream v(y,z) as a function of the location (y,z) in the cross-section of the river. Here y represents the distance from one of the shores and z the depth of the river.
I have done measurements of the depth z on different locations y, so I can find an approximation for a function z(y) and hence find the profile of the river.
I have also done measurements of the velocity on different points in the river, so now I wish to find a function v(y,z) that describes the speed at every point in the cross-section. This will give me a way to find the average speed by integrating over the function for the cross-area.

Homework Equations


Basically, through a number of assumptions and approximations, the problem can be reduced to a set of two differential equations:

[itex]\eta_{y}\frac{\partial^{2} v(y,z)}{\partial y^2} + \eta_{z}\frac{\partial^{2} v(y,z)}{\partial z^2} = -\rho g Sin(\alpha)[/itex]

By assuming by turns [itex]\eta_{y} = 0[/itex] and [itex]\eta_{z} = 0[/itex] I can find functions v(y) and v(z) that describe a kind of an average velocity for any given y or given z.
The problem now is the integration of these two into one function v(y,z).

Given boundary conditions:
* v(0,z) = 0
* v(W,z) = 0 -> W represents max width
* v(y,0) = 0 -> (y,0) is a point on the bottom
* [itex]\frac{\partial v}{\partial z}[H] = 0 [/itex] -> change of speed is zero in for the maximum height H.

The Attempt at a Solution


I've found solved the equations for the assumptions [itex]\eta_{y} = 0[/itex] and [itex]\eta_{z} = 0[/itex] and using the boundary conditions found:

[itex]v(y) = \frac{\rho g Sin[\alpha]}{2\eta_{y}} (W-y)y[/itex]

[itex]v(z) = \frac{\rho g Sin[\alpha]}{2\eta_{z}} (2H-z)z[/itex]

The question now is whether there is an easier way to find v(y,z) by directly solving it mathematically, possibly by combining solutions for v(y) and v(z)? I can see that a linear combination of the two would work, but I can't see how I can find the general solution of the function.

I have tried to find a solution using Mathematica, but by filling in the boundary conditions it reduced to the function v(y) that is independent of z. Here is what my code in Mathematica more or less looks like:

Code:
DSolve[{a*D[f[y, z], {y, 2}] + b *D[f[y, z], {z, 2}] == -\[Rho]*g*
    Sin[\[Alpha]]}, f, {y, z}]

{{f -> Function[{y, z}, -((g y^2 \[Rho] Sin[\[Alpha]])/(2 a)) + 
     C[1][(Sqrt[-a b] y)/a + z] + C[2][-((Sqrt[-a b] y)/a) + z]]}}

v[y_, z_] := -((g y^2 \[Rho] Sin[\[Alpha]])/(2 a)) + 
   c1 ((Sqrt[-a b] y)/a + z) + c2 (-((Sqrt[-a b] y)/a) + z);
r1 := v[0, z];
r2 := v[W, z];
r3 := v[y, 0];
r4 := D[v[y, z], z];
{r1, r2, r3, r4}

{c1 z + c2 z, 
 c2 (-((Sqrt[-a b] W)/a) + z) + c1 ((Sqrt[-a b] W)/a + z) - (
  g W^2 \[Rho] Sin[\[Alpha]])/(2 a), (Sqrt[-a b] c1 y)/a - (Sqrt[-a b] c2 y)/
  a - (g y^2 \[Rho] Sin[\[Alpha]])/(2 a), c1 + c2}

Clear[c1, c2]
Solve[{r1 == 0, r2 == 0}, {c1, c2}] 
Solve[{r3 == 0, r4 == 0}, {c1, c2}]
Solve[{r1 == 0, r3 == 0}, {c1, c2}]
Solve[{r2 == 0, r3 == 0}, {c1, c2}]

{{c1 -> (g W \[Rho] Sin[\[Alpha]])/(4 Sqrt[-a b]), 
  c2 -> -((g W \[Rho] Sin[\[Alpha]])/(4 Sqrt[-a b]))}}

{{c1 -> (g y \[Rho] Sin[\[Alpha]])/(4 Sqrt[-a b]), 
  c2 -> -((g y \[Rho] Sin[\[Alpha]])/(4 Sqrt[-a b]))}}

{{c1 -> (g y \[Rho] Sin[\[Alpha]])/(4 Sqrt[-a b]), 
  c2 -> -((g y \[Rho] Sin[\[Alpha]])/(4 Sqrt[-a b]))}}

{{c1 -> -((-b g W^2 \[Rho] Sin[\[Alpha]] + b g W y \[Rho] Sin[\[Alpha]] + 
     Sqrt[-a b] g y z \[Rho] Sin[\[Alpha]])/(4 a b z)), 
  c2 -> -((-Sqrt[-a b] g W^2 \[Rho] Sin[\[Alpha]] + 
     Sqrt[-a b] g W y \[Rho] Sin[\[Alpha]] + a g y z \[Rho] Sin[\[Alpha]])/(
    4 a Sqrt[-a b] z))}}

Clear[c1, c2]
c1 := (g W \[Rho] Sin[\[Alpha]])/(4 Sqrt[-a b]);
c2 := -((g W \[Rho] Sin[\[Alpha]])/(4 Sqrt[-a b]));
Simplify[v[y, z]]

(g (W - y) y \[Rho] Sin[\[Alpha]])/(2 a)

c1 := -((-b g W^2 \[Rho] Sin[\[Alpha]] + b g W y \[Rho] Sin[\[Alpha]] + 
    Sqrt[-a b] g y z \[Rho] Sin[\[Alpha]])/(4 a b z));
c2 := -((-Sqrt[-a b] g W^2 \[Rho] Sin[\[Alpha]] + 
    Sqrt[-a b] g W y \[Rho] Sin[\[Alpha]] + a g y z \[Rho] Sin[\[Alpha]])/(
   4 a Sqrt[-a b] z));
Simplify[v[y, z]]

(g W (W - y) \[Rho] Sin[\[Alpha]])/(2 a)

In both cases I obtain exactly the solution for v(y).
 
Physics news on Phys.org
  • #2
Have not gone through it in detail but the first thing I notice is that you seem to be mis-interpreting the line:

[tex]\left\{\left\{f\to \text{Function}\left[\{y,z\},-\frac{g y^2 \rho \text{Sin}[\alpha ]}{2 a}+C[1]\left[\frac{\sqrt{-a b} y}{a}+z\right]+C[2]\left[-\frac{\sqrt{-a b} y}{a}+z\right]\right]\right\}\right\}[/tex]

The C[1] and C[2] are function names and not constants c1 and c2 multiplied by those values in brackets. You realize that or no? So the first one is an arbritrary function of a single variable named C1 at the value given in brackets. Or am I insulting your intelligence by saying that? Sorry if so.
 
  • #3
Ah, thanks, I actually didn't know that! Indeed, now the solution seems to make more sense to me. It's identical to the wave function except that it is non-homogeneous. Now I presume I can find the functions C[1] and C[2] in the same way as the wave function and then add the factor [itex] -\frac{gy^2\rho Sin[\alpha]}{2\eta_{y}} [/itex] to it?

EDIT: I have simply no idea how to solve for the functions C[1] and C[2] using the boundary conditions. I looked up the solution to the wave equation but the approach there is quite different since it is possible to use the boundary conditions of amplitude and speed at t=0 for x=0. I lack knowledge of differential equations to solve for the functions. Also, if I try to insert the boundary conditions in DSolve in Mathematica, it doesn't give me any solution.
 
Last edited:
  • #4
lol_nl said:
EDIT: I have simply no idea how to solve for the functions C[1] and C[2] using the boundary conditions. I looked up the solution to the wave equation but the approach there is quite different since it is possible to use the boundary conditions of amplitude and speed at t=0 for x=0. I lack knowledge of differential equations to solve for the functions. Also, if I try to insert the boundary conditions in DSolve in Mathematica, it doesn't give me any solution.

Yeah, me neither. How about solving it numerically? First consider a simplified version:

[tex]\frac{\partial^2 v}{\partial y^2}+\frac{\partial^2 v}{\partial z^2}=-1/2,\quad 0\leq y\leq W,\quad 0\leq z\leq H[/tex]

[tex]\begin{array}{cc} v(0,z)=0 & v(W,z)=0 \\
v(y,0)=0 & \frac{\partial v}{\partial z}\biggr|_{z=H}=0
\end{array}
[/tex]

Or something simple like that. So I'll set up a grid say for now 10x10, do all the difference equations on it with a spacing of one, then solve for all the internal points so that's what 64 linear equations in 64 variables. Alright, I did this quick so not entirely confident of the code but the back-substitution on the results using a sample point in the grid are close to -1/2 which is the first numeric result and the second result is the derivative with respect to z along the top edge at a select point. It's -0.07. Not zero but pretty close to what we want. So then maybe the code is workable so if you want, you can start adding complexity to the PDE and make the grid spacing smaller. When you're done with that, it's not then hard to integrate the interpolation function as you indicated above.

Code:
In[837]:=
Remove[v]
maxv = 10; 

myary = Array[Subscript[v, #1, #2] & , {maxv, maxv}]; 

For[j = 1, j <= maxv, j++, {Subscript[v, 1, j] = 0; Subscript[v, j, 1] = 0; 
     Subscript[v, j, maxv] = 0; Subscript[v, maxv, j] = Subscript[v, maxv - 2, j]; }]; 

myeqns = Flatten[Table[Subscript[v, n, j + 1] + Subscript[v, n, j - 1] + 
       Subscript[v, n - 1, j] + Subscript[v, n + 1, j] - 4*Subscript[v, n, j] == -0.5, 
     {n, 2, maxv - 1}, {j, 2, maxv - 1}]]; 

myvars = Flatten[Table[Subscript[v, n, j], {n, 2, maxv - 1}, {j, 2, maxv - 1}]]; 

mysol = First[Solve[myeqns, myvars]]; 

For[n = 2, n <= maxv - 1, n++, For[j = 2, j <= maxv - 1, j++, 
     Subscript[v, n, j] = Subscript[v, n, j] /. mysol; ]; ]; 

mydatapoints = Flatten[Table[{j, n, myary[[n,j]]}, {n, 1, maxv}, {j, 1, maxv}], 1]; 

they = 2.6; 
thez = 3.8; 
thev = Interpolation[mydatapoints]; 
vy2[y_, z_] = D[thev[y, z], {y, 2}]
vz2[y_, z_] = D[thev[y, z], {z, 2}]
N[vy2[they, thez] + vz2[they, thez]]

vz1[y_, z_] = D[thev[y, z], z]
vz1[6.5, 10]

Out[849]=
InterpolatingFunction[][y, z]

Out[850]=
InterpolatingFunction[][y, z]

Out[851]=
-0.5060005012005363

Out[852]=
InterpolatingFunction[][y, z]

Out[853]=
-0.07272665510909895

I can do a plot of the solution via:

Plot3D[thev[x,y],{x,1,10},{y,1,10}]

which is below. Note at the top edge with respect to z, it's almost flat which I assume is the first partial set to zero there.
 

Attachments

  • myriverplot.jpg
    myriverplot.jpg
    21.8 KB · Views: 382
Last edited:
  • #5
Thanks a lot. The graph indeed shows the expected result, with the velocity highest midway between the shores and decreasing in the neighbourhood of the shores and bottom.
I'm going to complete it by adding extending the formula and making the grid larger. Also, since I have real data for a number of points (around 20 I believe), I could insert those in my grid and then try to find an Interpolation through all the points. I'll show some results if I have some more.
 

1. What is SOD in the context of a model involving two variables?

SOD stands for Sum of Squared Deviations and it is a measure of the variability of a data set. In a model involving two variables, SOD is used to analyze the relationship between the two variables and to determine the strength of the relationship.

2. How is SOD calculated in a model involving two variables?

SOD is calculated by finding the difference between each data point and the mean of the data set, squaring each difference, and then adding all the squared values together. This value represents the sum of the squared deviations for the data set.

3. What is the purpose of using SOD in a model involving two variables?

The purpose of using SOD in a model involving two variables is to quantify the variability of the data and to determine the goodness of fit of the model. A lower SOD value indicates a better fit between the variables, while a higher SOD value indicates a weaker relationship.

4. How does SOD help in interpreting the results of a model involving two variables?

SOD helps in interpreting the results of a model involving two variables by providing a numerical measure of the strength of the relationship between the variables. It also allows for comparison between different models and helps in identifying the most appropriate model for the data set.

5. Can SOD be used to determine causation in a model involving two variables?

No, SOD cannot be used to determine causation in a model involving two variables. It only measures the strength of the relationship between the variables, but it does not imply a cause-and-effect relationship. Other factors and variables must be considered in order to establish causation.

Similar threads

  • Differential Equations
Replies
13
Views
2K
  • Differential Equations
Replies
2
Views
917
  • Advanced Physics Homework Help
Replies
19
Views
703
  • Calculus and Beyond Homework Help
Replies
34
Views
1K
  • Differential Equations
Replies
2
Views
2K
  • Differential Equations
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
3
Views
488
  • Linear and Abstract Algebra
Replies
1
Views
618
  • Advanced Physics Homework Help
2
Replies
36
Views
2K
  • Differential Equations
Replies
3
Views
1K
Back
Top