1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Fortran 90, surface integrals

  1. Feb 12, 2014 #1
    I am dumfounded on how one would perform surface integrals in Fortran 90 over a platelet, or a rectangular box. I can do single and double integrals but I have no idea on how to do surface integrals

    Thanks in advance!
     
  2. jcsd
  3. Feb 12, 2014 #2

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    Well, we are just as dumbfounded as you.

    Fortran only provides a means to evaluate your formulas after you are done doing the calculus and algebra necessary to obtain a result.

    Now, if you could provide some specifics, say a particular problem you would like to solve, that would be a good start.
     
  4. Feb 12, 2014 #3
    Basically I am to find the magnetic field of a volume (with constant magnitisation) in or outside the said volume. The integral involved is:

    ∫∫(r-r').M(r').(|r-r'|^-3) dS'

    Where r' is the variable which must be integrated. M(r') is the magnetisation.

    So far I presume we can split the platlet into little 'cells' and r is the position of the cell. So r-r' is the contribution of a 'cell' to the magnetic field.
     
    Last edited: Feb 12, 2014
  5. Feb 12, 2014 #4

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    To evaluate integrals of this type, usually the region, surface, or volume is discretized in some fashion. Sometimes, the problem can be transformed using one of the integral theorems of Green or Stokes. Unless you can find canned (already written) Fortran programs designed to analyze these types of problems, you've got a pretty significant software development project waiting, much more so if you are only interested in solving one problem.

    In short, there is no intrinsic function or subroutine in Fortran where you write a couple of statements and a big hairy surface integral is reduced to a single number. You've got to write your own program or find a program someone else has already written.
     
  6. Feb 12, 2014 #5
    Thank you for your response. Do you have any pointers on how I would approach this problem? I get the fact that I need to discritize the surface and see how an elemetal cell contributes to the magnetic field, then add up all these elements but how would I go about that? I'm really struggling on how I could code this!
     
  7. Feb 12, 2014 #6

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    I'm not an E & M guy. I know a little finite element method, a little boundary element method, but mostly for stress analysis applications. If you are trying to develop a program from scratch to analyze a magnetic problem, plan to spend weeks, if not months, writing and testing code, especially since you don't appear to have much experience in developing this type of software. If you need a solution in a quicker time-frame, search out applications which can analyze such problems.

    It's also not clear if this is a class assignment or something you are doing for work. There are several books which discuss how to develop finite element programs. You can search for these using Google or Amazon.
     
  8. Feb 12, 2014 #7
    Cheers, it is for a class assignment. I doubt it'll be months as it's suppose to be completed in around 15 hours, Thanks for your help :)
     
  9. Feb 12, 2014 #8

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    If this is a homework assignment, you shouldn't be posting in this forum anyway.

    Try posting in one of the HW forums, say Advanced Physics or Calculus. You might get some useful discussion on your particular problem.
     
  10. Feb 12, 2014 #9
    Fortran 90 and surface integrals

    1. The problem statement, all variables and given/known data
    I am struggling on coding a solution to a surface integral on Fortran 90.

    Basically I am to find the magnetic field of a volume (with constant magnitisation) in or outside the said volume. The integral involved is:

    ∫∫(r-r').M(r').(|r-r'|^-3) dS'

    The surface is a platelet, like a box.

    Where r' is the variable which must be integrated. M(r') is the magnetisation.




    2. Relevant equations

    ∫∫(r-r').M(r').(|r-r'|^-3) dS'

    3. The attempt at a solution
    So far I presume we can split the platlet into little 'cells' and r is the position of the cell. So r-r' is the contribution of a 'cell' to the magnetic field.
     
    Last edited: Feb 12, 2014
  11. Feb 14, 2014 #10

    BvU

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    As a programmer and a physicist, I would start with a drawing. Fairly elaborate.
    Perhaps work out a few examples for the simplest possible cases.
    Surf to see what worked out solutions (not programs, just the physics side) are available -- nice test material later on, too!
    See what kind of stuff is needed to solve subproblems, draw (and erase, draw again) a flowchart of these subroutines, etc.
    15 hours isn't much on the clock, but for an assignment like this it's not all that bad (if only because you can always point out later that others worked on the more general routines for years and years...).
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Fortran 90, surface integrals
Loading...