#numerical-analysis

1 messages · Page 28 of 1

sage vapor
#

I can't decipher that thing

#

none of the formal notation makes any sense

#

the question itself doesn't make sense

#

because there is no n, the size of the list is bounded

proud lion
hard forge
#

Hi,

So I try to solve the 1d advection eq. ( df/dt + v0 * df/dx = 0, v0=const). I want to do the time integration using a second order Runge kutta methode like midpoint (see https://en.wikipedia.org/wiki/Runge–Kutta_methods#Second-order_methods_with_two_stages )

Now I first tried to do it for a simple RHS , something like y'=x i.e. f=x. I use this RK implementation

def rk2a( f, x0, t ):
    n = len( t )
    x = np.array( [ x0 ] * n )
    for i in range( n - 1 ):
        h = t[i+1] - t[i]
        k1 = h * f( x[i], t[i] ) / 2.0
        x[i+1] = x[i] + h * f( x[i] + k1, t[i] + h / 2.0 )

    return x

Here you can see that we have f( x[i] + k1, t[i] + h / 2.0 ). Now what confuses me is the first argument. I use an upwind scheme (backwards finite differences) for the spatial derivative but I have no idea how I should implement f( x[i] + k1, t[i] + h / 2.0 ) if I do that. I don't know what I should do with x[i] + k1.

Does anyone have an example implementation of a similar problem so I can read the code and clear up my confusion?

#

Like my problem is: How should I be able to evaluate a discretized expression at an arbritary point If x[i] + k1

proud lion
#

Could someone help me with this please ?

mint hemlock
#

iirc

#

I haven’t done this in a year, but k1 is regardless the initial slope

proud lion
#

kirby any idea how to solve my problem?

mint hemlock
#

I will have to think about it, but qualitatively, the 2n comes from the worst case (which will never be reached.) The \Theta(log(n)) will be the average expectation, and I believe that the setting of second smallest is “halving” the array you’re working with

#

so I don’t really have an answer atm

proud lion
#

ok thanks

proud lion
#

is it possible to help me solve it or are you too busy ?

mint hemlock
#

yeah, I gotta do a few things tonight, and I’m not really great at algorithmic stuff

proud lion
#

Aright no problem !

dense echo
# proud lion kirby any idea how to solve my problem?

The claim you're trying to prove is essentially that the expected number of times the "smallest seen so far" case happens while scanning an array of n elements is $\Theta(\log n)$. That suggests a strategy: Let's hope that there are constants $A$ and $B$ such that it is always between $A\log n$ and $B\log n$ when $n\ge 2$. And let's further hope this can be proved by long induction on $n$. Then, for the induction step, the location of the \emph{actual} minimum is uniformly distributed between $0$ and $n-1$, so the function we're looking for must satisfy $$f(n) = 1 + \frac{1}{n}\sum_{k=0}^{n-1} f(k)$$ where $k$ represents the index of the \emph{last} instance of "smallest so far". Obviously $f(0)=0$ and $f(1)=1$, and the rest of the terms of the summation can be bounded by the induction hypothesis. Pound on this formula for some time with the goal of finding some conditions on $A$ and $B$ that allow both sides of the induction step to go through.

#

I have no guarantee this will crack it, but it would be my initial strategy.

pine jettyBOT
#

Troposphere

proud lion
sage vapor
#

you can use linearity of expectation and consider each loop pretty much independently from all the others to make things simpler

dense echo
#

Oooh!

#

That makes everything a lot easier.

proud lion
#

I'm confused as to how to find the expected value in this case

dense echo
#

For each k, separately: The kth entry will be the smallest so far if and only if the smallest among the numbers in the first k entries happened to land at specifically at index k, that is, with probability 1/k.

#

In other words, imagine that we create the random permutation of the n numbers by first randomly partitioning it into subsets of size k (to go first) and n-k (to go last), and then permuting the set of k randomly. No matter which number is the smallest of the k initally selected numbers, its probability of ending exactly in the kth slot is 1/k.

#

Zef Klop's observation is that it doesn't matter that this imagination seems to destroy the symmetry between the positions, because all we wanted was the probability, and when we're considering another k we can just start afresh, thanks to the additivity of expectation.

proud lion
#

Okay I understand that now.

#

Where does the − Θ(log n) come from ?

dense echo
#

Because the expectation we have just calculated is the number of times the (***) is not executed.

proud lion
#

@dense echo is it possible to explain the entire question for me or is that asking too much

sage vapor
#

are there words in the question that you don't understand

#

like, maybe you haven't done any probability theory ?

proud lion
#

ya i'm having trouble with probability theory

#

I have done it in the past

#

but I forgot it

#

I am having trouble figuring out how to get the expected value from the function

#

where do the values come from ?

#

how do you derive them

sage vapor
#

you pick a permutation of {1...n} uniformly at random among the n! possible permutations

#

X is the number of comparisons you need to do while performing the algorithm described

#

for each permutation, X will be some number

#

and the expectation of X is going to be the average of that number over all n! cases

proud lion
#

Wouldn't it take a very long time to get that data ?

sage vapor
#

if you don't understand what X is I suggest picking a random permutation like 24135 and actually going through the algorithm step by step and counting the number of times you go through ( * ) ( ** ) or ( *** )

proud lion
#

or is it good to choose a small n value

sage vapor
#

well you can reason about X and about E[X]

proud lion
#

what do you mean by that ?

sage vapor
#

you can talk about stuff like the probability that we go through step ( *** ) for particular values of i

#

or what it means for the permutation that you go through step ( *** ) for a particular value of i

proud lion
#

I see okay

#

thanks for the help

hard forge
#

Anyone has a good general ressource about operator splitting? In my case, I try to solve the 1d advection-diffusion equation.

hard forge
warm otter
hard forge
# warm otter is your function f only available in discretized form?

Yes, so currently I have this situation:

I want to solve df/dt = - df/dx.

I want to use a 2nd order Runge-Kutta method for the time integration. Of course, I have to provide the RHS i.e. -df/dx, to my time integrator. Obviously, I can't provide a "analytical" form of it in my code. E.g. if I had df/dt = x, I could simply provide a function g(x)=x as the RHS.

I want to solve that by providing the spatial derivative using finite differences (backwards resp. upwind).

Providing the RHS in discretized form is what confused me. I chose explicit midpoint as my RK 2nd order method, because it's rather easy. Now I think I kinda solved it. Was just about to start and try to implement it again.

If you have example code that does this, it'd be great. I just got very confused because I haven't done this for ages. I first solved the above with explicit euler + finite differences and I think the confused stemmed from thinking of the same discretization of the time and spatial domain but of course, I have to now also consider half steps.

warm otter
#

because you know you can just pass functions as arguments and then evaluate them at any point, it seems like thats what you did above (in the code)

hard forge
# warm otter but you know your function as an analytical expression?

I don't understand what you mean. My function i.e. the RHS is a derivative. To provide that numerically, I have to discretize it. I don't know f in df/dt = -df/dx. Getting f is the whole point basically. I know the initial profile i.e. the initial condition which is e.g. f(t, x) = sin(x(t)) or whatever. I mostly just use a step function though since I try to analyze numerical diffusion.

Again, haven't done that in ages. Maybe I just mix up some very basic thing?

The above code works fine if your RHS is something like x but again, now it isn't a nice fundamental function but a derivative.

#

The above is formulated a bit wrong. Let me check all my notes quickly, I might just got confused.

warm otter
#

ye sorry i think i messed something up in my thinking

#

in my lecture notes they actually use an operator splitting method to do RK time integration, since apparently otherwise you get oscillations (at least in a finite volume discretisation)

hard forge
# warm otter in my lecture notes they actually use an operator splitting method to do RK time...

The oscillation come from using the wrong finite difference scheme. You can't use central or forward because then you use information "in front of the flow". If you use a upwind scheme (backwards) i.e. only use "old information", it shouldn't oscillate.

The whole operator splitting makes no sense here since we only have on term. 🙂 That's the next issue I'd have to tackle later on.

#

I wish I had lecture notes. Thanks for the link

warm otter
#

here an excerpt, the L operator is just the numerical flux

#

the screenshots should be in reverse order

slow shale
#

Hey everyone, I had a numerical linear algebra question that I wanted to help on

#

I've been studying numerical approaches to LU decomposition and it got me thinking. Is there a more "general" (not sure if this is the right term for what I'm describing) form of LU decomposition? Meaning, do fast algorithms exist to solve A = L*X where L is a given nonsingular lower triangular matrix, and X is an unknown matrix. A would be the n-by-n matrix we are trying to factor here. Obviously, we can't just compute the inverse because this is extremely expensive (both for dense and especially for sparse matrices). I'm almost 100% sure it would be slower than LU. What's the fastest algorithm for this problem? Is there a blocked algorithm? If someone could elaborate on this problem or point me to resources studying this that would be incredible, thank you!

fathom rain
# slow shale I've been studying numerical approaches to LU decomposition and it got me thinki...

Just do LU here too? Call your system S*X=A where S is lower triangular with some arbitrary main diagonal. then L,U=lu(S) will be a lower triangular matrix L (which is easy to derive by inspection, since you only divide every column of S by the element value on the main diagonal) with ones on the main diagonal and U will just be the original diagonal part of S. Then, solve the system as usual with LU.

slow shale
#

Oh that makes a lot of sense actually

#

I guess in the way I was thinking about this in my head is that we want to make no assumptions on the matrix X since normally in LU you make assumptions on both (one being lower triangular and the other being upper) but you're right that you can sort of ignore the unknown

#

ty

keen juniper
#

The script shows how to solve the root-problem with newtons-method, a > 0 and n>=1:

#

By having following iteration.

#

This is ok, so far but then the script also showed a theorem on how close the start-value has to be in order to archieve convergence.

#

So you try to find a rho such that q becomes smaller than one. And then there is this nice statement that for every x in K(z) will converge, where z is a root of a function f.

#

Even if there is global convergence, I try to find the value rho for our problem.

