[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Scientific Programming

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 64
Thread images: 6

File: mc.jpg (90KB, 280x280px) Image search: [Google]
mc.jpg
90KB, 280x280px
Hey /sci/entists, what do you use for scientific programming? And why?
>>
>>7678531
Python. It's simple, open source (so we don't have to pay for a Matlab license), and flexible. Also, it's easy to teach to undergrads.
>>
>>7678560
That being said, it isn't powerful enough to do certain simulations, so it isn't the only thing we use.
>>
>>7678560
I use matlab... i have a cracked version :)

But you're right, I need stop being a dinosaur and switch to python... It's where everything is going... Any good resources to learn python for someone with a matlab background?
>>
>>7678563
Has anyone done this ?
https://www.udacity.com/course/intro-to-data-science--ud359
>>
I used to use a horrible mishmash of Fortran77, C++, Perl, and bash scripting.

Now I just use Ruby. I am much more productive, even with slightly slower code, because writing/debugging it is so much faster. My whole process is automated now, from setting up simulations, submitting the batch jobs, handling backups, running each simulation (on a variable number of processors), finding potentially interesting trends or cases, and finally plotting those for analysis by a human brain. Also, I calculate some other numbers that I don't use directly, but a few other people do, and I even plug those into their models for them.
>>
>>7678560
Ahhahaha python for simulations
Of what, a bouncing ball?
Fuck that shitty language thing I bet java runs faster than that shit
>>
C++ master race reporting in
Nothing will beat c++ in the long run, absolutely nothing.
>>
File: 1152659202053.jpg (39KB, 438x438px) Image search: [Google]
1152659202053.jpg
39KB, 438x438px
>>7678531
COMSOL and Mathematica :^)
>>
>>7678584
matlab user here...

Of course C++ runs faster than matlab, fair enough. But you have to consider the bigger picture: the speed of the whole scientific process. From coming up with an idea to generating a prototype to finally interpreting your results intelligently.

I think this obsession with "fast code" came from a time when computers were the size of a room and the goal of the scientist was to ease the workload of the computer by coming up with tricky ways to handle processing and memory.

That's not the case today. Computers have evolved to the point that scientists can put a lot more of that work onto the computer so you can spend your time on higher level problems like understanding the system you are trying to model.
>>
>>7678608
By your logic it's ok to have shit code which leads to unreasonable loading speed e.g. ms office
>>
>>7678615
not him but sometimes you have to sacrifice some efficiency for ease of use so you can spend more time doing actual physics instead of writing code for days on end
>>
>>7678581
>Said the freshman CS major
In my research group, we use python to run diagnostics and optimizations on optical units for the South Pole Telescope. We're about to launch a weather balloon observation device to detect the polarization of light in the CMB, but have fun rewriting BigInteger.java.
>>
>>7678531
Python because it interfaces well with everything and it's open source -which is an actual advantage in academia because less people are going to cite your work if they have to buy 2 more MATLAB packages just to run your code.

It's also much more versatile than most languages for scientific computing.
>>
>>7678563
>i have a cracked version :)
Yeah...that is not an option in respected departments where the faculty will chase you out long before the auditors catch wind.

If just one fucktard uses pirated software for research it ruins the department's reputation forever.
>>
>Python
Werks, well documented, lots of existing scientific code
>Fortran
Faster than Python, well documented, lots of existing scientific code

Anything else and you're leaving the realm of scientific research and entering the world of neckbeardry.
>>
>>7678563
>Any good resources to learn python for someone with a matlab background?
I always recommend starting with the official Python tutorial which is ~3 hours and really shows off how easy it is to code in Python. Do the tutorial until you finish classes. After that basically any tour of scipy and numpy is enough though you could learn everything you'd need in a day if someone in your department uses it.
>>
>>7678665
What institute are you at where they don't have a licence for basically anything you could think of?
>>
>>7678672
We do have licenses, problem is they are on lab computers. Most students want a copy on their personal laptops/PCs at home.
>>
>>7678560
how poor is your uni that you don't have site licenses for matlab
>>
>>7678696
it's not about just your access to matlab, it's also about people trying to use your work
>>
>>7678531
>tfw simulate in your mind
Feels good being a poor as fuck startup
>>
File: 1404131587568.jpg (93KB, 500x498px) Image search: [Google]
1404131587568.jpg
93KB, 500x498px
R

