Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
4

Both conservative and non-conservative Lax-Friedrichs schemes are identical. To see this, one injects the expression of the numerical flux in $(\text B)$, which gives $(\text A)$. When considering smooth solutions, one can either use $u_t + f'(u) u_x = 0$ or $u_t + f(u)_x = 0$ to develop numerical methods that will converge towards the strong solution. ...


3

The proposed values of $\chi$ in a) are correct. As done in this post, let us assume a perturbation of the form $u_j^n = \xi^n e^{\text i k j \Delta x}$, where $\xi = \text e^{\text i \omega \Delta t}$. Note that $\omega$ is a complex number, with real part $\omega_R$ and imaginary part $\omega_I$. Injecting this Ansatz in the time-stepping formula, Euler's ...


2

The operator norm of the euclidean norm gives the largest singular value $\sigma_1$, that is the largest diagonal entry in $\Sigma$ in the SVD $A=UΣV^T$. Per assumption this is smaller than $1$. Then the target matrix has a decomposition $$ I-A^TA=I-VΣ^2V^T=V(I-Σ^2)V^T $$ so that the singular values are inside the interval $[1-σ_1^2, 1-σ_n^2]\subset[0,1]$, ...


2

One thought: You could (assuming $f$ is nice, or that your approximation to it is nice) take the expression $$ H(x) = \int_0^a \frac{f(t)}{x - f(t)} \, \mathrm{d}t $$ and compute its derivative: $$ H'(x) = \int_0^a \frac{-f(t)}{(x - f(t))^2} \, \mathrm{d}t $$ which you can compute using the same numerical method you used to compute $H$ (at some point $x_0$...


2

We have $f(x)=L_f(x)+(ax+b)(x-x_1)(x-x_2)$, so $$\int_{-1}^1 f(x)dx-\int_{-1}^1 L_f(x)dx=a\int_{-1}^1 x(x-x_1)(x-x_2)dx+b\int_{-1}^1 (x-x_1)(x-x_2)dx.$$We just need to show this is $0$. Note $\int_{-1}^1x^ndx=0$ whenever $n$ is odd, and $\int_{-1}^1x^ndx=2\int_0^1x^ndx$ whenever $n$ is even. So we just need to check $$-\frac13 a(x_1+x_2)+b\left(\frac13+...


2

I see that your code is "fixed" now, but that it's using independent samples each time which make it regular monte carlo integration, not markov chain monte carlo integration. I hit the same problem you did so looked into it and it turns out that using the Metropolis algorithm for integration of a single term function like this is not straightforward. Like ...


2

You get an automatic Newton solver by using the BVP solver scipy.integrate.solve_bvp. You program your equation as usual def eqn(x,u): return [ u[1], (1+u[1]**2)**1.5*(T*u[0]+0.5*w*x*(x-L))/K ] def bc(u0,uL): return [ u0[0], uL[0] ] x = np.linspace(0,L,21); a = 0.1 u = [ a*x*(L-x), a*(L-2*x) ] res = solve_bvp(eqn, bc, x, u, tol = 1e-12); # the solution is ...


2

The interval is quite simply a consequence of following the standard proof of Picard-Lindelöf. As the Lipschitz constant is globally $L=1$, one does not need a restriction in the $y$ direction. In the next step, the Picard iteration is considered on $C([−ϵ,ϵ])$ where it has a Lipschitz constant as a mapping on a function space of $Lϵ=ϵ$, $$ \bigl|P[y_1](t)...


2

The value of $y'(a)$ depends on the method you use and the step size. However, because your system is linear, solving for $y'(a)$ is just a single step linear interpolation/extrapolation. Alternatively, you can keep track of $y'(a)$ during your iterations (since the DE is linear, every step of the approximate solution is going to look like $y=y_0+y'(a)y_1$)...


1

Yes, in $c_1h^p+c_2h^{p+1}+...$, the second term will dominate the first one for $h>\frac{c_1}{c_2}$. In numerical applications, the many steps required by smaller step sizes eventually accumulate floating point noise sufficient to dominate the truncation error, so that a loglog plot of error vs. step size has a V shape with a fuzzy left leg, a middle ...


1

Simplify to the autonomous case. For $k\ge 2$ denote $f^{(k)}[v_1,...,v_k]$ the $k$th derivative of $f$ in $(t,y)$ evaluated in directions $v_1,...,v_k$. Then the Taylor expansion of the exact solution $y(x+h)$ has the coefficients resp. involves the derivatives \begin{align} \dot y&=f\\ \ddot y&=f'\dot y=f'f\\ y^{(3)}&=f''[f,f]+f'^2f\\ y^{(4)} &...


1

Linear case In principle you could also a second solution $y_1$ with $y_1'(0)=1$. Then we know that any other solution is an affine combination, $y=y_0+λ(y_1-y_0)$. What your text does is to use $z=y_1-y_0$ from the beginning. The differential equation for $z$ is thus $$ z''=y_1''-y_0''=4(y_1-x)-4(y_0-x)=4(y_1-y_0)=4z $$ with initial condition $z'(0)=y_1'(...


1

You've correctly interpreted what you're supposed to do. Interestingly, the Picard–Lindelöf theorem simply states that there exists a unique solution to the IVP in some interval $[-\epsilon,\epsilon],$ where $\epsilon>0.$ Given that (and given no other background on what theorems you've got to reference), I can't say for certain what importance (if any) ...


1

It is difficult to say what's the problem without seeing what you did exactly, but here are some tips Make sure you're using radians, for the looks of it, that may be the problem Your solution must pass for all the input points, at least $f(0) = \cos(0) = 1$ Here's just a plot showing your results, just to help you confirm the solution in the book is ...


1

The symmetry of the question suggests centering everything at $x_{j+2}$. Note that $y_1=y(-h)$ and so on. We can translate the question by making $x_{j+2}=0$ to ease the typing. First it must be exact for $f(x)=1,y(0)=0,y=x$, so plug that in. We get $$0=h\gamma\\ \gamma=0$$ Then it must be exact for $f(x)=x,y(x)=\frac 12x^2$, so we have $$0=h\beta(2h)\\\...


1

It can be shown that $$\kappa^4 =\frac{200 \pi }{75 \pi -114 -100 \cot ^{-1}(2)}$$ The proof relies on noting that the ratios of numbers of critical points can be equal to the ratio of the disappearance rate of critical points as one smooths the fields plus one. The latter involves expressions like \begin{equation} \int \cdots \int \prod_{i\leq d} ...


Only top voted, non community-wiki answers of a minimum length are eligible