#

m = min |f'(x)| = n * a^(n-1)

#

But how do I calculate M? there is multiple cases here n=1 n=2 n>2 acting different.

scarlet spruce
#

Any idea how to find the minimum of

#

$\min_{x} x \cdot |v|, , x\geq 0, |x|^2 = C$

#

KKT fails because the constraints are linearly dependent

pine jettyBOT
#

criver

tall solar
#

Does it make sense to you guys to "endow an algebraic variety(grassmannian) with a continuous probability measure'? The reference on this is some book called "geometry of numerical analysis algorithms"

scarlet spruce
# scarlet spruce Any idea how to find the minimum of

I think I figured it out, starting at some point x on the hypersphere I have to project v onto its tangent space at each point and then use that to move on the sphere, v would turn out to be the velocity for walking along the sphere

#

And when I reach a point where a component i is such that x_i=0 I need to set v_i = max(0,v_i)

#

And continue on with the journey

spring sage
#
then substring(L) = {epsilon,a,ab,abc,abcd,abcde,b,bc,bcd,bcde,c,cd,cde,d,de,e,1,12,121,1212,212,2,}. Prove that
if L is regular then substring(L) is regular.
#

Anybody able to explain how to approach this?

Was told to use the closure rules in automata theory.. but I don't really see how to apply them here.

sage vapor
#

looks like a job for nondeterministic automata

spring sage
sage vapor
#

L is not any language, it's a regular language

spring sage
dense echo
#

You don't need to make an NFA. Since you're being told the langauge is regular, you can assume you already have the NFA.

#

The person who claims L is regular is responsible for being able to provide an NFA if you ask for one.

spring sage
#

"If L is a regular language, it is a finite set of words. Therefore substring(L) is also a finite set of words, which means it is recognized by some NFA, n. Therefore it is a regular language."

Would this be a justifiable answer to the question then?

#

Always confused on when word reasoning is acceptable to answer a question with versus actually showing a literal proof

sage vapor
#

you have a seriously strange definition of "regular language"

#

no a regular language may not be a finite set of words

spring sage
#

my bad, had it inversed. all finite languages are regular, not all regular languages are finite

sage vapor
#

you could also try some kind of induction on the structure of formulas for regular languages

dense echo
#

in which case you should probably show first that prefix(L) and suffix(L) are regular.

brave crypt
#

Hi guys, is anyone into Finite Elements and computational fluid dynamics?

brave crypt
#

cool!! I also worked quite a bit on that. It can sound a bit weird but I recently created a collection of NTFs based on the numerical solution of turbulent Navier-Stokes. If you or someone else from the community could be interest let me know. I would love to talk about my work with people who can understand it. This is the collection https://safeart.io/octopusDapp

fathom rain
#

fuck off, nft is a scam.

brave crypt
#

sorry but you should calm down. And when you say something please justify!

woven haven
#

I was about to send this one, great video

woven haven
brave crypt
# scarlet spruce https://www.youtube.com/watch?v=YQ_xWvX1n9g

thanks for the video, I saw similar ones and for every ''negative'' video I can send you a positive one but this was not my point and I don't think it is the appropriate channel. I just wanted to share the technicalities of this work (libraries, post-processing software) if it could be of any interest for the community and give an example of an original application of what we study. That's it!!

random hornet
brave crypt
random hornet
#

Okay catthumbsup Just wanted to ensure this has no financial and/or legal implications on the users here.

brave crypt
#

thanks for claryfing! If you could also make sure that other people use an appropriate and respectful language in the chat

random hornet
#

NFTs are unfortunately in a realm (both by their very nature and legal status) that makes them a very convenient tool for exploiting people. This is why the server itself discourages discussions surrounding NFTs. I do not approve of Erik's choice of words, but would nevertheless emphasise the server's stance.

#

This is furthermore off-topic for a channel called #numerical-analysis , so maybe you can discuss the mathematical ideas/implications in more details instead?

brave crypt
#

Yes, as I said before this was not the right channel to start witl the list of the pros and cons of NFTs.

Concerning the images, they are created from a fluid dynamic simulation. I think that most of you have at least heard once in their life about Navier-Stokes equations, which are PDEs used in general to model fluid flow. I used them in this case to model a turbulent water flow in a straight channel. Numerically solving Navier-Stokes is usually quite challenge. In this case I used Finite Elements to discretize the equations and I implementend everything using the Python FEniCS library. I don't know how many of you work with FEM. In the past I was using C++ libraries like GetFEM or MATLAB, but I must say that if you are familiar with Python, FEniCS is a super cool library and makes it quite easy to implement the solution of complex PDEs.

mint hemlock
#

If I have a method (intentionally vague for work reasons) that requires residuals from PCA, do I necessarily need PCA for this.

What I mean by this is that I am just required to have matrices $P$ and $\tilde{P}$ such that
$X = XPP^T + X\tilde{P}\tilde{P}^T$. I ask this because I may need to model nonlinear data or use another model to generate residuals. There’s nothing in the method explicitly requiring PCA, just some level of statistics about the scores and residuals.

pine jettyBOT
mint hemlock
#

I think I mostly figured it out, but it may require work on the question itself, and a black box approach may not be possible.

pliant kelp
#

If you have a PRF F = F1(x1) || F2(x2), where F1 and F2 are the same PRF but with different keys chosen at random, would you still have a PRF?

#

I mean im pretty sure you would have a PRF, but how would show that the advantage is negl

gaunt carbon
#

for (int j = 0; j < numAtoms; j++)

in this loop, the int j = 0 counts for 1 operation, the j++ counts for N operations, but does the j < numAtoms count for N or N + 1 operations ?

prime kraken
#

should be N+1, at which point it escapes

#

it does do the last comparison and decides not to enter the loop again

gaunt carbon
#

so why woudnt j <= numAtoms count for N + 2 ?

#

because <= is one more operation than <

#

wait nvm i just got it

#

so j <= numAtoms would also be N + 1 right ?

prime kraken
#

N+2

gaunt carbon
#

wait huh

prime kraken
#

make a diagram on a piece of paper and follow the instructions yourself

#

say you start with j = 0, and numAtoms = 2

#

with condition j<=2

gaunt carbon
prime kraken
#

first you check 0<=2, which is true and you enter the loop, then repeat

gaunt carbon
#

j <= numAtoms would still be N + 1 tho

prime kraken
#

in the next iter, you check 1<=2, repeat

#

2<=2, enter again and repeat

#

but notice that 2<=2 is already the 3rd comparison

#

since you started counting from 0

#

and since 2<=2 satisfies the condition, the loop runs again and returns to the beginning

#

then you check 3<=2, which is the N+2 comparison

#

this one fails and the loop is skipped, so the code moves on

gaunt carbon
#

facts

#

got it

#

good looks

prime kraken
#

you asked for "operations" in a very vague way, so

#

the contents of the loop execute N+1 times

#

but the inequality is checked N+2 times

#

at the N+2 time, it does not enter the loop, but it does need to check to know whether it has to enter or not

gaunt carbon
#

once ive calculated the runtime of a nested for loop, how does that apply to the outter for look when calculating its run time ?

#

do i multiply the total runtime of the nested for loop times the runtime of the outer ? or do i add the two ?

prime kraken
#

multiply

#

for example if you have something like loop{ loop_inner{...} }

#

and loop_inner executes some operation N times

#

each time the outer loop is executed, the inner loop is executed in full, giving you N operations

gaunt carbon
#

ahh so 2N

prime kraken
#

so at loop 0 we get N operations

#

at loop 1 we get N operations

#

at loop 2 we get N operations

#

and so forth

gaunt carbon
#

facts

prime kraken
#

so if the outer loop is run M times

#

the total number of operations is M*N

gaunt carbon
#

facts

prime kraken
gaunt carbon
#

oh my b i didnt know which to type in

dense echo
#

Elementary runtime analysis at this level tends to happen in #discrete-math.

slow shale
#

Hi everyone, does anyone know of a recursive formulation of cholesky? I'd like to understand its communication analysis too in terms of things like # of arithmetic operations. Thanks!

scarlet spruce
# slow shale Hi everyone, does anyone know of a recursive formulation of cholesky? I'd like t...

In linear algebra, the Cholesky decomposition or Cholesky factorization (pronounced shə-LES-kee) is a decomposition of a Hermitian, positive-definite matrix into the product of a lower triangular matrix and its conjugate transpose, which is useful for efficient numerical solutions, e.g., Monte Carlo simulations. It was discovered by André-Louis...

#

you can make an iterative program into a recursive one in many ways

#

e.g. tail recursion

small onyx
#

please help me with part c

fathom rain
small onyx
#

please tell either, preferred a then i can solve c also

fathom rain
#

For (a) you have by Gershgorin that all eigenvalues of A are in [0,4] 2\pm 2
You have the smallest eigenvalue lambda. Now you take A-4I so eigenvalues are in [-4,0] and the spectral radius is tha largest absolute value of the eigenvalues, hence is must be |lambda-4|. which is the question.

In this case the spectrum is know exactly by f(t)=2-2cos(t) which is called the symbol, and eigenvalues are given by sampling the symbol with t_j=j*pi/(n+1) here n=4.
So, smallest eigenvalue of A is f(pi/5). Then you have A-4I has the symbol f2(t)=-2-2cos(t) and the largest modulus of the eigenvalues is |f2(pi/5)|.

small onyx
#

sorry I did not understand that f(t) part , could you give some alternative way

fathom rain
#

you can ignore that part. the first part is what you should do (I assume)

#

I just mentioned the second part because this is a special case where everything is known in closed form

#

and (c) you have equivalently the spectrum in [0,6] and [-6,0]

slender creek
#

I have been looking at two problem that I have narrowed down to being graph DP problems, but for the love of me I can’t figure out how to write the dp!

Of course, we all know that the maximum disjoint set problem is NP-hard. But what if graph is 2 x n “grid graph” (only perpendicular edges). And we are given n subgraphs on this graph. What is the maximum number of these subgraphs we can select so that no two of those we pick share a vertex? My intuition say to use DP on the vertices, but I simply don’t know how, because the subgraphs can be irregularly shaped (like “L”, etc).

