<p>You aren't supposed to do link only answers, but that is really all this questions deserves. Did you look on Google? I did.</p>

<p><a href="https://people.sc.fsu.edu/~jburkardt/m_src/shallow_water_1d/shallow_water_1d.html" rel="nofollow noreferrer">https://people.sc.fsu.edu/~jburkardt/m_src/shallow_water_1d/shallow_water_1d.html</a></p>

<p><a href="http://personalpages.manchester.ac.uk/staff/paul.connolly/teaching/practicals/shallow_water_equations.html" rel="nofollow noreferrer">http://personalpages.manchester.ac.uk/staff/paul.connolly/teaching/practicals/shallow_water_equations.html</a></p>

<p><a href="http://sanders.eng.uci.edu/matlabcodes.html" rel="nofollow noreferrer">http://sanders.eng.uci.edu/matlabcodes.html</a></p>

<p>Those were 3 of the first 9 hits on google, and they all have code examples. There is no close option due to lack of effort, but I'll give it a downvote. </p>

CC BY-SA 3.0
2016-12-14T02:17:48.330Z
2016-12-14T02:17:48.330Z
kingledion
<p>I do not know how to solve the shallow water equations in the matrix form in MATLAB. I didn't find anything useful on the internet. I have the specific mathematical equations to solve (please see the picture below) and I must write in MATLAB. If someone has examples, I would appreciate it.</p>

<p><span class="math-container">$$\frac{\partial u}{\partial t} - f\nu + g \frac{\partial \eta}{\partial x} = 0$$</span></p>
<p><span class="math-container">$$\frac{\partial \nu}{\partial t} + fu + g\frac{\partial \eta}{\partial y}=0$$</span></p>
<p><span class="math-container">$$\frac{\partial \nu}{\partial t}+H\big(\frac{\partial u}{\partial x} + \frac{\partial \nu}{\partial y}\big)=0$$</span></p>

CC BY-SA 3.0
2016-12-14T00:03:59.203Z
Have you tried coding it yourself? What you are asking for is a solver, but you need boundary conditions and initial conditions to solve it. 
Try the Runge-Kutta integration in time. For your spatial derivatives, you may want a finite differencing method. http://mathworld.wolfram.com/Runge-KuttaMethod.html
BarocliniCplusplus
CC BY-SA 3.0
2016-12-14T03:20:30.473Z
https://lmgtfy.com/?q=shallow+water+equations+in+the+matrix+form+in+MATLAB
arkaia
CC BY-SA 4.0
2021-02-05T15:48:06.473Z
This certainly sounds like a homework question I had at university too... you learn by doing, not from someone else's work :-)
JeopardyTempest
<oceanography><models><homework><matlab>
Where can I find a shallow-water solver in MATLAB?
Andriani G.
# Where can I find a shallow-water solver in MATLAB?

(Asked by: username_0 on 2016-12-13)

I do not know how to solve the shallow water equations in the matrix form in MATLAB. I didn't find anything useful on the internet. I have the specific mathematical equations to solve (please see the picture below) and I must write in MATLAB. If someone has examples, I would appreciate it.

$$\frac{\partial u}{\partial t} - f\nu + g \frac{\partial \eta}{\partial x} = 0$$

$$\frac{\partial \nu}{\partial t} + fu + g\frac{\partial \eta}{\partial y}=0$$

$$\frac{\partial \nu}{\partial t}+H\big(\frac{\partial u}{\partial x} + \frac{\partial \nu}{\partial y}\big)=0$$

**Tags:** oceanography, models, homework, matlab

> **Comments:**
> **username_1**: Have you tried coding it yourself? What you are asking for is a solver, but you need boundary conditions and initial conditions to solve it.  Try the Runge-Kutta integration in time. For your spatial derivatives, you may want a finite differencing method. http://mathworld.wolfram.com/Runge-KuttaMethod.html  
> **username_2**: https://lmgtfy.com/?q=shallow+water+equations+in+the+matrix+form+in+MATLAB  
> **username_3**: This certainly sounds like a homework question I had at university too... you learn by doing, not from someone else's work :-)  

---

## 1 answers

### Answer by username_4 on 2016-12-14. Score: 4

You aren't supposed to do link only answers, but that is really all this questions deserves. Did you look on Google? I did.

<https://people.sc.fsu.edu/~jburkardt/m_src/shallow_water_1d/shallow_water_1d.html>

<http://personalpages.manchester.ac.uk/staff/paul.connolly/teaching/practicals/shallow_water_equations.html>

<http://sanders.eng.uci.edu/matlabcodes.html>

Those were 3 of the first 9 hits on google, and they all have code examples. There is no close option due to lack of effort, but I'll give it a downvote.


---

