Use of Scipy in a students final year mechanical engineering project.
Hi, I sent this email to Eric Jones, but he recommended that I send it to this mailing list instead. I'm trying to see if scipy could fit into a final year project for my mechanical engineering course. I am a student of mechanical engineering in UCD Dublin , and part of my course involves doing a final year project. We do very little programming in my course, but as coding and python in particular is something that interests me, I'd like to have some involvement in python in my final year project. Because my course is not centered around coding, I think I'd be more likely to be able to do a project on applying a python application like scipy to a problem, or using python as glue in a scripting applicatin. I found scipy while searching for an idea for a project that I could do in python, while staying within the scope of mechanical engineering and my course. I'm still no closer to an idea, so I thought I'd write to you to see if you had any ideas of what I might be able to do as a mechanical engineer with python/scipy. Something that I think might be plausible might be a simulation or computational analysis of some kind, but I would probably need to justify using python for whatever I do rather than MatLab, which is the industry standard, and the program that my lecturers are already familiar with. I have never used MatLab myself, so I'm not sure what it offers. I would appreciate any thoughts you might have on this. I emailed one of my lecturers already, who asked me for more specific details and to give thought to the type of project I would like to do. Kind Regards, Stephen Kelly
Stephen; I'm a mechanical engineer; it's interesting to see that Matlab is also the default choice in your part of the world and that programming doesn't feature very well in your mechanical course, the same here... 1) Why don't you you do a small FEA program, assuming that you have knowledge of this? Something simple where you can define 2D geometry with AutoCAD or anything that can save in DXF format. You'll have to read in the DXF file, represent with Matplotlib, mesh it (perhaps using Delaunay), apply loads and constraints and solve the system. Or perhaps just some aspects of this? 2) There's a whole lot of heat and mass transfer problems I can think of (see book by Mills). To justify this simply state that as a practising engineer entering into your first job, you're boss is not going to buy Matlab for you just so that you can solve a few problems. He'll most likely expect you to use Excel (since everyone has that), but Python is free and can do the job... Regards, William Hunter On 07/08/06, Stephen Kelly <stephen.kelly2@ucdconnect.ie> wrote:
Hi,
I sent this email to Eric Jones, but he recommended that I send it to this mailing list instead. I'm trying to see if scipy could fit into a final year project for my mechanical engineering course.
I am a student of mechanical engineering in UCD Dublin , and part of my course involves doing a final year project. We do very little programming in my course, but as coding and python in particular is something that interests me, I'd like to have some involvement in python in my final year project.
Because my course is not centered around coding, I think I'd be more likely to be able to do a project on applying a python application like scipy to a problem, or using python as glue in a scripting applicatin. I found scipy while searching for an idea for a project that I could do in python, while staying within the scope of mechanical engineering and my course. I'm still no closer to an idea, so I thought I'd write to you to see if you had any ideas of what I might be able to do as a mechanical engineer with python/scipy.
Something that I think might be plausible might be a simulation or computational analysis of some kind, but I would probably need to justify using python for whatever I do rather than MatLab, which is the industry standard, and the program that my lecturers are already familiar with. I have never used MatLab myself, so I'm not sure what it offers.
I would appreciate any thoughts you might have on this. I emailed one of my lecturers already, who asked me for more specific details and to give thought to the type of project I would like to do.
Kind Regards,
Stephen Kelly _______________________________________________ SciPy-user mailing list SciPy-user@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-user
-- Regards, WH
On Mon, Aug 07, 2006 at 09:53:31AM +0200, William Hunter wrote:
1) Why don't you you do a small FEA program, assuming that you have knowledge of this? Something simple where you can define 2D geometry with AutoCAD or anything that can save in DXF format. You'll have to read in the DXF file, represent with Matplotlib, mesh it (perhaps using Delaunay), apply loads and constraints and solve the system. Or perhaps just some aspects of this?
If something that reads DXF files and is able to plot them with matplotlib (and describe them with numpy arrays) come out with an open source licence, I think many people would be interested. I know the guys at enthought have some code that does something like this, so they may be able to help you with that project. However, they make a living selling this thing, so I don't know how much of their knowledge they will be willing to share (and that's quite understandable). -- Gaël
Gael Varoquaux wrote:
On Mon, Aug 07, 2006 at 09:53:31AM +0200, William Hunter wrote:
1) Why don't you you do a small FEA program, assuming that you have knowledge of this? Something simple where you can define 2D geometry with AutoCAD or anything that can save in DXF format. You'll have to read in the DXF file, represent with Matplotlib, mesh it (perhaps using Delaunay), apply loads and constraints and solve the system. Or perhaps just some aspects of this?
If something that reads DXF files and is able to plot them with matplotlib (and describe them with numpy arrays) come out with an open source licence, I think many people would be interested.
I know the guys at enthought have some code that does something like this, so they may be able to help you with that project. However, they make a living selling this thing, so I don't know how much of their knowledge they will be willing to share (and that's quite understandable).
We actually read/write STL format files in our recent project and use tvtk for the visualization. Some of this _is_ necessarily closed, but we'd be glad to discuss what we've done and there's an off-chance there may be some things we could share. Best, Travis
On 8/7/06, Stephen Kelly <stephen.kelly2@ucdconnect.ie> wrote:
Something that I think might be plausible might be a simulation or computational analysis of some kind, but I would probably need to justify using python for whatever I do rather than MatLab, which is the industry standard, and the program that my lecturers are already familiar with. I have never used MatLab myself, so I'm not sure what it offers.
I don't think you "need to justify using Python for whatever you do rather than MatLab", specially since you are doing this in the scope of a university project. I have used Python to solve some problems for my university courses and have had no problems at all (Civil engineering in UPV <http://www.upv.es>). Just write an introductory paragraph with a general description of the language (see for example www.python.org) and of the packages you will be using so that the lecturers know what you are using. And if you do need to justify it's usage: it's more versatile than MatLab plus it's allway better to know Python and MatLab than just knowing MatLab. And it's free. Armando Serrano
Another thought(s). Something you're likely to come across if you end up in the mechanical design field, is the use of codes... Why don't you write a program that can calculate the dimensions of a pressure vessel, according to ASME, for example? Or a gear design program which will output the 3D gear? A program to design offshore containers to DNV's CN 2.7-1? Go look at some of the add-ins available for programs like SolidWorks and Solid Edge, you might find some ideas here too. For programs like these the user (probably yourself one day) would typically want an intuitive UI, some form of customisation, be it by editing a text file with material spec's or a file specifying pipe and/or flange dimensions, and DEFINITELY output in the form of a CAD file (I would say DXF/IGES for 2D and StL/XML/VRML for 3D. You can attempt Parasolid, ACIS or STEP, but these are not as simple as StL and last mentioned is in wide use by the rapid prototyping industry). One would possibly also want to view (matplotlib) the pressure vessel before saving it as a DXF file for instance. Maybe add an option to enter "Company and Project Details" when saving the file as a DXF... There's a lot of options! Regards, William On 07/08/06, John Hassler <hasslerjc@adelphia.net> wrote:
You've gotten a lot of very good responses already. I'd just make a couple of comments.
I'm a former prof. of ChE (retired). When I started out (a long time ago), industrial plants were built in several stages: beaker, bucket, barrel, (maybe more), final plant. You would start with bench-scale experiments in the laboratory, and work through progressively larger "pilot plants" until you were confident that you understood the process well enough to commit to building the full-scale plant. Now, design is done through computer modeling and simulation, and pilot plants are rarely, if ever, used. The same is true in all fields of engineering. For example, computer chips are simulated in detail before being tried "in silicon."
In spite of this, most engineers never learn to program at any level beyond the most basic. I'm not familiar with your field, but in ChE, there are "black box" programs (Aspen, ChemCad) which will do very sophisticated modeling, without requiring much knowledge on the part of the operator. I think this is unfortunate ... but then, I'm old fashioned.
I'm a visiting prof. here at VaTech. The engineering college has standardized on Matlab. I don't like it much, for two reasons. First, it's outrageously expensive. (Scilab, as an example, is free, similar to Matlab in basic capabilities, works under both Windows and Linux, and is certainly sufficient for any but the most demanding computational problems.) Second, Matlab makes it difficult to write well-structured programs of any appreciable size. Python-Scipy, on the other hand, is a "real" programming language, which can handle VERY large programs with "grace and beauty," and can do small programs with convenience. The "immediate" calculational abilities (IDLE) are more convenient than those of Matlab, since you can define functions "on the fly" ... Matlab requires "m-files" for functions ... and I've used Python plus Numeric to solve some reasonably large FEM examples in acceptable times.
So if you needed any more encouragement to look into a modeling problem with Python, perhaps this will help.
(As I re-read what I've written, I guess I could have just said, "Computing .. important. Python... good." Professors are long winded ..... )
john
Stephen Kelly wrote:
Hi,
I sent this email to Eric Jones, but he recommended that I send it to this mailing list instead. I'm trying to see if scipy could fit into a final year project for my mechanical engineering course.
I am a student of mechanical engineering in UCD Dublin , and part of my course involves doing a final year project. We do very little programming in my course, but as coding and python in particular is something that interests me, I'd like to have some involvement in python in my final year project.
Because my course is not centered around coding, I think I'd be more likely to be able to do a project on applying a python application like scipy to a problem, or using python as glue in a scripting applicatin. I found scipy while searching for an idea for a project that I could do in python, while staying within the scope of mechanical engineering and my course. I'm still no closer to an idea, so I thought I'd write to you to see if you had any ideas of what I might be able to do as a mechanical engineer with python/scipy.
Something that I think might be plausible might be a simulation or computational analysis of some kind, but I would probably need to justify using python for whatever I do rather than MatLab, which is the industry standard, and the program that my lecturers are already familiar with. I have never used MatLab myself, so I'm not sure what it offers.
I would appreciate any thoughts you might have on this. I emailed one of my lecturers already, who asked me for more specific details and to give thought to the type of project I would like to do.
Kind Regards,
Stephen Kelly ________________________________
_______________________________________________ SciPy-user mailing list SciPy-user@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-user
_______________________________________________ SciPy-user mailing list SciPy-user@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-user
-- Regards, WH
Why scipy: Say you have a inner loop like: X = X + F * dt In either Matlab or scipy, it will probably work as: temp1 = F * dt temp2 = X + tempF X = temp2 Which is slower than nessesary, because you have to assign those great hunks of memory to temp1 and temp2. If you use weave.inline (after doing a rapid prototype in pure python - because debugging segfaults when you make a mess of your indicies is never fun, or easy), you can get rid of the big temporary arrays. You can also do this in Matlab (using CXX), but you could simply plead that it is easier for you to do using inline. This is a pretty trivial example. There is no limit to the number of intensive operations that you can't find a good vectorized function for. Speaking of which, have you seen the "vectorize" command in scipy? It seems a little slow (next to inline), but it sure beats running an inner loop in pure Matlab or python. Good luck, Peter On 8/8/06, William Hunter <willemjagter@gmail.com> wrote:
Another thought(s). Something you're likely to come across if you end up in the mechanical design field, is the use of codes...
Why don't you write a program that can calculate the dimensions of a pressure vessel, according to ASME, for example? Or a gear design program which will output the 3D gear? A program to design offshore containers to DNV's CN 2.7-1?
Go look at some of the add-ins available for programs like SolidWorks and Solid Edge, you might find some ideas here too.
For programs like these the user (probably yourself one day) would typically want an intuitive UI, some form of customisation, be it by editing a text file with material spec's or a file specifying pipe and/or flange dimensions, and DEFINITELY output in the form of a CAD file (I would say DXF/IGES for 2D and StL/XML/VRML for 3D. You can attempt Parasolid, ACIS or STEP, but these are not as simple as StL and last mentioned is in wide use by the rapid prototyping industry). One would possibly also want to view (matplotlib) the pressure vessel before saving it as a DXF file for instance. Maybe add an option to enter "Company and Project Details" when saving the file as a DXF... There's a lot of options!
Regards, William
On 07/08/06, John Hassler <hasslerjc@adelphia.net> wrote:
You've gotten a lot of very good responses already. I'd just make a
of comments.
I'm a former prof. of ChE (retired). When I started out (a long time ago), industrial plants were built in several stages: beaker, bucket, barrel, (maybe more), final plant. You would start with bench-scale experiments in the laboratory, and work through progressively larger "pilot plants" until you were confident that you understood the process well enough to commit to building the full-scale plant. Now, design is done through computer modeling and simulation, and pilot plants are rarely, if ever, used. The same is true in all fields of engineering. For example, computer chips are simulated in detail before being tried "in silicon."
In spite of this, most engineers never learn to program at any level beyond the most basic. I'm not familiar with your field, but in ChE, there are "black box" programs (Aspen, ChemCad) which will do very sophisticated modeling, without requiring much knowledge on the part of the operator. I think this is unfortunate ... but then, I'm old fashioned.
I'm a visiting prof. here at VaTech. The engineering college has standardized on Matlab. I don't like it much, for two reasons. First, it's outrageously expensive. (Scilab, as an example, is free, similar to Matlab in basic capabilities, works under both Windows and Linux, and is certainly sufficient for any but the most demanding computational
Matlab makes it difficult to write well-structured programs of any appreciable size. Python-Scipy, on the other hand, is a "real"
language, which can handle VERY large programs with "grace and beauty," and can do small programs with convenience. The "immediate" calculational abilities (IDLE) are more convenient than those of Matlab, since you can define functions "on the fly" ... Matlab requires "m-files" for functions ... and I've used Python plus Numeric to solve some reasonably large FEM examples in acceptable times.
So if you needed any more encouragement to look into a modeling problem with Python, perhaps this will help.
(As I re-read what I've written, I guess I could have just said, "Computing .. important. Python... good." Professors are long winded ..... )
john
Stephen Kelly wrote:
Hi,
I sent this email to Eric Jones, but he recommended that I send it to
mailing list instead. I'm trying to see if scipy could fit into a final year project for my mechanical engineering course.
I am a student of mechanical engineering in UCD Dublin , and part of my course involves doing a final year project. We do very little
my course, but as coding and python in particular is something that interests me, I'd like to have some involvement in python in my final year project.
Because my course is not centered around coding, I think I'd be more
couple problems.) Second, programming this programming in likely
to be able to do a project on applying a python application like scipy to a problem, or using python as glue in a scripting applicatin. I found scipy while searching for an idea for a project that I could do in python, while staying within the scope of mechanical engineering and my course. I'm still no closer to an idea, so I thought I'd write to you to see if you had any ideas of what I might be able to do as a mechanical engineer with python/scipy.
Something that I think might be plausible might be a simulation or computational analysis of some kind, but I would probably need to justify using python for whatever I do rather than MatLab, which is the industry standard, and the program that my lecturers are already familiar with. I have never used MatLab myself, so I'm not sure what it offers.
I would appreciate any thoughts you might have on this. I emailed one of my lecturers already, who asked me for more specific details and to give thought to the type of project I would like to do.
Kind Regards,
Stephen Kelly ________________________________
_______________________________________________ SciPy-user mailing list SciPy-user@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-user
_______________________________________________ SciPy-user mailing list SciPy-user@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-user
-- Regards, WH _______________________________________________ SciPy-user mailing list SciPy-user@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-user
John Hassler <hasslerjc <at> adelphia.net> wrote:
You've gotten a lot of very good responses already. I'd just make a couple of comments.
Indeed I have. Thanks to all for the replies, there are certainly some good points here. I've been very busy and having difficulty finding the time to pursue this further. I will send my lecturer a link to this thread, and hopfully some suitable ideas can be investigated. William Hunter <willemjagter <at> gmail.com> wrote:
1) Why don't you you do a small FEA program, assuming that you have knowledge of this? Something simple where you can define 2D geometry with AutoCAD or anything that can save in DXF format. You'll have to read in the DXF file, represent with Matplotlib, mesh it (perhaps using Delaunay), apply loads and constraints and solve the system. Or perhaps just some aspects of this?
The urapiv project looks interesting, but might be beyond my abilities at this time, seeing as I do not have much academic programming experience. However, I could have more experience by next year to take on greater challenges in a Masters role. My current experience in python has mainly been exploratory. I've done some tutorials, and made a few one off programs to simplify repetitive tasks. The biggest project I've used python for was to make infoboxes on a mediawiki website using the pywikipediabot framework. That involved mainly string parsing of the source data, but I learned a lot about string and array objects. I haven't yet found the time to use scipy and see for myself what I can do with it, but I will hopefully get the chance to do so next week. I'll have a look around the wiki and mailing list and find some demos and tutorials. Even if a project I do this year is not centered around scipy, I will certainly try to use it for any computation that comes up. Thanks again for the responses and interest in this. Stephen Kelly. ----- Original Message ----- From: Peter Row <peter.row@gmail.com> Date: Tuesday, August 8, 2006 3:08 pm Subject: Re: [SciPy-user] Use of Scipy in a students final year mechanical engineering project. To: SciPy Users List <scipy-user@scipy.org>
Why scipy:
Say you have a inner loop like:
X = X + F * dt
In either Matlab or scipy, it will probably work as:
temp1 = F * dt temp2 = X + tempF X = temp2
Which is slower than nessesary, because you have to assign those great hunks of memory to temp1 and temp2.
If you use weave.inline (after doing a rapid prototype in pure python - because debugging segfaults when you make a mess of your indicies is never fun, or easy), you can get rid of the big temporary arrays.
You can also do this in Matlab (using CXX), but you could simply plead that it is easier for you to do using inline.
This is a pretty trivial example. There is no limit to the number of intensive operations that you can't find a good vectorized function for.Speaking of which, have you seen the "vectorize" command in scipy? It seems a little slow (next to inline), but it sure beats running an inner loop in pure Matlab or python.
Good luck, Peter
On 8/8/06, William Hunter <willemjagter@gmail.com> wrote:
Another thought(s). Something you're likely to come across if you
end> up in the mechanical design field, is the use of codes...
Why don't you write a program that can calculate the dimensions
pressure vessel, according to ASME, for example? Or a gear design program which will output the 3D gear? A program to design offshore containers to DNV's CN 2.7-1?
Go look at some of the add-ins available for programs like SolidWorks> and Solid Edge, you might find some ideas here too.
For programs like these the user (probably yourself one day) would typically want an intuitive UI, some form of customisation, be it by editing a text file with material spec's or a file specifying pipe and/or flange dimensions, and DEFINITELY output in the form of a CAD file (I would say DXF/IGES for 2D and StL/XML/VRML for 3D. You can attempt Parasolid, ACIS or STEP, but these are not as simple as StL and last mentioned is in wide use by the rapid prototyping industry).> One would possibly also want to view (matplotlib) the
before saving it as a DXF file for instance. Maybe add an option to enter "Company and Project Details" when saving the file as a DXF... There's a lot of options!
Regards, William
On 07/08/06, John Hassler <hasslerjc@adelphia.net> wrote:
You've gotten a lot of very good responses already. I'd just
make a couple
of comments.
I'm a former prof. of ChE (retired). When I started out (a long time ago), industrial plants were built in several stages: beaker, bucket, barrel,> > (maybe more), final plant. You would start with bench- scale experiments in the laboratory, and work through progressively larger "pilot
you were confident that you understood the process well enough to commit to building the full-scale plant. Now, design is done through computer> > modeling and simulation, and pilot plants are rarely, if ever, used. The same is true in all fields of engineering. For example, computer chips are simulated in detail before being tried "in silicon."
In spite of this, most engineers never learn to program at any level> beyond the most basic. I'm not familiar with your field, but in ChE,
"black box" programs (Aspen, ChemCad) which will do very sophisticated> > modeling, without requiring much knowledge on the
think this is unfortunate ... but then, I'm old fashioned.
I'm a visiting prof. here at VaTech. The engineering college has standardized on Matlab. I don't like it much, for two reasons. First, it's outrageously expensive. (Scilab, as an example, is free, similar to Matlab in basic capabilities, works under both Windows and Linux, and is certainly sufficient for any but the most demanding computational
Matlab makes it difficult to write well-structured programs of any appreciable size. Python-Scipy, on the other hand, is a "real"
operator. I problems.) Second, programming
language, which can handle VERY large programs with "grace and beauty,"> and can do small programs with convenience. The "immediate" calculational> > abilities (IDLE) are more convenient than those of Matlab, since you can define functions "on the fly" ... Matlab requires "m-files" for functions ... and I've used Python plus Numeric to solve some reasonably large FEM examples in acceptable times.
So if you needed any more encouragement to look into a modeling
Python, perhaps this will help.
(As I re-read what I've written, I guess I could have just said, "Computing .. important. Python... good." Professors are long winded ..... )
john
Stephen Kelly wrote:
Hi,
I sent this email to Eric Jones, but he recommended that I send it to this mailing list instead. I'm trying to see if scipy could fit into a final year project for my mechanical engineering course.
I am a student of mechanical engineering in UCD Dublin , and
course involves doing a final year project. We do very little programming in my course, but as coding and python in particular is something
year
project.
Because my course is not centered around coding, I think I'd be more> likely to be able to do a project on applying a python application
to a
problem, or using python as glue in a scripting applicatin. I found> scipy while searching for an idea for a project that I could do in
of a pressure vessel plants"> until there are part of the problem> with part of my that> > interests me, I'd like to have some involvement in python in my final like scipy python,> while
staying within the scope of mechanical engineering and my course. I'm still no closer to an idea, so I thought I'd write to you to see if you had any ideas of what I might be able to do as a mechanical engineer with python/scipy.
Something that I think might be plausible might be a simulation or computational analysis of some kind, but I would probably need to justify using python for whatever I do rather than MatLab, which is the industry> > standard, and the program that my lecturers are already familiar with. I have never used MatLab myself, so I'm not sure what it offers.
I would appreciate any thoughts you might have on this. I emailed one of my lecturers already, who asked me for more specific details and to give thought to the type of project I would like to do.
Kind Regards,
Stephen Kelly ________________________________
_______________________________________________ SciPy-user mailing list SciPy-user@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-user
_______________________________________________ SciPy-user mailing list SciPy-user@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-user
-- Regards, WH _______________________________________________ SciPy-user mailing list SciPy-user@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-user
Along the lines of "what can be done" with Python, go to: http://comptlsci.anu.edu.au/tutorials.html and look, in particular, at the Navier-Stokes module. (The example uses Python for scripting, and C for the heavy crunching. Although I haven't gotten around to trying it, I think that Python/Scipy would also be practical. Python/Numeric was certainly fast enough for some FEM work I did.) john Stephen Kelly wrote:
[snip]
I haven't yet found the time to use scipy and see for myself what I can do with it, but I will hopefully get the chance to do so next week. I'll have a look around the wiki and mailing list and find some demos and tutorials. Even if a project I do this year is not centered around scipy, I will certainly try to use it for any computation that comes up.
Thanks again for the responses and interest in this. Stephen Kelly.
participants (7)
-
Armando Serrano Lombillo -
Gael Varoquaux -
John Hassler -
Peter Row -
Stephen Kelly -
Travis N. Vaught -
William Hunter