We have a map with some cities and highways between the cities that take positive time t_i to travel on. At each city we want to taste the local cuisines, but the restaurants are only open between start time s_i and finish time f_i. We start at our home city at time t=0. What is the maximum number of cuisines we can try (we don’t have to try the cuisine of a city if we visit it). Thinking of doing a DP on the vertices that keep track of the max current cuisines tasted on a path to that vertex. But I don’t know if this works?
queen arch
#

If we have no information about a network, how do we find the most central nodes? (It’s a network analysis question but I’m not sure where to ask this)

tired bridge
#

I have a large collection of "shapes", each of which is a set of n points at integer lattice points. I would like a method to determine how many shapes I have when two shapes are considered equivalent when one can be translated and/or rotated to the other.

#

I know there are 24 possible rotations and you can use matrix multiplication to get the rotation of each of these collections of points - but it is unclear to me how to use this to count effectively...

tropic inlet
#

this is from kress numerical analysis.

is there an easy way to see

$S(\alpha)C(1)S(\alpha)^{-1}=C(\alpha)$

pine jettyBOT
#

xt1984kd

tropic inlet
#

im trying to use the fact left multiplication by diag matrix scales rows, right multiplication scales columns but just dont quite see the relationship yet.

fathom rain
# tropic inlet im trying to use the fact left multiplication by diag matrix scales rows, right ...

In linear algebra, two n-by-n matrices A and B are called similar if there exists an invertible n-by-n matrix P such that

Similar matrices represent the same linear map under two (possibly) different bases, with P being the change of basis matrix.A transformation A ↦ P−1AP is called a similarity transformation or conjugation of the matrix A. I...

tropic inlet
fathom rain
tropic inlet
#

what does the trig identity have to do with the eigenvalues and eigenvectors ?

fathom rain
fathom rain
#

this is because 2cos(t)=exp(-i*t)+exp(i*t) and the only nonzero Fourier coefficient are f_{-1}=f_1=1 which are the two offdiagonals in your matrix. Then you have 1/2 in front of the matrix and 1/2 * 2cos(t)=cos(t)

slow shale
#

Hi everyone, so I've been working on some numerical linear algebra stuff. Specifically, I've been trying to implement compressed sparse row and compressed sparse column matrix vector products. I've already done CSR matrix-vector product below

#

for i = 1, n
y(i) = 0
for j = rowbegin(i), rowbegin(i+1) - 1
y(i) = y(i) + val(j) * x(colindex(j))
end;
end;

#

here val(1:nnz) contains the nonzero entries packed row by row, from left to right in each row
colindex(1:nnz) contains the column index of each nonzero entry, i.e. val(i) is in column colindex(i) of A
rowbegin(1:n+1) points to where each row begins: the nonzeros of row j are contained in val( rowbegin(j) : rowbegin(j+1)-1 )

#

I'm having a hard time implementing compressed sparse column products though. Does anyone have any advice?

neon marten
#

Good afternoon, for a numerical analysis course we are supposed to choose a paper from any area and re-create the results with Python, it just has to be something involving numerical analysis. Anyone got any paper ideas?

mint hemlock
neon marten
mint hemlock
#

It requires some knowledge of the numerical solution to PDEs

mint hemlock
neon marten
mint hemlock
stoic sun
prime kraken
#

that depends on what you're doing. big O does deal with it, but they didn't give any context. furthermore, in the message you cited they were askimg about nested loops, the innermost of which had N iterations. what's your concern there? @stoic sun

brave crypt
#

why do we need to leave an empty cell in a circular queue, i know its to know if the queue is empty or not but i just don't get the logic

mint hemlock
brave crypt
#

i understand that, but how does the empty cell allow us to differentiate if it's empty or not ?

mint hemlock
brave crypt
#

that's not my question, the problem is how will the program differentiate between an empty queue and a full queue just from their pointers ?

slow shale
#

Hi everyone, I've been trying to understand how to solve ridge regression using normal equations, SVD, and QR decomposition. My understanding is that the SVD can solve this quite cheaply but requires a more expensive SVD first. The normal equations require an additional O(n^3) work for each lambda but this method is not backward stable. I feel like using QR to solve ridge regression can be done for an additional cost of O(n^3) per lambda but I'm having a tough time going about it. Does anyone have any tips/suggestions/resources? Thanks!

prime kraken
#

do you need to code this yourself?

#

cut i would suggest to use a built in solver for this

#

the often use efficient approaches to solve systems of eqs, like cholesky, QR and Lu

slow shale
#

not trying to code it, but i'm trying to prove that using QR I can do ridge regression at that cost

gusty veldt
#

hi guys im trying to numerically solve and plot the solutions to a complex partial differential equation, any good ways to get started? im using python btw

fathom rain
earnest hare
#

Does anyone know what the sage code for this would be?

cyan kraken
#

Anybody know linear programming

#

I get that t >= -2 but i dont think theres an upper bound so idk why the question says to find a range between -e and e

brave crypt
# cyan kraken

The question just asked for the largest \epsilon which satisfies -\epsilon <= t <= \epsilon, which as you correctly point out is 2. Here only the lower bound matters.

signal estuary
#

Could you point at a specific industrial breakthrough that came from these fields? Like, something that was impossible before? What is, in your opinion, the most concrete example you could give?

Because afaik, in computer science you always have multiple options to do the same thing, so while I don't doubt that you could apply abstract models from these 3 fields to code, that doesn't necessarily constitute a meaningful contribution to the advancement of software engineering

For example, Haskell (notoriously) implements monads from category theory, that can be used (among other things) to manage i/o in a purely functional language

But that doesn't mean monads have been a significant contribution to (applied) software engineering:

  1. Haskell in itself is primarily an academic language
  2. there are other ways to do anything a monad can do
  3. implementing monads has not been a game changer from a practical standpoint

So, among all the practical applications you know of, which one do you think constitutes the most compelling argument to demonstrate the practical utility of set theory/type theory/topos theory?

signal estuary
#

Yeah that's why I didn't ask specifically for something that couldn't be done before; I asked in general for what constitutes, in your opinion, the biggest practical breakthrough.

It could be something that was possible before, but it's way, way, way better applying set/type/topos theory.

Give it your best shot, I wanna convince my friend

signal estuary
#

Unfortunately I can't ask my friend to check all of that stuff, he's a very busy man (I also happen to do some minor work for him).

And of course his knowledge of the applications of s/t/t theory is not on par with yours. That's why I asked for a single major example, if you point me to (what in your opinion is) the best one I will collect some material and send it to him

hollow pagoda
#

Hi, I'm taking theory of computation this semester and I'm having trouble understanding the pumping lemma: my textbook says that the pumping lemma is when you can divide a string into "xyz" and that

  1. |xy| ≤ n
    (2) |y| ≥ 1
    (3) for all i ≥ 0: x Y^i z ∈ L
    And that a language is regular if it respects that

However, how does this apply to context free languages? A quick google search gives different things such as a string split into u,v,w,x,y instead

#

And the problem i'm trying to solve is this:

hollow pagoda
#

nvm i figured it out, the pumping lemma for regular languages and CFLs is different

brave crypt
#

hmm not sure how they got this NPDA? Cause if b is twice the number of as, then shouldnt there be transitions for 2 bs in a row

cyan kraken
lament kettle
fathom rain
fathom rain
#

I have shared office with Morgan Rogers and Riccardo Zanfa (mentioned on that page), and been to talks by Caramello and Lafforgue. I didn't understand anything 😛

idle quartz
#

Anyone has a good derivation of the interior penalty discontinuous Galerkin method for a Poisson problem?

brave crypt
#

How to construct NPDAs using a language? e.g.

fathom rain
#

Probably Hesthaven's book, with code, has it too?

#

Any reason to use DG and not standard FE?

idle quartz
#

Grid pad looks neat bt

rigid aspen
#

hello everyone, can someone help me with these ?

prime kraken
#

what are you having trouble with

random flame
#

anyone has any resources on mathematical modelling for heterogeneous computing?

sand knoll
#

I was reading that the Christofides algorithm has a time complexity of O(n^3). Is it because constructing minimum spanning trees can be done in O(n^2) (n vertices and maximum (n-1)) edges and the rest of the operations can be done in linear time O(n) leaving us with O(n^3) ?

brave crypt
nova cedar
#

I know the pumping lemma, but I don't know what the game with demon is

#

sounds like some example from class or something you'd have in your notes or book

warm otter
#

does anyone here have experience with implementing pseudodifferential operators numerically and could point me to some resources on it?

hoary light
#

I used to study a related topic. Ultimately the speed of your algorithm depends on the analytic structure of the symbol

#

See "A fast butterfly algorithm for the computation of Fourier Integral Operators" by Candes, Demanet, Ying

warm otter
#

although i was hoping to get away with just FFTs 👀

hoary light
#

You can. You can just FFT the original function, discretize the symbol and apply it as a dense matrix, and FFT back

#

However, if you want to avoid doing the dense matrix multiplication then you need to do something more

foggy anchor
#

Hey, does Optimization go in this channel?

prime kraken
#

it can go here, sure

foggy anchor
#

Alright, I would just like to have the opinion of someone who's already had optimization at uni (or anyone else), on how bad it would be to study optimization in my 2nd semester already, alongside analysis 2 and linear alg 2

#

Cus that's looking like my best option currently, eventhough the module catalog is saying ana and la 2 are prerequisites

#

Because unfortunately I cannot do the economics module, that all the other economics modules I can do are based on, in this semester

mint hemlock
#

I think you’d be fine, I’d look at the syllabus and maybe consult someone who’s taken it in the past at your uni
it’s hard to gauge what content you need to know as an intro optimization course can contain some pretty broad topics

foggy anchor
#

I'm just so unsure, another option would be functional analysis, but I have just talked to the prof and she said that functional analysis without analysis 2 would be really difficult, she gave me her skript though so I could see if it might be okay

