But beyond that, I had a lot of fun with the explanations of Laplace transforms by Steve Brunton at the University of Washington:
After digging through all his published videos, I found he tought a series of graduate classes in Engineering Mathematics which for some reason is a Mechanical Engineering course, but I didn't let that stop me. I queued up the beginning of the series and got started.
The first two lectures were just review (even for me), and I breezed right through them. The third one was on Taylor series. Now I did Taylor series in college, and never gave them another thought, so it still felt a bit of a review; but then the professor jumped in to Matlab to do some calculations and graphing. I've seen Matlab before, heck I know people that use it, but its never looked fun, and more importantly its a commercial piece of software. Not that there's anything wrong with commercial software, heck that's what I do for a living, but I'm not going to go out and buy Matlab just because I'm watching some videos on the internet. The last time I bumped into this problem, I found there was an open-source version called scilab, but that was more than ten years ago which is forever in computer years. Time to brush up on what's available out there.
Asking the keeper of all knowledge for "matlab alternative free" (the free is both implied and auto-suggested), and it turns out the scilab is still kicking, but that GNU is trying to run it over with Octave. (You would think that open source people would get along better than commercial people, but you would be wrong. Apparently when you're no longer in it for the money, all that's left is honor and glory, and history has taught us that that never ends well.) There are also a couple of python based options, like NumPy and Sage which are wedded to Python grammer. And there's Julia, something nebulous thrown together by MIT.
The path of least resistance probably would have been the clones, as I could copy and paste the examples from the lectures and run them with minimal rework. But when I have bumped into Matlab before, its grammer has always seemed about as close to an actual programming language as PHP; and I just couldn't bring myself to do that. Something Python based would have been practical, since its a very popular dynamic language at work, and used by the ML groups; but I made the mistake of learning Perl earlier in my career, and if you ever read transition guides for perl to python, its a lot of putting the training wheels back on; plus the whitespace sensitive syntax can go wrong in horrible opaque ways (holds up hands to show the scars). So of course I chose Julia.
The example from the ME564 Lecture 3 video was to plot sin(x)
and then plot the partial Taylor expansions of it to the 1st, 2nd, 3rd ... terms.
begin using Plots using TaylorSeries using Random x= -5π/4:.01:5π/4 sin_ish2= Taylor1([0,1,0,-1//(3*2)]) sin_ish3= Taylor1([0,1,0,-1//(3*2),0,1//(5*4*3*2)]) sin_ish4= Taylor1([0,1,0,-1//(3*2),0,1//(5*4*3*2),0,-1//(7*6*5*4*3*2)]) taylors= [ x-> x ## taylor of sin 𝒪(t) x-> sin_ish2( x ) ## taylor of sin 𝒪(t^3) x-> sin_ish3( x ) ## taylor of sin 𝒪(t^5) x-> sin_ish4( x ) ## taylor of sin 𝒪(t^7) ] labels = [ "taylor1" "taylor2" "taylor3" "taylor4" ] pl_= plot( x, x-> sin(x), title= "approximations", label="sine", linewidth= 4) plot!( x, taylors, label= labels ) plot!( x, x-> rand()/2-1/4, label= "noise" ) savefig( pl_, "/tmp/julia_sin.pdf" ) pl_ endThis is run in Pluto, which is a HTML notebook system, kind of like Jupyter; which makes pretty pictures as you go. There's some things I like so far, and things I don't. There's no compact operator for factorial, and since
7*6*5*4*3*2
is shorter than factorial(7)
, I just used that. I used rational representations for the fractions just on a whim, no good reason. And the ability to dump out a PDF as you go is kind of cool.
I threw in the noise there, just because I was cribbing off some examples of scatter plots of random values, and was trying to get an understanding of its use through osmosis. (random(3)
is not a random value between 0 and 3, like it would be in other languages, but is a vector of three random numbers.)
There still seems to be overlap with Matlab syntax, so I'm partially doomed there. My biggest gripe is that I have to call the Taylor1
generator first, and then create a function out of its result (x -> sin_ish2(x))
in taylors as putting the generator call in the function, even if I could figure out how to dereference it, would have it be called for every plot point. There's probably a way, but I didn't get anywhere close to finding it groping through the various getting started examples. I'm probably doing a dis-service to Taylor1
as well, as I really can't tell the difference between that and Poly()
.
Feb '04
Oops I dropped by satellite.
New Jets create excitement in the air.
The audience is not listening.
Mar '04
Neat chemicals you don't want to mess with.
The Lack of Practise Effect
Apr '04
Scramjets take to the air
Doing dangerous things in the fire.
The Real Way to get a job
May '04
Checking out cool tools (with the kids)
A master geek (Ink Tank flashback)
How to play with your kids