Im messing about with maths recently, and im wondering if i can define a function in this case.
Is there a way to define a functuon with this info, or how can i do that/how to set it up?
Working in 2d, y is f7, x is f4...or something, just repeating thr pattern there is my intention.
>>8573969
what do you mean define?
piecewise?
>>8573971
Id like to find a function that spits out:
f(1)=2
f(2)=5
f(3)=1
f(4)=1
Like reverse engineering a function i suppose. So id like to find something like f(x)=x^2-2x+1 or whatever it ends up being....my end goal is to then manipulate that function, maybe a geometric approach would be more sensible
>>8573978
OP here, im starting to find what im wanting maybe. Interpolation seems what im after.
id still appreciate tidbits of wisdom on interpolation, esp. Wrt High degree equations
>>8573986
let anonsFunc(x: double): double =
match x with
| (x < 2.0) -> x * 2.0
| (x >= 2.0) && (x < 3.0) -> 2.0 * x + 1.0
| (x >= 3.0) -> x / x
| _ -> ()
It sounds like piecewise polynomial interpolation is what you're after, take a look at "splines" and you'll see what I mean. You may want to start off with linear, lagrange, newtonian and neville interpolation first though.
Also, I've implemented most of the above in f# if you're interested in some sample code.
>>8573978
>>8573969
>Is there a way to define a functuon with this info, or how can i do that/how to set it up?
Yes, there is.
For values a, b, c, d, let f(x) be defined as a*x^3 + b*x^2 + c^x^1 + d. There is exactly one valuation for which this f(x) function matches your requirements.
You want to have f(1) = 2, f(2) = 5, f(3) = 1, f(4) = 1. In other words, you want:
a*1^3 + b*1^2 + c*1^1 + d = 2
a*2^3 + b*2^2 + c*2^1 + d = 5
a*3^3 + b*3^2 + c*3^1 + d = 1
a*4^3 + b*4^2 + c*4^1 + d = 1
Simplifying gives:
1*a + 1*b + 1*c + 1*d = 2
8*a + 4*b + 2*c + 1*d = 5
27*a + 9*b + 3*c + 1*d = 1
64*a + 16*b + 4*c + 1*d = 1
This set of equations has exactly one solution:
a = 11/6
b = -29/2
c = 101/3
d = -19
So your function f(x) is:
f(x) = (11/6)x^3 + (-29/2)x^2 + (101/3)x + (-19)
If I didn't mess up my computations, you'll find that f(1) = 2, f(2) = 5, f(3) = 1, f(4) = 1, as required.
>>8574004
>One last question, where in a pure maths track is this sort of thing studied? Ive been through trig and halfway into linear algebra now, self studying so im always trying to hone my map for future studies
The technique I demonstrated in >>8574004 is studied in linear algebra. You'll notice that the essence of the procedure is me solving a system of linear equations, which can be solved using Gaussian elimination (among many other ways).
>>8574036
Cheers, yea its quite familiar now that im working through your approach.
Am i corrrect in thinking this will apply for any number of datapoints by just increasing the number of variables/degree s?
And another last question, the geometric interpretion of your solution is the usual cubic low left and high right line yea? This really is adequate for my needs,
But is there a way to solve this for a repeating pattern like a circular function?
Supposing:
...
F(—1)=1
F(0)=1
F(1)=2
F(2)=5
F(3)=1
F(4)=1
F(5)=2
F(6)=5
...
>>8574056
>Am i corrrect in thinking this will apply for any number of datapoints by just increasing the number of variables/degree s?
Yep. If you want N fixed points, this will get you an equation with N variables that gets you an (N-1)-degree polynomial.
>And another last question, the geometric interpretion of your solution is the usual cubic low left and high right line yea?
Or the other way around, yes.
>But is there a way to solve this for a repeating pattern like a circular function?
Not with the technique I used. This technique gets you a polynomial, which is never circular.
There may be related techniques that let you derive a sinusoid from a set of points. But I don't know of any.
>>8574056
>But is there a way to solve this for a repeating pattern like a circular function?
If you don't care about having a smooth function, you can just define it as repeating piecewise: say g is defined to be just like you want between 0 and 4, you can define F(x)=g(x mod 4) and get your periodic function.
Or in >>8573994 , instead of using a family of independent polynomials (x->x^n), use a family of independent periodic function (x->cos(nx*(4/2pi))), for instance, then you'll have a periodic and smooth function.
>>8574562
Thats starting to get bit over my head but still very much appreciated. Ive come to the conclusion that something like this is the approach i want although the polynomial approach is fruitful for me in certain other cases.
I suspect that in the future i will need at least G^1 continuity.
Pic related is what im actually getting at with all this. Concentric circles mod7 is one dimension(pitch), and equally spaced (or mixed) rays are the second dimension (time). I'm trying to parameterize musical tropes (ie a 2—5—1 in 4/4 time), and then manipulate these with fundamental transforms (ie scalar mult ~ transposition 2—5—1—1 → 3—6—2—2, or a rotation ~ changes the downbeat 2—5—1—1 → 1—2—5—1).
Im more interested in things like f(1/x), f(ln x), f(—x). These (i think) can only make sense if the pitch axis is confined to mod 7, which allows all values to resolve to integers. The problem of course is that the whole thibg exists as a certain musical mode (ie C major), but i have a technique to allow for all 12 tones while still workibg in F7, pic to follow
Heres an example of a major and minor mapping of 12 tones to F7. The non-modal notes are equivicated to their diminished 5th, or half the span of mod7. The major problem here is that i am essentially curating the results with this approach, although ultimately this is an exercise is compositional tropes which i will curate afterwards anyways, so im satisfied with this system.
I may eventually write a paper for shits/gigles on the whole process. Could that kind of thing get me anything like scholarship/grant money to acrually study math at a uni?