#

But that goes in a different channel, sorry

hoary light
#

if you don't know linear algebra, I think you will waste a lot of energy in your optimization course

prime kraken
#

this depends strongly on what linalg 1 is

#

e.g. if they've seen C^n already in linalg 1 and have some strong notions on subspaces, EVD, SVD, that's enough to do some stuff in optimization

harsh pike
#

May I ask a question in this channel about finite automata theory(transducers) and regular expressions?

hoary light
#

Here's an impromptu litmus test maybe: if you know something about how to solve linear least squares problems, if you have some notion of why matrix decompositions such as QR and SVD are useful, and if you know something about positive definite matrices, then probably you're in the clear; otherwise you'll have to learn all that linear algebra simultaneously

foggy anchor
#

Thanks for the feedbacks you all

#

Might just have to choose a different 2nd subject, it really sucks with maths and economics at my Uni, it would work out perfectly fine with theoretical physics for example

cyan kraken
#

Hi does anyone have an example of a matrix game that is fair but the average of each row is at least 5?

#

Idk why im having such trouble finding something

#

I am a little stupid and a bit of an ignoramus

snow anvil
cyan kraken
#

anybody?

cyan kraken
#

pls my boys pls

cyan kraken
#

dumb

foggy anchor
#

So I'm looking into my Optimization homework for in 2 weeks already and trying to solve some of it. I feel like I've boiled this task down pretty well to finding the Minimum of a simple function under 5 conditions:

I need to find the local minimum of 3x+y, under the coniditions that:
2x+3y >= 250
x+0.5y >= 320
1.5x+3y >= 190
2x+y <= 650
and x >= 4y

#

Can anyone tell me how I could go about finding the edges of where all these conditions are satisfied?

#

Should I just be solving this as a Linear System of Equations?

#

And find a solution space? I don't feel like that would work

#

I feel pretty stupid tbh, I really didn't do enough during the semester break

#

650/9 is an upper bound for y, which follows from the last 2 conditions, but that's about all I got

prime kraken
#

you could use KKT or look for the vertices of the polytope

foggy anchor
#

I think I should wait for the first couple of lectures ^^'

#

Thanks anyway

#

There was a different task about some polytope aswell, so that's probably the way we are meant to do it

near bear
#

Don't know which other channel would be good for this but I'm trying to use a numerical method to minimise this problem

#

(Basically line 1 = xA+dA * t and line 2 = xB+dB * s)

#

Subtracting them to find the minimum distance between lines

#

Proving tricker than I'd have liked

wild olive
#

Apparently you can triangulate a star polygon in linear time with a known kernel point

#

I kind of get the first step is to connect each vertex to the kernel but I'm not sure what to do next

#

My idea that seems to work without a known kernel is to triangulate the points and then triangulate the remaining convex hull with fan triangulation

#

Sorry if this isn't the correct channel for computational geometry

#

Anyways, am I onto something?

#

My main question is how do I determine the inner and outer points?

#

Is that what the kernel is for?

brave crypt
#

helllo

#

does anyone knows how can i prove this

foggy anchor
#

Can anyone here think of a linear optimization problem, the solution to which is an n dimensional sphere?

#

The worksheet has a small hint on it to not choose the origin as the center of the sphere, and to think of the hessian normal form of a hyperplane first

#

Do I need infinite conditions?

#

I'm trying to think of it on the lowest level possible, so I'm taking a 2d problem, and I'm trying to get a circle as the optimum

#

And any line is a hyperplain, and I can easily make a hessian normal form

#

But how does this help me

foggy anchor
#

I misunderstood the task, but I am still stuck

#

I'll try again tomorrow though

glad mortar
snow sand
#

Hello, given any finite set $X$ and a function $d:X \cross X \to \mathbb{R}$, what's the best way of checking that $d$ is a metric? If we regard $d$ as a matrix then the positivity property simply becomes that all elements are $>0$ and $=0$ on the diagonal, the symmetry property says that $d$ should be symmetric so both of those should be easy to check. The problem is the triangle inequality..

pine jettyBOT
#

Maldor

hoary light
#

Given that at the outset, d is an arbitrary function, then I see no way to do this other than to check every case

snow sand
#

