📜 ⬆️ ⬇️

Programming in scientific work

image
At school, studying computer science and participating in programming contests, I suspected that the ability to write algorithms would be useful in life. And the first research tasks, for example, “The monk went down to the cellar every day and drank a mug of wine from the barrel. And so that no one could guess - topped up with a cup of water. How many percent of the wine will be in the monk’s circle in 30 days? ”, Gave interesting life decisions like asymptotic dependencies. Today, I increasingly come across programming tasks in scientific and engineering research, which I would like to talk about. Let us trace the history of the development of a student in the physics department.

Personal computer in the 7th grade, the first program - in the 9th.

So, since my childhood I loved computers and kept dreaming about my own, so that I could not go to friends but play at home! It happened in high school, class, commercials, in the seventh. Of course, there was no talk of programming whatsoever - I just played demiurges, disciples, and other applications that I had previously met with friends. At the same time, familiarity with MS Word, Excel. The Internet, by the way, was not for a long time. In the ninth grade, the first study was conducted under the leadership of Mikhail Andreyevich Faddeev on the topic “Flight of a Ballistic Projectile with Account of the Atmosphere”, a little earlier we considered the problem of a satellite falling to Earth a whole group. We wrote the equations of dynamics, choosing the time dt calculated the changes in the coordinates, velocities and accelerations of the body. With the flight of the projectile, I spoke at the district conference on physics. Now, a little about applications: wrote the code in TurboPascal, outputted to a text file, graphs were built in Excel, presentation in PowePoint. The first steps, so to speak, in conditions of healthy competition from the son of MA - Leshki Faddeev, who already knew a lot and shared his knowledge.

Presentations are useful for the future researcher.

In the 10th grade, a new scientific work - “Calculation of the energy of covalent bonds in the dipole approximation”, I don’t remember about the work itself, but with it I spoke at the district, city concerts on physics, went to Moscow for Intel Avant-Garde and in Sarov on Kharitonov readings, where he took second place and received a score for admission to the MIPT. I wrote the code on pascal, VA Ivanov helped transfer it to Delphi, and then I thought of something, I do not remember anything. I did not have to program in the 11th grade, I entered the Physics Department with the work “Properties of a Tunnel Diode,” which I wrote under the supervision of Karzanov V.V. As a result, by the time I arrived at UNN, I knew how to write code on pascal, carry out calculations in Excel and make presentations in pointepoint. Twice he participated in the programming contest ( NNOI-3 and NNOI-4 ), at the last, as he found out, he even took a diploma.

Wolfram Mathematica - a good friend of physics

In the third semester there was a course on numerical methods on the book of Markov and Faddeev, where I met Wolfram Mathematica. A specialized application that reads your thoughts, allows you to quickly find errors and copy-paste the code from the examples. Big shocks after Pascal, where you had to watch a bunch of variables for debugging and it’s much harder to work with arrays, not to mention the graphs and the built-in mathematical functions of the package. I got used to this environment, I quickly, really liked the help, which requires knowledge of English. Here you can digress about the role of the language in programming. It seems to me that if where there is dominance of English, it is in programming - all the keywords, a lot of examples and literature. a bunch of specialized forums. You need to learn to program in English, memorize terms, and then it will be easier to google, many useful resources will open up.
In fact, the love of computers translates into programming. I came to the exam in cycling pants (for which it is still inconvenient, excuse me, Kirill Alexandrovich) quickly solved my puzzle and helped my fellow students a little, to whom this science was harder. So, from the second year I am familiar with this wonderful medium of express and simple calculations, which can be conveniently presented in the form of formulas. Nevertheless, there is a math and disadvantages - with built-in functions you have to understand when interested in the method of calculation. The picture below shows a recent programming experience, at the same time as the game in HMM3 Complete.
')
image

Installing OriginLab for the smallest squares method

In laboratory work, it was often necessary to approximate all kinds of OLS dependencies, and each teacher ordered to count the error. But the formulas in the book MA they were so disgusting and cumbersome that they had to look for workarounds. I remember Andrei Kashurin, wrote a program on the delphi for linear approximation with automatic calculation, and someone suggested to me that it can do Origin. So, for the sake of a linear approximation, I downloaded a package, which was terribly inconvenient after Excel, which allowed me not to consider the error of the least squares method anymore. Later I found a polynomial approximation there and many more functions for which the origin has statistics. Laba over, origin deleted, but always remembered about him .
In the fourth year V.V. Sdobnyakov, said that it would be useful to learn how to build graphics in the origin, and that in many scientific articles there are graphics out of it. He showed me the basics of the program, and then I was picking myself. To date, I do not use much of the functionality of the origin, but I do a lot of work in it: graphic design, approximation, search for peaks in the interference pattern. I know that in the origin you can write your own scripts for automating the study, save chapters for the design of graphs and all this could be useful to me if I had spent the proper time to study. In OriginLab, by the way, cool video tutorials on the official website. And today, for three hours I wrote the first script that replaces four consecutive operations, I came to success on 62 lines of code.

image

Engineers should be able to program installations.

I had to perform measurements and adjust some settings, and here I need to know how to program! Our installation of the Hall is based on digital devices that communicate with a PC through a COM-port, you have to smoke manuals and write incomprehensible commands. The measurement results are recorded in a txt-file, and an Excel Excel macro from the table, which I still cannot write, but probably will soon have to, because We will reconfigure the installation of the Hall.
Often, the LabVIEW virtual instrument environment is remembered, in which you can comfortably program the installation of any complexity with a pleasant interface and flexible functionality. Someday, our reactor in which we grow MCT epitaxial layers will be controlled with LabVIEW ...

Summarize

During labor activity, many physicists, chemists, biologists, mathematicians have to program. By the way, I completely forgot about MATLab, which I am studying now, it is also needed. In general, any scientist should be able to navigate the code, make a new code based on examples from the Internet and Help. I can not say in which environments I will have to process the information and whether it is necessary, in general, to automate it. I consider courses in numerical methods and mathematical modeling of physical processes important and fundamental for future scientists. Learn some serious programming languages ​​and get ready to learn new ones.

Source: https://habr.com/ru/post/173411/


All Articles