Mathematics

Associated with Math.SE; for both general discussion & math qu...
Huy
Feb 21, 2022 10:45
thanks, that helps. if you come up with a cleaner solution, I'm very happy to hear about it
Huy
Feb 21, 2022 10:02
@Astyxy: yes, it is.

f[x_] := Sin[x]/x;
t[x_] = Normal[Series[f[x], {x, 0, 6}]];
Plot[{f[x], t[x]}, {x, -2*Pi, 2*Pi}, PlotRange -> All]

something like this works. I want to use Manipulate[] and change 6 to a variable n
Huy
Feb 21, 2022 09:01
ok. I'll see if I can find it when I'm home.
Huy
Feb 21, 2022 09:00
was it in English?
Huy
Feb 21, 2022 09:00
interesting. I forgot a lot of things. I'm getting old.
Huy
Feb 21, 2022 09:00
I'd have to search at home. did I send it to you back then ?
Huy
Feb 21, 2022 09:00
Die Physiker?
Huy
Feb 21, 2022 09:00
I also have to teach multivariable calculus soon, so I'll probably need some help there too
Huy
Feb 21, 2022 08:59
nice. good to see some familiar faces in here. I missed Ted's birthday apparently.
Huy
Feb 21, 2022 08:58
where are you studying if I may ask?
Huy
Feb 21, 2022 08:56
@BalarkaSen hi, you must be like grown up by now! I'm obviously still teaching. Trying to teach some basic numerical mathematics this semester, so I need update my Mathematica skills again. I used it like 10 years ago in uni and have forgotten everything.
Huy
Feb 21, 2022 08:43
I want to write a short code using the `Manipulate[]` function in Mathematica. Namely, I want to be able to vary the degree of the Taylor polynomial `n` but with (for now) fixed function and fixed expansion point. If `n` is fixed, then it is simply:

`t[x_] = Normal[Series[f[x], {x, 0, 6}]];`

Note that using `:=` (`SetDelayed`) will cause an error here.
Now the issue is that if I simply replace the `6` with an `n` and use `t[x_,n_]` instead, the `n` would expect a `:=` (`SetDelayed`) instead of `=`. However, that is incompatible with the `x_`.
Huy
Dec 4, 2020 20:22
it's not supposed to. it's a "graduate" project. we have "graduate projects" in the last year of high school
Huy
Dec 4, 2020 20:15
@TedShifrin stupid question (cause I don't do statistics) - how does one do this? look at the graph and "guess"? or is there some more mathematical way to?
Huy
Dec 4, 2020 20:14
yes, probably
Huy
Dec 4, 2020 20:13
:(
Huy
Dec 4, 2020 20:12
no, at high school where I teach
Huy
Dec 4, 2020 20:12
apparently they don't
Huy
Dec 4, 2020 20:11
I asked people from our geography faculty for help. none of them has any idea about maths or statistics or any possible mathematical model for the data :(
Huy
Dec 4, 2020 20:10
@TedShifrin that is what I meant by my above simplification
Huy
Dec 4, 2020 20:09
mankind killing the planet quickly
Huy
Dec 4, 2020 20:09
pretty sure even average is non-linear
Huy
Dec 4, 2020 20:08
yes
Huy
Dec 4, 2020 20:07
but I'm not sure if this will still lead to a useful extrapolation
Huy
Dec 4, 2020 20:07
@TedShifrin I was thinking about extremely simplifying the process and just compute the average temperature of the 1 million data points for each time point
Huy
Dec 4, 2020 20:06
it is already formatted nicely in a .csv file from a NASA website
Huy
Dec 4, 2020 20:06
I don't know, I hoped that MATLAB can import it
Huy
Dec 4, 2020 20:05
I was thinking MATLAB because the data contains ~1 million of data points for each time point
Huy
Dec 4, 2020 20:04
@TedShifrin if it is directly related to what I need, yes, otherwise, later. we have to "solve" this before Christmas because he was too shy to ask me before, when he would still have had more time to work on it...
Huy
Dec 4, 2020 20:04
@TedShifrin by any chance, do you know if he'll be able to do this with MATLAB? or will he need R (because I hate R and can't help him with it)
Huy
Dec 4, 2020 20:03
:)
Huy
Dec 4, 2020 20:02
ok
Huy
Dec 4, 2020 20:02
I only remember some parts from numerical analysis because I haven't applied them since my exams in uni - but if I know what I have to look up again, I'll do it of course
Huy
Dec 4, 2020 20:01
@TedShifrin is this the least square thing? with the normal equations?
Huy
Dec 4, 2020 20:00
basically I want to interpolate or do some sort of regression to get a function sea_temp(time, latitude, longitude)
Huy
Dec 4, 2020 19:59
exactly, and I don't really know how to
Huy
Dec 4, 2020 19:58
it doesn't need to be extremely super scientific, of course. just somewhat reasonable and not simply linear between two points
Huy
Dec 4, 2020 19:57
@TedShifrin a student of mine wants to extrapolate climate data. he collected data from some website e.g. for August 2020 in the format "average sea temperature, latitude, longitude". there is also data for August 2019, August 2018, etc.

do you know what would be a reasonable way to interpolate and then extrapolate so many data points? I only remember basics on how to interpolate data sets of the form (x, y) with different methods.
Huy
Dec 4, 2020 19:52
hi @TedShifrin
Huy
Nov 22, 2020 19:40
-4
A: Do the real numbers and the complex numbers have the same cardinality?

DominikOne particularly nice class of bijections from $\Bbb R$ to $\Bbb C = \Bbb R^2$, which is in my opinion a little bit similar to the spiral around the grid, is given by the space-filling curves.

Huy
Nov 22, 2020 19:33
sounds reasonable, but a bit disappointing
Huy
Nov 22, 2020 19:23
anyone know a nice geometric proof that the cardinality of C is the same as R? I know the construction with alternating digits but was hoping for something visual
Huy
Aug 11, 2020 19:12
I'm working on some cool stuff guided by an article to "compute" values like that
Huy
Aug 11, 2020 19:12
Is it still unknown?
Huy
Aug 11, 2020 19:12
@TedShifrin You probably do!
Huy
Aug 11, 2020 19:11
Is it difficult to show that $\Gamma(\frac{1}{3})$ cannot be expressed by elementary functions?
Huy
Aug 11, 2020 18:55
Hellou.
Huy
Feb 21, 2020 21:17
but f(t) = x(t) + y(t) doesn't
Huy
Feb 21, 2020 21:16
f(t) = x(t)^2 + y(t)^2 works too
 

 Wolfram Mathematica

Welcome! This is the main Mathematica chat room for mathematic...
Huy
Feb 21, 2022 08:37
I want to write a short code using the `Manipulate[]` function in Mathematica. Namely, I want to be able to vary the degree of the Taylor polynomial `n` but with (for now) fixed function and fixed expansion point. If `n` is fixed, then it is simply:

`t[x_] = Normal[Series[f[x], {x, 0, 6}]];`

Note that using `:=` (`SetDelayed`) will cause an error here.
Now the issue is that if I simply replace the `6` with an `n` and use `t[x_,n_]` instead, the `n` would expect a `:=` (`SetDelayed`) instead of `=`. However, that is incompatible with the `x_`.