:(

magic spade
#

Not sure if this is the right channel for this or not, so let me know if there is a better spot for this.

I am given the following linear multistep method:
$$2U^{n+3}-5U^{n+2}+4U^{n+1}-U^n=k(\beta_0 f(U^n)+\beta_1 f (U^{n+1}))$$
And am supposed to determine for what values the local truncation error is $O(k^2)$
Does it make sense for this to be whenever $\beta_1=-\beta_0$, since taking the taylor series of each U leaves just the term $\beta_0-\beta_1=0$?

pine jettyBOT
#

JacobHofer

fathom rain
#

ban user MrBombastic: he tries to cheat on exams

prime kraken
#

it was taken care of just now, thanks

#

in the future, feel free to ping mods or dm modmail for such cases

keen juniper
#

This is an algorithm for fast exponentiation. I know the idea for even n that a^n = (a^(n/2))^2, squaring skips some multiplications.

#

I have defined the idea in recursive version once. Pretty natural. But this iterative version hurts my head xD

#

What's the exact idea we follow here?

hoary light
#

I think the simplest way to think of it is that the recursive version is a^n = (a^(n/2))^2, while the iterative version is a^n = (a^2)^(n/2)

#

in the recursive version, you try to express exp(a,n) in terms of exp(a,n/2)

#

but in the iterative version, you change exp(a,n) into exp(a^2, n/2)

#

so you're iterative increasing the base of the exponent, from a to a^2, then a^4, and so forth

hard escarp
#

Hi. Can anyone recommend me a book on applied mathematics showing how functional analysis and optimization relate to one-another? By optimization, I mean the computational kind -- the one having a lot of convex analysis, steepest descent, gradients, trust region methods, linear programming, etc (not the calculus of variations for mathematical physics, for example).

#

I imagine a book relating functional analysis to numerical methods might have some of that.

fleet sedge
# hard escarp Hi. Can anyone recommend me a book on applied mathematics showing how functional...

Hello, I believe I am from the same field, more from optimization side.

I have been recommended to read https://www.amazon.com/Optimization-Vector-Space-Methods-Luenberger/dp/047118117X for some time, so that might help.

Full functional analysis does not seem to be 'a thing' in optimization, and apparently not everyone reads Rockafellar cover to cover

hard escarp
#

Which one by Rockafellar

#

?

fleet sedge
#

The classic one on Convex Analysis

#

By the way, calculus of variations is tied to optimization, so it's not very 'different'

#

On a theoretical side I would say it helps if you know calculus of variations

hard escarp
#

I see.

#

The thing I dislike about Rockafellar's convex analysis book is that is has 0 exercises.

fleet sedge
#

Ah I see, it's still the standard from an optimization perspective I think

hard escarp
#

Ok. Thank you.

fleet sedge
# hard escarp Hi. Can anyone recommend me a book on applied mathematics showing how functional...

I feel like since you asked in an optimization context you might want to look at more advanced optimization theory rather than functional analysis. By this I mean you can look at things from Mathematics of OR, etc, and go deeper into any of the things you mentioned e.g. proximal methods, trust region, convex optimization, since I think there are more materials for each subfield

From a functional analysis -> optimization perspective I think there are a few books from the googling I just did, but I feel it is a bit more general (e.g. Banach space-related) and does not get applied quickly. I also know a lot less about this perspective

hoary light
#

Functional analysis is mostly used to formalize concepts in optimization that don't necessarily require a finite dimension. Algorithmically you always use a finite-dimensional algorithm, which might be "downcast" from an infinite-dimensional formulation using linear functionals (e.g. discretization). A standard example might be a problem in calculus of variations, where the solution lives in a function space. But to solve you'll always still discretize that space. As for books, Deuflhard has a monograph on Newton Methods where he formulates a lot of topics in the infinite dimensional setting. I don't have any other concrete suggestions at this time, but such books do exist.

hard escarp
#

I see.

#

Thank you all.

hoary light
#

By analogy, one can formulate finite element or Galerkin methods in terms of Banach spaces. But ultimately all implementations are finite-dimensional Galerkin methods by necessity.

brave crypt
#

hi
i have a question regarding fredholm second type equations.
i have the following equation and, according to what is being asked, i need to solve it using trapezoid method for numerical integral approximation. can someone give some pointers on how to do this? i've tried many different methods and even fixed point iteration but can never get an answer. thank you

hoary light
#

Consider the discretized problem where instead of solving for y(x), you solve for a vector of values y(x_1), y(x_2), ..., y(x_n)

#

if you pick x_1, ..., x_n to be the uniform grid on [0,1], then you can approximate the integral using trapezoid rule or any other desired numerical integration method, and since the integral depends on x, then once discretized it becomes a matrix

#

so you end up with an equation of the form f + A*y = y, where f is the vector corresponding to x sqrt(x) / (1 + x), A is the matrix discretizing the integral, and y is the vector discretizing y(x)

#

this can then be rewritten as f = (I - A) y, which is simply a linear system to be solved

#

If you have further questions don't hesistate to ask

prime kraken
#

do note that these matrices are usually very poorly conditioned, so if trapezoid rule doesn't work, you can try with a more "smoothing" numerical integration method

hoary light
#

in this case the matrix should be OK as the integrand is smooth and doesn't vary that much

small onyx
#

how do I do it with LINEAR least square?

hollow stag
#

Heyho,
I have following question:
I have to formalize the tic-tac-toe game using a grammar $G = (\phi, \Sigma,R, S)$.
The Language $L(G)$ should describe the board configuration.
Besides that it is also a requirement to that the grammar has the property $\overline{y}\stackrel{1}{\rightarrow} \overline{z}$.
Only exception from this rule is the empty board. (I hope I translated it right.)

What I got so far:

the board looks like this:
$\overline{w} = (...|...|...)$

my alphabet looks like this:
$\Sigma : = {\underline{o},\underline{x},\underline{.}, \underline{|}}$

Rules of the game:

  1. We start with an empty board.
  2. the count of x and o on the boards is either equal or x = o + 1 (when x starts)
  3. You are only allowed to change one symbol at a time
  4. x and o take turns
  5. the game is over when either x or o have 3 symbols in a row, a column or a diagonal.

Attempt of formalising:
The first rule should look like this:
$$R= {S::= (...|...|...)}$$
the second rule should look like this:
$$0 \leq count(\underline{x},\overline{w}) - count(\underline{o},\overline{w}) \leq 1$$
for 3 and 4 I currently have nothing.
for 5 here i currently have the winning conditions defined as
$$(xxx|...|...)
(...|xxx|...)
(...|...|xxx)
(x..|x..|x..)
(.x.|.x.|.x.)
(..x|..x|..x)
(x..|.x.|..x)
(..x|.x.|x..)$$
and for o it is analog. but this can be simplified right?

pine jettyBOT
#

Lennart

hoary light
#

@hollow stag unfortunately this question isn't really an applied math problem, I personally am not familiar with such problems

crimson igloo
#

I am trying to precalculate the spherical harmonics coefficients in cartesian coordinates like they are shown in stupid spherical harmonics tricks/wikipedia or the cpp sh google github repo but my results are way more complicated. I use matlab, maybe someone can help. I need them for orders that are not shown in the resources

hoary light
#

the spherical harmonics can be expressed in terms of associated legendre polynomials. These Legendre Polynomials can be computed in terms of recurrence relations. Are you familiar with this?

crimson igloo
#

what is actually the difference between the legendre polynomials and the associated legendre polynomial?
so what I currently do in matlab is, create syms for x y z, transform them with cos and tan2 and solve the Yml for some m and l, but the solutions only looks good for some m and l

#

sometimes I get atan or other complicated stuff in the solution but on wiki or so everything is just a constant and a multiplication of x y z

crimson igloo
#
function [result] = sphm_Y(l, m, x, y, z)
    % renormalisation constant for SH function
    klm = sqrt((2.0*l+1.0) * factorial(l-abs(m)) / (4.0 * pi * factorial(l+abs(m))));
    
    %r = sqrt(x*x + y*y + z*z);
    %x = x/r;
    %y = y/r;
    %z = z/r;
    %theta = acos(z);
    %phi = atan2(y, x);
    
    if( m == 0)
        result = klm * assocLegendre(l, 0, z);
    elseif(m > 0)
        %result = klm * assocLegendre(l, m, cos(theta)) * cos(m * phi) * sqrt(2.0);
        result = klm * assocLegendre(l, m, z) * calcC(x, y, m) * sqrt(2.0);
    else % m < 0
        %result = klm * assocLegendre(l, m, cos(theta)) * sin(-m * phi) * sqrt(2.0);
        result = klm * assocLegendre(l, m, z) * calcS(x, y, -m) * sqrt(2.0);
    end
end

function [s] = calcS(x, y, m)
    if m == 0
        s = 0;
        return;
    else
        s = x * calcS(x,y,m-1) + y * calcC(x,y,m-1);
        return;
    end
end

function [c] = calcC(x, y, m)
    if m == 0
        c = 1;
        return;
    else
        c = x * calcC(x,y,m-1) - y * calcS(x,y,m-1);
        return;
    end
end

function plm = assocLegendre(l,m, z)
    syms x;
    % get symbolic form of Legendre function P_l(x)
    leg = legendreP(l,x);
    % differentiate it m times
    legDiff = diff(leg,x,abs(m));
    % calculate associated legendre function P_lm(x)
    plm = ((-1)^abs(m))*((1 - x^2)^(abs(m)/2))*legDiff;
    if m < 0
        plm = ((-1)^abs(m)) * (factorial(l-abs(m))/factorial(l+abs(m))) * plm;
    end
    plm = subs(plm, x, z);   
end
#
sympref('FloatingPointOutput',true);
sympref('AbbreviateOutput',false);
format long
syms x y z r real;
assumeAlso(sqrt(x^2 + y^2 + z^2) == 1);

coef = sphm_Y(2, 1, x, y, z)
#

first is sh code and second is how I call it for m=1 and l=2

#

should produce this

#

but produces

#

its correct except for the sqrt(1-z^2) part

crimson igloo
#

when I divide the result with sqrt(1-z*z) m times it works

hoary light
# crimson igloo what is actually the difference between the legendre polynomials and the associa...

The associated legendre polynomials can be thought of as a generalization. They arise as solutions to a particular 2nd order ODE. I don't really have the time to read your code carefully, but I noticed you are doing symbolic calculations, which is not necessary. If you look at this link: https://en.wikipedia.org/wiki/Associated_Legendre_polynomials#Recurrence_formula you can see that there are some recurrence formulas. Therefore, since you are only trying to evaluate at a particular x, you can generate the value of the associated Legendre polynomial for any (l,m) at x without any symbolic computation.

In mathematics, the associated Legendre polynomials are the canonical solutions of the general Legendre equation

or equivalently

where the indices ℓ and m (which are integers) are referred to as the degree and order of the associated Legendre polynomial respectively. This equation has nonzero solutions that are nonsingular on [−1, 1] only if ℓ...

sage cosmos
#

Does someone know where I can find a good introduction into Matlab?

prime kraken
#

the mathworks side is pretty good

hoary light
sage cosmos
#

It's pretty low actually, I just started numerical Analysis 1

prime kraken
#

in that case i would almost recommend looking for courses for julia or python. the syntax is very similar to that of matlab, but those tend to have better "hello world" level tutorials readily available on google

#

and having learned the names of things, you can quickly search them on mathworks, which has great documentation

tall solar
#

Is operator theory directly relevant to mathematical programming?

fleet sedge
#

I'm not sure what you mean by 'direct' but in more advanced mathematical programming, knowing linear algebra helps a ton.
On that note I don't know if infinite-dimensional understanding is really necessary.
In any case operators are somewhat common in more sophisticated applied math

#

Essentially the question is this: is there a point where discretization fundamentally destroys your application? If not, then any finite-dimensional approximation will do sufficiently well.

fathom rain
hoary light
#

I use some functional analytic aspects of operator theory in my research as well (numerical linear analysis, numerical analysis) for the purpose of studying discretizations of linear systems, especially integral equations and elliptic systems

fathom rain
hoary light
# fathom rain what do you work on? fe and dg?

I actually work on specific applications. A lot of my interests involve trying to use analysis to study where you can accelerate solvers, e.g. by taking advantage of low rank structure and so forth.

steep hamlet
#

Hello, can I get some help on formulating an SDP problem? I'm essentially trying to add a constraint $$t \geq k^T x - x^T x$$, but I can't remember how to write it as a semidefinite constraint

pine jettyBOT
#

tooflesswulf

steep hamlet
#

where t and x are free parameters, and k is a fixed vector

empty sandal
#

any Idea about how the code would looks like?

fathom rain
empty sandal
#

I know how to use ode45 function

#

but I have problem to determine the right parameters

fathom rain
#

what parameters? initial condition for x?

#

i assume you have to run it for a range of values to argue that it fins a steady state?

cosmic karma
#

Can someone explain to me Morozov discrepancy principle

#

like what am i minimizing?

#

is it $\norm{Ax-b}_{2}\leq\delta$ for some positive $\delta$

pine jettyBOT
#

emphatic_wax

cosmic karma
#

<@&286206848099549185>

brave crypt
#

I am looking for ideas/keywords to what I think is a version of online bin-packing:

I get $n$ items of sizes with a known distribution, say $x\in N(\mu, \sigma^2)$ and I want to pack them into bins, such that $\sum bin \ge B$ for all bins. Also I get $k$ buffers. Whenever I get an item, I have to choose immediately which of $buffer_{1…k}$ it joins, and I can't change that choice. Once a buffer is full enough, it gets closed and replaced with an empty buffer immediately.

I want to minimize over-packing. Any hints?

So the differences to classical bin-packing are: (1) I want my bins to be $\ge$ than a given B (Textbook bin-packing is $\le$). (2) It's online with buffers. (3) The distribution is known.

pine jettyBOT
brave crypt
#

shoot away, I guess.

hoary light
#

Do you mean continuous piecewise quadratic basis functions?

pine jettyBOT
#

squirtlespoof

hoary light
#

Great. One thing to note is that you have a different basis at the endpoints.

#

(Similarly to how linear basis functions behave at the endpoints)

#

Sorry, I suppose this really depends on what convention you take for finite element basis functions. If you're viewing the basis functions as "local", then there is no difference between interior and boundary parts

#

I was thinking about the "global" view, e.g. the linear basis functions become "hat" functions

#

So I hope I didn't mislead you there

#

Forget what I said, basically 😛 I remember now that there are a few conventions and I don't think it's worth trying to explain what is just different terminology

#

As for your other question, I'd say just try it and see if the result looks right, since I'm not sure exactly what your plots mean

fathom rain
#

You can check out one alternative way to look at it in Example 5 https://www.2pi.se/publications/pdf/p8.pdf The actual matrices are given in Appendix B (The focus on the paper is on the eigenvalues of these matrices)

tall solar
#

Is it a stretch to view matrix factorization theory as within the realm of operator theory?

prime kraken
#

this sounds about right

tall solar
#

thank you

warm otter
#

does anyone have some recommendations for some resources on numerical methods for inverse problems?

hoary light
#

Linear inverse problems?

warm otter
hoary light
warm otter
tall solar
#

What's a real life example of a linear programming problem?

Why is the problem modelled as a linear programming optimization problem in particular?

mint hemlock
# tall solar What's a real life example of a linear programming problem? Why is the problem ...

Have you heard of the transportation problem? Latex bot is down so bear with me
Let’s say there are suppliers in two locations. The first supplier (S1) has 300 items and the second supplier (S2) has 300 items.
The goal is to deliver these items to destinations, and every destination has a distance from the supplier attached to it.

Let’s say the first destination (D1) is 3 units from S1 and 4 units from S2. D1 has 400 items of demand.
the second Destination (D2) is 4 units from S1 and 2 units from S2. D2 has 100 items of demand.

Label these items as X_{ij} where i is the supplier’s location and j is the destination so X_{12} is the number of items sent from S1 to D2.

The linear programming problem becomes:
minimize 3X_{11} + 4X_{21} + 4X_{12} + 2X_{22}
subject to:
X_{11}+X_{12} <= 300
X_{21}+X_{22} <= 300
X_{11}+X_{21}=400
X_{12}+X_{22}=100

#

Now this was a lot of numerics, but the idea is that if you want to minimize the total work done by each supplier in order by creating a linear objective function (that is trivially nonnegative) that’s just the weighted sum of the items shipped to each destination

tall solar
mint hemlock
#

The case is pretty simplified, but it’s a way to model supply and demand in discrete cases

#

so maybe take a company like Amazon or Fedex, they want to minimize the total effort in delivery

#

but they can’t just skip delivering packages to make their costs cheaper, so they’re constrained to delivering every single package while minimizing the total effort it takes to drive from supplier to destination

#

It may seem like a “common sense” idea of driving the least distance, but driving routes need to be optimized to lessen costs on the company

#

@tall solar I hope that kinda makes sense

pine jettyBOT
hard escarp
#

Ah... I forgot to say that x* is to be assumed a KKT point.

tall solar
turbid jay
#

hey, has someone worked with dual numbers for automatic differentiation? To differentiate ln(ab + max(a,2)) they chose as dual numbers a=(3,1), b = (2,0) . But why? Why not a=(3,0) and b=(2,1), or something else?

#

I think I figured it out. From the taylor expansion we get for 1d the following (screenshot). So we have to use a=(2,1) to get the partial derivative with respect to a

brave crypt
prisma sluice
#
  1. What is this even asking?
  2. It's not even legible because of how dark the lighting is
#

Get better at asking questions

nova cedar
#

lol looks like it's cut off and I can make out the last 3 words 'not context free.' so I assume it's asking to prove if the following language described is a context free grammar or not, so like probably try using the pumping lemma for CFGs

#

but I'm only speculating hard rn lol

cosmic karma
#

Hi does anyone know what this is approximating

#

$\frac{u_{m+1}-3u_m+3u_{m-1}-u_{m-2}}{2h}$

pine jettyBOT
#

emphatic_wax

cosmic karma
#

Idk if it's the first or second derivative of u

nova cedar
#

looks like a 3rd derivative to me

cosmic karma
#

So I tried manipulating it

#

$\frac{h}{2}\left(\frac{u_{m+1}-2u_m+u_{m-1}}{h^2}-\frac{u_m-2u_{m-1}+u_{m-2}}{h^2}\right)$

pine jettyBOT
#

emphatic_wax

cosmic karma
#

So I guess it's a scaled second derivative at two points $x_m$ and $x_{m-1}$

pine jettyBOT
#

emphatic_wax

fathom rain
#

Like merosity said, 3rd derivative (1st order)

nova cedar
#

one way you could write it that loooks kind of nice with translation operators T, $$\frac{1}{2h} (T-1)^3 u_{m-2}$$

pine jettyBOT
#

Merosity

nova cedar
#

at least this is why I said 3rd because you might want to write $\Delta = T-1$ and have $$\frac{\Delta^3 u_{m-2}}{2h}$$

pine jettyBOT
#

Merosity

brave crypt
#

trying to solve this either fully numerically or semi numerically (FT/LT in either direction then solving ODE numerically),
the result obtained doesn't make sense :|
for test used:
Left BC is sinusoidal function with small amplitude
IC is zero.

pine jettyBOT
#

DvaNapasa

brave crypt
#

stabiliity condition found using Von Neumann Fourier modes
for explicit Euler Scheme

#

plot1. deflection u vs x
plot2. free end value of u (i.e. u(right))

frequency for the sine on left BC is much higher than what im getting on the second plot

brave crypt
soft lodge
#

Hello I have a problem to do with my ode MATLAB code, so I'll first just explain what I'm trying to do with the code. My research is about measuring the tumour population and which factors affect it so tumour population is one of the unknown variables in my code, there are some other unknown variables like chemotherapy drugs, nanoparticles and IL-2 which are supposed to affect the tumour. I wanted to first see what the tumour population is like when the chemotherapy drugs, nanoparticles and IL2=0 and I set them equal to 0 but when I ran the code I got values for these variables even though they were set to zero. I just need to understand this.

mint hemlock
#

I haven’t run your code, but this is something I notice immediately

fathom rain
#

also, a lot of variables of different order, so probably some cancellations happening

soft lodge
#

I've noticed that when I set the last 3 differential equations to 0 then run the code then I get 0 for variables 5 and 6. Variable 7 stays constant due to the initial condition.

mint hemlock
#

Yes I would expect that

soft lodge
mint hemlock
#

Because when the diffeq is 0, the value remains constant

soft lodge
#

Oh okay. So for example if I want to consider the system without chemotherapy(6th variable) then I would just set the 6th diffeq to be equal to 0?

mint hemlock
#

Idk the context, but what I’m saying is that the terms RPp and RIp are making diffeq 5 and 7 nonzero for times <= 3600

soft lodge
mint hemlock
#

No.. If concentrations start at 0, they should probably stay at 0 so I’m wondering if they are correct or not

soft lodge
#

Can you please have a look at my code again to see if you can find an answer? I'm a little confused as to what I should do.

mint hemlock
#

The terms RPp and RIp make the diffeqs increasing in time regardless of initial condition

#

I don’t have a solution because I don’t know anything about your system

soft lodge
#

Okay I think I understand now, what the issue is.

soft lodge
mint hemlock
#

That's helped me when I'm working on things like this

slim hamlet
#

Hello everyone, has anyone ever worked with VAR (vector autoregressive) models and could you quickly explain to me how to interpret impulse response tables (what do the ordinates represent or an interpretation sentence)? Thanks in advance!

hoary light
#

I'm not sure about the table, but my understanding is that the impulse response is usually viewed as a vector-valued function varying in time, whose value indicates how quickly the predicted variable changes given some perturbation. This is of course none other than some form of derivative. So my guess is that the horizontal axis indicates time, but this figure has basically no information so I cannot really say what it is supposed to mean

slim hamlet
hoary light
#

Yeah, that sounds plausible. Normally the perturbation is a random variable, so I guess the blue curve is the expected value at a given time

hard escarp
#

Hi. Just curious. I'm looking to get into optimization and numerical analysis. I was wondering if functional analysis and measure theory play significant roles in those theories... Anyone?

hoary light
#

Functional analysis... It's everywhere in such topics, though you'll never need the full generality. Measure theory essentially none.

solid igloo
hoary light
#

It's been a while since I read the book. Most numerical analysis would be in the context of a separable Banach space or Hilbert space. None of these strange topological vector spaces.

solid igloo
#

How about Kolmogorov's book on functional analysis?

#

although Rudin is not that abstract as far as I know

hoary light
#

I don't really think of subjects in terms of books so I can't really help you that much. You usually only need the key results about Banach spaces, e.g. Alaoglu theorem, Hahn-Banach theorems, things related to convexity, etc

#

OK, I can provide a better answer now. Peter Lax's Functional Analysis gives a fairly broad overview of how functional analysis is used in applied math.

#

I basically studied everything in that book when I was a grad student.

brave crypt
#

pls dm me the link if u have one or ping me so ill see it! ❤️

young sluice
#

Regarding the least square method:
Do the points need to have a normalized difference between every x value (suppose Point = (x,y) )
so like getting points like (1,3)(3,5)(9,11) matter at all ?

#

well these points are on the same line so I guess this case doesnt make much sense

#

but in a real problem and maybe trying to find a degree 5 polynomial instead of a line

grim bobcat
#

Does anyone have any idea on the following: given a lattice (given by 3 generating vectors) what would be the fastest way to find 3 affinely independent lattice points.

Alternatively, given a convex cone generated by 3 vectors, what would be the most efficient way to find 3 affinely independent integer lattice points inside it (Of course, these are both actually the same question)

#

Ping me if u respond

#

Both random generation and brute force search are very bad, but i'm not savvy enough with search algorithms to come up with anything inbetween

soft lodge
#

Hello,
I'm just working on a project which involves creating a mathematical model of a chemo immuno therapy system, one part of the project includes doing a literature review. I'm just a little confused as to what to do for the literature review? For the review, should I look for articles/research papers to do with mathematical models and then discuss/analyse them? Any advice would be helpful.

tall solar
#

Any one know of applications of high dimensional probability outside of compressed sensing

hoary light
#

randomized algorithms in linear algebra also use similar concepts

idle temple
#

I am working on a project that involves algebraic topology and more specifically TDA, I am applying the math to a real world solution and want to write a "proof" proving that TDA can do what i need it to do. Can anyone point me in the direction of learning how to write appllied mathamatics papers? Thanks so much!

restive creek
#

Can someone help me with this question

pearl bay
#

How would I go about answering this question
all the things I found online says how to build them and T is the probability that it is true
F is false
but do I need to do anything with F to get b?
or can I just put B|A as B since B is caused by A
am I overcomplicating it?
hmmm

hoary light
#

The answer is yes, you need both pieces of information to compute P(B). You know that 0.8 = P(B | A = T) and 0.7 = P(B | A = F). You also know P(A = T) = 0.6. Can you compute P(B = T) using Bayes rule?

pearl bay
#

Like this?

#

Then P(C) is 0.4 x0.6 + 0.2 x 0.4

#

P(!B) = 1- 0.76

#

=0.24

#

P c is 0.36

#

0.36 x 0.24 x 0.4 = 0.03456

hoary light
#

Unfortunately you can't multiply all of them together unless they are all independent variables

#

However, due to the Bayesian network, you do know that B and C are independent

pearl bay
#

I found 2 different ways of doing it

pearl bay
#

a. p(A) = 0.6
p(!A) = 1-0.6 = 0.4
p(B) = (0.80.6) + (0.70.4) = 0.76
p(!B) = 1-0.76 = 0.24
p(C) = (0.40.2)+(0.60.4) = 0.32

Answer = p(!A) * p(!B) * p(C) = 0.40.240.32 = 0.03072
or if I try and just take the numbers from the network
There is a 60% chance that A is true.
If A is true, there is an 80% chance that B is true and a 40% chance that C is true.
If A is false, there is a 70% chance that B is true and a 20% chance that C is true.
Answer = (1-0.6) * (1-0.7) * 0.2 = 0.024
is the answer 0..03072 or 0.024

#

After what you've said I'm guessing the answer is 0.024

#

As the question asks for not A

#

And not B

inland anvil
#

I don't think this is very advanced but could I get some help to the end of Q1

#

just some of my working

inland anvil
#

^ still need help with this if anyone is available

hoary light
pearl bay
#

Since the question asks for ¬A & ¬B & C

hoary light
#

regardless of what the question asks for, why would you believe this? Recall the formula for conditional probability

hoary light
pearl bay
#

perfect

pearl bay
#

I guess I just started overthinking it

hoary light
#

Great. But I would make sure you know exactly why that is the answer, and how you would compute the other probabilities

pearl bay
#

P(B'|A') & P(A') & P(C|A')

hoary light
# pearl bay P(B'|A') & P(A') & P(C|A')

This is fine, I just wanted to make sure you understood that your approach stems from the fact that B and C are independent, based upon the structure of the Bayesian network.

pearl bay
#

B and C are independent of each other

#

but A and B

#

and A and B are dependent

#

B and C both depend on A

pine jettyBOT
#

squirtlespoof

fathom rain
paper escarp
#

Hey is anyone familiar with RSA encryption and the mathematics behind it ?

rigid aspen
#

hey guys, can someone help me with that ?

uneven thicket
rigid aspen
#

as you see there are two "variables" one is defined as the formula above, the idea is to calcualte what is second one.

uneven thicket
#

Oh yeah my bad lmao

rigid aspen
#

;ddd

uneven thicket
#

I assume you're doing this programatically

#

But I don't see why you'd see a difference in the two methods, except for numerical error

cosmic karma
#

Hi. I have a discretized cylindrical shell and I have a function value on each of the point in my mesh. Now, I want to take the L2 norm of the function over the cylindrical shell. How do I do this, preferably using Gaussian quadrature? Thanks!

idle quartz
#

For those who are writing complex C++ code, any learning material you d suggest for program archeture? Specially for numerical applications

uneven thicket
#

I ask only because if you're doing anything related to linear algebra then c++ may not be the best choice, unless you're particularly familiar with the language

hoary light
cosmic karma
#

So how do I compute a discrete L2 norm

warm otter
warm otter
cosmic karma
cosmic karma
solid oxide
#

Hey guys I dont know if this is the correct place to ask this
but im having issues with a numerical mathematics problem assignment in python
A function of mine wont run and is throwing an error
its literally driving me nuts and I cant figure out how to fix it

lost sedge
#

@lilac forge I think the key part here is you aren't looking at some r+1 points. There are only 3 points (degrees of freedom) on the triangle. In particular, $v|_{a^2a^3} \equiv 0$. That is, at every single point on the line segment $a^1a^2$, $v$ is zero. The $\lambda_1$, if $K$ is the reference triangle will just be the functional $\lambda_1(x,y) = y$ (if $a^2 a^3 = {0\leq x \leq 1} \times {y=0}$).

I would say try prove on the reference triangle to start and then try to argue the general result with some affine transformation $T$ which maps the reference element to the global element.

pine jettyBOT
#

Xillicis

lost sedge
#

@lilac forge So, I thinking about it for a bit. I think its easiest to prove by induction. Keep in mind that if $a^2 a^3$ is the line segment at ${y=0}$ , then $\lambda_1(x,y) = y$.

pine jettyBOT
#

Xillicis

lost sedge
#

So prove for the case r=1. Then assume the result holds for (n-1) degree polynomial and prove for r=n.

lost sedge
#

Yep, P_0(K) is constants.

limpid flare
#

not sure if this is the right place to ask but

#

does anyone know if sister celine's method and zeilberger's algorithm are basically doing the exact same thing, where the only difference is computational speed/efficiency?

#

if you know sister celine's method, do you need zeilberger's algorithm for any reason?

toxic geyser
#

hello, i have an exam in 4 days on introduction to applied mathematics. I need help going through a large amount of practice exam questions. can I reserve a time with anyone here to help me some time in coming days?

#

i am living in West Australia time

toxic geyser
#

anyone who i can do a screenshare and just help me through a few questions in 22 hours maybr?

fathom rain
hoary light
#

I can help you with your practice exam but due to time zone it might be difficult to schedule, I live in western United States

toxic geyser
#

thanks, i have a pure exam, I will post after it

toxic geyser
#

part a is easy peasy but can someone please show me what variation to try for part b?

#

i tried Yp = (ax^2+bx+c)e^-x and just Ae^-x and many others 😦

nova cedar
#

try just Y_p = ax^3 for Euler differential equations, the multiplication by x makes up for losing the x in differentiation, leaving the degree unchanged

toxic geyser
#

sorry i sent the wrong question for this equation?

#

sorry

hard escarp
#

Hi.

#

Can anyone point me to some sort of books list containing good recommendations on optimization books (on a graduate level)?

#

I've been considering "nonlinear programming" by Bertsekas. Does anyone here know if it's a good one?

wintry vessel
#

what sort of root finding algo would require an upper and lower bound

uneven thicket
wintry vessel
#

Like a lower and upper bound

#

Idk how else you would say it

uneven thicket
#

I just don't quite follow what you mean by an algorithm "requiring" bounds

wintry vessel
#

Like saying that a root is more than and less than certain amounts

uneven thicket
#

Are you talking about adding constraints?

wintry vessel
#

Sort of

#

Have you ever used a graphing calculator

uneven thicket
#

Not a physical one. Stuff like desmos/geogebra, yeah

wintry vessel
#

Ok then this will be tough to explain

#

I'll just ask on stack exchange

hoary light
#

Every root finding algorithm requires bounds in order to determine initial guesses. Of course depending on the equation itself perhaps bounds are not needed

silk marten
#

^for real roots you can come up with bound given the coefficients

#

realistically any bound less than infinity will suffice so it only matters that it exists

delicate elk
#

(This may be a weird question) what does optional decomposition have to do with hedging?

rigid aspen
#

hello guys, so I have one task to do: I need to compare different basis functions for chebyshev polynomials and compute numerical experiments....
I know general idea of chebyshev polynomials (how they are obtained for first and second kind) but I don't understand the question itself: "compare different basis functions for chebyshev polynomials" does it mean to compare first and second kind? or I can somehow input some random function into chebyshev polynomials?

hoary light
#

In the context of numerical analysis, basis functions are used to approximate other functions by way of orthogonal projection, similar to Fourier series.

#

So you can come up with some common functions, project them onto the basis, and see what the approximation error is. Furthermore, you can check the approximation error as you increase the size of the basis (number of Chebyshev polynomials, for example)

hushed patrol
#

Hey, what will be a good place or way to learn Continous time random walks for computational purposes

#

Yes, the same

#

But arent there some difference

north marlin
#

@hushed patrol oksendal is good as is any springer textbook on the topic

bright wadi
#

Hello, can i ask digital signal processing questions here? or which channel is more suitable for the topic?

bright wadi
#

I know a) and c) but i cannot figure out b)