>the stats library
>the package library
>ggplot! ggplot!! fuck any other graphing package
>vectorization and indexing
>functions print their source on command
>intuitive data structures
christ i'm in heaven

the only shitty thing is that its regex implementation is garbage
>>
>>7678700
FYI, there's a piece of freeware called FreeMat that will run most Matlab programs.
>>
>>7678707
there's also octave, which is compatible with almost all matlab code that doesn't rely on toolboxes
>>
>>7678700
you can compile your work into executables that will run on anyone's computer if they install the free runtimes
>>
>>7678707
>>7678713
True but some stuff won't run and it's a bitch to figure out why. But you are right, if I absolutely needed a free alternative, I would go with something like Octave.

>>7678716
Yes, this is true. But sometimes you want to share your source code so others can recreate any figures you made or so they can modify it to use on their specific problems (and of course cite you).
>>
>>7678531
Python because it's simple, flexible and has a lot of modules all ready to use. However it's not that good when it comes to heavy numerical work, so for that I use Fortran. You can then use a Python module called F2Py, that allows you to implement a Fortran subroutine into a script. So basically:

>Fortran for numerical work
>Python for everything else
>Bring them together for glorious results.
>>
>>7678669
Pretty much. Python, intelligently coded using Numpy/Scipy, is fast enough for most applications. If you really wanna go for speed and for whatever reason you can't make proper use of the numpy vectorised operations, then you code it up in Fortran and interface it with your main Python script.
>>
>>7678669
There's also R and MATLAB, but those four cover the gamut basically completely.
>>
File: 1411497889770.jpg (61KB, 500x547px) Image search: [Google]
1411497889770.jpg
61KB, 500x547px
>that feel when knitr, R, xelatex, and ggplot2 all combine to create one glorious, beautiful document
>>
>>7678716
>You can make your code completely unusable to other researchers by giving them compiled files instead of source code
We are aware.
>>
>>7678713
>>7678742
The only advantage MATLAB has it's powerful library.

I was trained on Octave during undergrad, but I never use it.
>>
>>7678789
No one ever said you couldn't also give them the source code.
>>
>>7678799
Researchers want to be able to implement your code in their own projects without spending weeks learning how it works. That's the entire point of keeping clean code and standardized syntax and another key advantage of Python which is simple to understand.
>>
>>7678812
>Researchers want to be able to implement your code in their own projects without spending weeks learning how it works.
>implying MATLAB code isn't as straightforward as python, if not more so
>>
>>7678816
Unless:
>1) They don't have MATLAB licenses.
>2) They're freetards who refuse to use a JEWLAB licenses.
>3) They like Python and don't want to work in MATLAB.

But more importantly Python is better at OO and functions are easier to reuse so there is a much lower chance of needing to understand and rewrite something.
>>
>>7678835
Most scientific programming doesn't have quite the need for an OO paradigm that other domains do. Python's OO focus is overkill for many scientists.
>>
File: tumblr_nhqs5bHCk91qj6t7yo1_540.png (224KB, 540x418px) Image search: [Google]
tumblr_nhqs5bHCk91qj6t7yo1_540.png
224KB, 540x418px
>>7678705
this.
>>
I use R for data munging and graphing (ggplot).

For analysis I use the dynamic programming languages JAGS and STAN. I learned STAN first, so JAGS feels incredibly informal. The first time I wrote a HMM model in it I was terrified with how there were so few type checks. STAN is fantastic but having to marginalize over discrete parameters can be very annoying sometimes, which is why I end up having to use both languages.
>>
>>7678581
Are you fucking retarded? Every major scientific library in python calls BLAS/LAPACK/GSL/what the fuck ever in the background, making it not even noticeably slower than rolling your own low level code.
>>
R, Python, Coq.
>>
>>7678531
GNU/Linux, C++, C#(legacy code), Fortran(holy balls it's fast), python(when I'm feeling GNU), Mathematica, Perl(one guy on the team writes it), Matlab, Lua(for some sim software), weird simulator scripting languages
>>
File: seriously.jpg (16KB, 367x388px)
seriously.jpg
16KB, 367x388px
>>7678615
>not knowing what prototyping is
>wanting to optimize a prototype

