New answers tagged

2

In the Navier-Stokes equations, you can't prescribe the pressure on the boundary (or part of it). That's just not a physical thing, nor mathematically correct. The only thing you can prescribe is the traction, i.e., the normal component of the stress, which is given by $$ \mathbf t = (-\nu \nabla \mathbf u + pI) \mathbf n. $$ For example, you could ...


2

Consider the following taylor series expansion of $sin(y)/sin(x)-1$ at $y=x$, with $δ=y-x$: $$sin(y)/sin(x)-1=δcot(x)-\frac12δ^2-\frac16δ^3cot(x)+\frac1{24}δ^4+\frac1{120}δ^5cot(x)...$$ Thanks Wolfram! https://www.wolframalpha.com/input/?i=series+sin%28y%29%2Fsin%28x%29+y+%3D+x This only requires you to compute a single trigonometric operation cot(x) and ...


2

I think you can understand this using the concept of a modified equation. As you have shown, your discretization $$ \frac{u_i - u_{i-1}}{h} + f(x) = 0 $$ is an approximation of your differential equation $u_x + f(x) = 0$ with accuracy $\mathcal{O}(h)$. Now consider the Taylor expansion of your exact solution $$ u(x_{i-1}) = u(x_i) - h u_x(x_i) + \frac{1}{2} ...


3

You need to use the so called Gauss–Jacobi quadrature with $\alpha = 0$ and $\beta = -\frac{1}{2}$. If you look at the error term, you see that you can integrate exactly for a degree up to $2n-1$ with a $n$ points scheme. EDIT to truly answer your question. You want to use this theorem about Gaussian quadrature, theorem 3.6.12 in [1] for a book reference. In ...


0

The sum of squares should add up to what MATLAB says it adds up to, that is for $F:\mathbb{R}^m\to\mathbb{R}^n$ $$ r(x) = \sum\limits_{i=1}^{n}(F_i(x))^2$$ It is then easy to compute the gradient of $r$ as $$\nabla r(x) = J(x)^TF(x) $$, where $J$ is the Jacobian of $F$. Let us now try to reverse engineer if this is indeed what MATLAB means. Since it is not ...


0

Firstly, in more than one dimensional case, one prescribes with homogeneous Neumann boundary condition the zero value of the derivative only in one direction, e.g. the temperature can change along the boundary. Secondly, the time derivative can be nonzero there, and, moreover, even in 1D case, the flux can be nonzero in an arbitrary small neighborhood of ...


2

It depends on the equation you are solving. For example, consider the following heat equation with a source term: $$ \frac{dT}{dt} - \nabla^2 T = S$$ If $S \neq 0$, then you have a source term that changes the value of the temperature as time evolves. Consequently, even if your initial condition is $T(\textbf{x},t)=0$, your temperature will increase because ...


Top 50 recent answers are included