random canopy
#

If it was continuous, what would be its period? Is that period an integer?

#

Also plotting it may be a good visual aod

#

Aid*

buoyant kayak
#

Hello, I have a DSP question about mappings between audio signals.

I have the intensity signal of song A that stretches from 0 to 100'000 timesteps. Song A is of low quality with a distorted voice. I also have Song B, which is the exactly same first 30'000 timesteps of song A, but in undistorted, good quality. I am wondering if it is possible using this info to create a mapping that allows the latter parts of Song A that do not have a "ground truth" to be transformed into the undistorted quality.

Is it feasible to create 30'000 mappings using division and interpolate a function between them to create an intensity transform function from Song A -> Song B, or is it possible to apply FFT in some way and shift the frequencies in Song A in order to fit Song B? Or another alternative?

vocal nexus
#

I've run into a bit of an interesting problem that I'm struggling to tackle and maybe some extra heads would help. I think this would fall under computational geometry so I hope this is an appropriate place to pose the problem.

I have two sets of data which describe closed curves in 3-dimensional space. Each closed curve is constructed of hundreds of position vectors.
These vectors are produced via numerical integration of a system, so there is no parametric equation to hand to allow for a more analytical approach.
The problem is how to determine whether or not these rings are interlinked, like links of a chain. In the picture attached, the top image is not interlinked, the bottom is.
I've drawn them as simple rings but ideally this would work for any arbitrarily shaped closed curves, assuming the number of data points was high enough to depict them to a decent accuracy and precision and there weren't any troublesome data points making things weird.

