
How can I write a code in matlab that solve this equation numerically, r & t are inputs and we can put every value.

How can I write a code in matlab that solve this equation numerically, r & t are inputs and we can put every value.
Copyright © 2021 JogjaFile Inc.
I can't really test this, but using Matlab's
integral(documentation) to perform numeric quadrature, here's an anonymous function to calculate $\theta(\tilde{r},\tilde{t})$:Just call
th(r,t)for scalar or array values ofrandt.In older versions of Matlab you may need to use
quadgk(documentation) instead of the newerintegral. If performance is an issue, you may want to turn the anonymous functionfinto a regular function and only calculatebesselj(0,b)andbessely(0,b)once per call. Additionally, if there are numeric issues/errors/warnings, you might try doing the math to convert to the three input argument scaled form of these Bessel functions: see my answer here for further details.