Fortran 90, surface integrals

In summary, to solve a surface integral on Fortran 90, you would need to start by drawing a drawing, then work out a few examples for the simplest possible cases, then use a flowchart to see what kind of stuff is needed to solve subproblems.
  • #1
Supermann11
5
0
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!
 
Physics news on Phys.org
  • #2
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.
 
  • #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:
  • #4
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.
 
  • #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!
 
  • #6
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.
 
  • Like
Likes 1 person
  • #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 :)
 
  • #8
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.
 
  • #9
Fortran 90 and surface integrals

Homework Statement


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.

Homework Equations



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

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:
  • #10
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...).
 

What is Fortran 90?

Fortran 90 is a programming language commonly used in scientific and engineering applications. It is an extension of the original Fortran language, with added features such as dynamic memory allocation and better support for structured programming.

What are surface integrals?

A surface integral is a mathematical concept used to calculate the flux of a vector field across a surface. It involves integrating a vector function over a surface in 3-dimensional space.

How is Fortran 90 used in calculating surface integrals?

Fortran 90 has built-in functions and subroutines that can be used to perform mathematical operations, including surface integrals. These functions make it easier to code and solve complex mathematical problems, such as surface integrals.

What are the advantages of using Fortran 90 for surface integrals?

Fortran 90 is a highly efficient and fast language, making it ideal for complex calculations like surface integrals. It also has a well-established community and a large library of mathematical functions, making it easier to find support and resources for solving problems involving surface integrals.

Are there any resources available for learning Fortran 90 and surface integrals?

Yes, there are many online tutorials, books, and courses available for learning Fortran 90 and surface integrals. Additionally, many universities and research institutions offer workshops and courses on these topics. It is also helpful to consult with experienced Fortran programmers or join online communities for support and guidance.

Similar threads

  • Advanced Physics Homework Help
Replies
8
Views
361
  • Advanced Physics Homework Help
Replies
7
Views
1K
  • Advanced Physics Homework Help
Replies
1
Views
1K
  • Advanced Physics Homework Help
Replies
26
Views
4K
Replies
4
Views
144
  • Advanced Physics Homework Help
Replies
2
Views
1K
  • Advanced Physics Homework Help
Replies
3
Views
1K
  • Advanced Physics Homework Help
Replies
1
Views
1K
  • Advanced Physics Homework Help
Replies
0
Views
556
  • Programming and Computer Science
Replies
3
Views
326
Back
Top