My approach was to attempt to produce some kind of surface so that one closed curve acts as the area's parameter, and then measure how many times the other closed curve intersects this area. Depending on the direction the surface is intersected from ('back' or 'front' face of the surface) we can assign a sign to the intersection; +1 or -1. If the sum of intersections is anything but 0, we should have interlinked curves.

The problem I'm having is producing this surface and assigning direction to the second closed curve. I assume I will have to construct one of the curves and the surface it binds first, and then for the second curve select a start point and step forwards/march through the points along the curve to preserve the 'direction' stuff.

warm otter
vocal nexus
brave crypt
#

hello can any one help me with this question f: R+ → R, x → sin (ln x) calculator the second order taylor polynomial T2(x) of the function f(x) and then development point x0=1

snow anvil
#

Anybody know an algorithm that given some points (edit) in space (let's say R^2) estimates the enclosed area covered?

fathom rain
snow anvil
#

I meant points. i.e. some point cloud, possibly with outliers

fathom rain
#

is the convex hull what you want?

trail valve
#

Yeah, I was about to say, there are many ways of defining the area enclosed by some point cloud

snow anvil
#

Area of convex hull works, although it doesn't have to be that exact value, it can also be a vague estimate if it's fast in return

fathom rain
# snow anvil Area of convex hull works, although it doesn't have to be that exact value, it c...

I have never implemented any of them myself since I just use whatever was available in the language I used but here is a list https://en.wikipedia.org/wiki/Convex_hull_algorithms

Algorithms that construct convex hulls of various objects have a broad range of applications in mathematics and computer science.
In computational geometry, numerous algorithms are proposed for computing the convex hull of a finite set of points, with various computational complexities.
Computing the convex hull means that a non-ambiguous and ef...

#

I would just use anything in whatever language you use

snow anvil
#

thx

#

Will probably not get green lit if it's slow 😛

soft lodge
#

Hey guys, can I get some help with MATLAB please? I'm short on time and I really need some advice with it.

soft lodge
# fathom rain just ask

Thanks. I'm trying to do sensitivity analysis, i.e find out which parameter has the greatest effect on my results. But it's taking too long and not sure if it's a good one.
I can show you the method that I have tried so far

fathom rain
#

google gives a few hits

soft lodge
soft lodge
wooden citrus
#

Does anyone know of a method to solve systems over rings of the form $\mathbb{Z}/p^k\mathbb{Z}$? I.e. if I had two polynomials $f,g \in (\mathbb{Z}/p^k\mathbb{Z})[x,y]$ is there a computational method (that isn't brute force, and preferably that runs in $\log(p)$ time) to find the (size of the) common zero set of $\begin{cases} f(x,y) = 0 \ g(x,y) = 0 \end{cases}$?

pine jettyBOT
#

ddxtanx

nova cedar
#

off the top of my head I would suggest using the multivariate hensel's lemma, which effectively uses the derivatives to place a bound on what you need to brute force check, for instance it might say, depending on your polynomials, that you just need to check for solutions in Z/pZ and then from there you just deterministically hensel lift - which ends up being exactly the same algorithm as Newton's method

#

but there may be more efficient ways than that even

wooden citrus
#

ahh sweet, thank u!

hard forge
#

Hi, anyone knows a good book/article/paper about "Solving or approximating a solution to PDEs using deep learning"?

hearty crystal
#

I have a free-time project using linear programming where I have used scipy linprog a lot, the problem is that it does not accept multiple vectors with multiple constraints. The exact problem I have, described mathematically, is:

Minimize: the sum from t=1 to T of numpy.dot(one_vector59, x(t))
Subject to: the sum from k=0 to t of [p_res(t)x(k) – o_res(k)] >= 0

I have searched around for a while checking out different optimizing methods but not found any tool that can help me solve this in Python - any ideas?

hard forge
hard escarp
#

Hi.

#

Can anyone recommend me a modern book on theory and methods for unconstrained optimization?

random canopy
#

what would you consider as "modern"

hard escarp
#

Good question.

#

It's not the same question, but it's one I sort of care more about. hehe

random canopy
#

I've never read the bertsekas book, but I've gone through a bit of his dp/oc book and I personally didn't like it as much; nonetheless it is a classic reference, so I'm sure it's not a bad book

On the other hand since someone has already recommended boyd, I'd also recommend linear and nonlinear programming by Luenberger & Ye which starts off with LP's and finishes with NLP's (you could certainly just jump to the nlp section if you prefer)

hard escarp
#

Ok. I'd not mind going through the LP piece

#

I actually think I should, tbh.,

#

I'll take a second look at it. Thank you.

#

iirc what bothered me about it is the long periods without exercises. This material is for self study and I believe I work well with "short sections and exercises"

#

Well... The Luenberger one actually seem quite nice. I think I misjudged it before.

#

@random canopy Thank you. I actually had dismissed this book... idk why

#

It has examples, it has rigor... the sections are a bit longer than what I'd like, but... well... that's the only "issue", which isn't really an issue.

random canopy
#

No problem! Yeah it can be a bit wordy sometimes and you'll have to reread it; classic math books haha

hard escarp
#

🙂 hehehe

#

for sure!

rare rune
#

hey,
does anyone know a good explanation or motivation behind the theta method?

warm otter
rare rune
warm otter
rare rune
#

and this is the def for Runge Kutta

rare rune
#

but I still don't really get the benefit or the why behind it, if its nothing more than the implicit Euler method for example if theta = 1

warm otter
warm otter
# rare rune hey, does anyone know a good explanation or motivation behind the theta method?

so you can view the theta as kind of a "measure of implicity" that is, the higher the theta the "more implicit" the method is (in the sense that it qualitatively approaches the implicit method and all its (dis-)advantages as theta goes to 1). As you said when you put theta=1 then you just get an implicit method, but other values of theta may also be of use, for example when discretising the heat equation with a finite difference scheme and using euler time integration one can use the theta method to obtain the so called crank-nicolson method which has order 2 in time integration as opposed to order 1 for explicit and implict euler time integration with about the same effort as just using the implicit version. Interestingly one can then also observe that even though the crank nicolson has some "explicit-type" instability in the sense that it amplifies high frequency errors which the implicit method would damp (but the explicit method would amplify even more) while it has the "implicit-type" inconvenience of having to solve a linear system of equations (there is a cool paper on this topic called "Five Ways of Reducing the Crank-Nicolson Oscillations" by Ole Østerby).

rare rune
fierce turret
#

@ripe chasm

ripe chasm
#

I want to calculate the tilt for a circle using two points around 90 degrees off. The issue is that I have no clue what im doing. As you can see in my images there is going to be 5 inputs, tilt azimuth high, tilt azimuth low, azimuth high, azimuth low, and current azimuth. I am trying to solve for the current azimuth tilt. Can anyone help me figure this thing out. I have a excel sheet that is great between 90 and 0 degrees because it says the tilt at 0 degrees is 2, the tilt at 90 degrees is 1. The difference is 1 degree of tilt over 90 degrees azimuth, so 17 degrees (example) times 1/90= 17/90. The only issue is that if you go over 90 degrees the change becomes different so I have the formula change, the excel formula mostly works fine when the values are 0, 90. The only issue is that I will be getting random values that overlap like 350-70. It is really over my head and this is my current equation on excel. I was thinking it would be like a number line that I could plot all the numbers for the possible outcomes and then guestimate but there are changes in each quadrant. For instance in quad 1 there is a difference of 1 degree of tilt, in sector 2 there is 3 degrees of tilt. To make it even more complex some times the values will come reversed where its 70-350. The tilts will change too. In some cases 0 degrees will be -7 and 90 degrees will be 4. They will vary drastically. The inputs for the tilt azimuth high, tilt azimuth low will be reversed in some cases. same with the azimuth low, azimuth high. I dont even know where to start in this project, I barely know how to use excel. Can someone explain this to me and teach me how to make a solution for this problem? In the end it will be used in a javascript code.
Thank you.

hoary light
#

can you explain what is meant by tilting a circle?

ripe chasm
#

well you have a circular disk that is a little higher on some sides than other

ripe chasm
#

@hoary light

hoary light
#

by disk, do you mean an ellipse? In other words, NOT a perfect circle?

#

And if so, do you know the formula for rotating a point around the origin by some angle theta?

ripe chasm
#

a perfect circle

#

that is in 3d space

#

and imagine you only see it in 2d

#

then its pushed farther down on 2 sides

#

so they are tilted 2 degrees and 1 degree

#

can you voice chat?

#

then you draw a random heading from the center and I want to know the tilt in 3d space

#

its easy to manually get it, but it needs to be in a formula that way its automatic

hoary light
#

ok, I understand now

#

once you mentioned it was 3D, that was enough clarification

#

so basically you should think of the circle as defined by the plane that it lies on

ripe chasm
#

yes, if there is no tilt it is a circle for the 2d part

hoary light
#

so what I'm saying is that you should regard your tilt as not the tilt of the circle, but the tilt of the vector perpendicular to the plane of the circle. I'm being slightly vague because I don't quite understand what rotations you want, but in principle, since the circle is uniquely determined by its perpendicular (normal) vector, you need only determine that vector.

#

You could imagine that your circle is not actually a circle, but instead a cylinder, and then you slice the cylinder to get back to a circle. Then it becomes clear that only the perpendicular direction matters

ripe chasm
#

Yup, that sounds pretty close to what i'm trying to do

#

Whats a equation for that?

wraith fossil
#

this is the shape you get when viewing an opaque sphere through a glass sphere

#

is there a name for this shape??

#

curious if this has been studied at all

reef sorrel
# wraith fossil

These images look very similar to the ones from ray tracing in one weekend

wraith fossil
#

theyre from ray tracing in one weekend haha

reef sorrel
dense ivy
#

ok not 100% sure where this question belongs, but I and a few others have been working on a team project in C where we approximate arcosh in C using both series and lookup implementations, and I want to calculate the "units of the last place" (ULP) relative error measure for our solution

#

mainly so we can compare it to the math.h version, which has 2 almost across the board

#

and I don't know how to use the given formula |d.d...d - (z / 2^e)| / 2^(p - 1)

#

mainly because I'm unsure what's to be used for d/e and z

#

(p would be 52 because we're using the 64 bit doubles)

violet flicker
#

if i want to draw a circle on sphere or paraboloid then how to do it?

fathom rain
dense ivy
fathom rain
# dense ivy Nah the mantissa is 52 bits + 11 bits for the exponent + sign bit = 64

The IEEE Standard for Floating-Point Arithmetic (IEEE 754) is a technical standard for floating-point arithmetic established in 1985 by the Institute of Electrical and Electronics Engineers (IEEE). The standard addressed many problems found in the diverse floating-point implementations that made them difficult to use reliably and portably. Many...

dense ivy
#

Ye np

fathom rain