premature optimization is the root of all evil.
>>
>>7678929
>premature optimization is the root of all evil.
the guy who is quoted to say that actually has written articles on how this has been the biggest literal misinterpretation of his thoughts ever

optimization from step 0 is the new black ;)
>>
>>7678968
>optimization from step 0 is the new black ;)

>black
>not the root of all evil

Explain niggers then Anon? PROTIP: You can't.
>>
>>7678976
i'm a racist too, yes, but this shit doesn't belong here and neither is it even remotely funny
>>
PERL
E
R
L
>>
>>7678981
I'm trying to get b&ed for racism on /sci/ for reasons that I won't fully explain right now. Just report my post and move on. Nigger.
>>
What about Julia? They are shilling it as the new hot language for scientific computing.

http://julialang.org/
https://en.wikipedia.org/wiki/Julia_%28programming_language%29
>>
>>7679004
promising, but insufficiently mature as yet to replace extant languages
>>
>>7678929
Knuth was talking about mundane shit like manually unrolling loops or bullshit like that, stuff that might make a 1% decrease in runtime.

Recognizing a major inefficiency and correcting it ahead of time is perfectly fine, and good practice.
>>
>>7678615
This meme needs to end. These people aren't developing this software to be released to the public, of which most aren't running a commodore.

It's being developed and used on dedicated machines to increase productivity and get results. If spending a couple hours less developing a program leads to only a few negligible milliseconds or seconds per simulation on a research team that doesn't have experienced low level coders or a large budget, that means a hell of a lot.

If they were pushing their bad code to the public that'd be different but the code they're writing is getting used by then on only their machines.
>>
>>7678584
It depends what you're doing though surely? Fortran, Rust, Racket?
>>
>>7678531
Depends on your field.
I used Matlab to fuck around.
I know people who write Fortran for simulations.
>>
>>7678560
>>7678563

Python is gay (not terrible but gay).
>>
>>7678968

No it's not. You can keep it in the back of your head, and that's fine. But identifying performance bottlenecks on a prototype or proof-of-concept version, is a waste of time. At that point your main concern should be to get something done that works, period.

>>7679014

I was mainly referring to prototyping. When you're prototyping you usually use tools that increase development speed, not the tools with the fastest runtimes and compile times. Why? Because it's a fucking prototype, proof-of-concept... you want to have something to show ASAP.
>>
>>7678877
>GNU/Linux
>python(when I'm feeling GNU),

Switch to a free and academically friendly license like BSD.

>Perl(one guy on the team writes it)

Take him out back and SHOOT him.

>C#(legacy code),

What fucking code is legacy in C#?! Who the fuck thought it was a good idea to code in C#

>Lua(for some sim software),

I can't wait for the day Lua kills off all other scripting languages, especially python and its autistic white space rules.
>>
brainfuck
not even trolling
>>
I use R, but that's mostly because it was the first thing I was taught, and so it's what I'm best at (also RStudio <3) but may switch into python now that Rodeo is making shit happen.
>>
>>7678929
>premature optimization
i want this meme to die
>>
>>7679004
I'm taking a class that requires me to use Julia. I really like it.

The only downside is that there are a lot of algorithms I use day to day that aren't already implemented. If they're not performance critical, I'll just use PyCall, but otherwise I'm writing it myself.
>>
Forced to use Matlab at big defense contractor. It works, but would rather use Python. I've been pushing for them to install Python for years. Company is so bureaucratic that getting Python approved for use would cost thousands of dollars.

> tfw when corporate bureaucracy makes open source software too expensive
>>
>>7680126
>>7679004
Julia is an example of a mistake IMO, it tries to unify scripting languages and fast compiled languages like Fortran and C used in scientific computing by making a scripting language run almost as fast as compiled languages. But you lose a lot of power by just using a dynamically typed scripting language (TDD needed on large projects to making up for type checking). There are compiled languages that can run interpreted mode like Swift, D, Ocaml, Haskell, etc. There should be more effort put into making compiled languages function as scripting languages while in interpreted mode.
Thread posts: 64
Thread images: 6


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.