微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 微波和射频技术 > 电磁仿真讨论 > Programming Language Used in FDTD Simulations

Programming Language Used in FDTD Simulations

时间:03-22 整理:3721RD 点击:
My frined do you know why C is not preferred instead fortran being used in the simulations of FDTD ?

Fortran and Lisp is very few old (and new) program language can handle complex numbers as datatype from begining in language - is very importent factor if want and try different types of math algorithm and after time collect to well tested library and build application based on this...

for example elecrical simulator 'Spice' (written on fortran in beginning) have historic very much bugs in ported 'C'-version and very hard to debug and fix for low math skills people depend of librarys handle exeption not same way as fortran library (for example handle infinity etc.) or using differnt algorithm for complex number in mathlib. etc.

---

Sun had good chance make good modern language to replace Fortran with Java - but missed... ie. not complex datatype as primary variable and default trusted mathlib with full working complex support on all math functions as sqrt, sin, cos, tan, sinh, cosh, tan, ln , log, y^x, 10^x, e^x and function inverses from beginning. (Lisp support this as standard, and Fortran more or less complete complex support)


In java now need using 'complex.add(x,y), complex.sub(x,y), complex.tan(x)' etc.
for math operation on object with external, not so tested and trusty home made complex library, compare to scientic people want handle complex operation like

'z = v + x - y ;' [1]

with complex variable easy as real number,

now in days java needs written

'complex z = complex.add (v, complex.sub(x,y));' [2]

... is not easy or nice to read....

(possibly wrong written example of java)



If I remeber rigth, java cannot make operator overload (for make new type of +,-,*,/ on new datatype) so complex handling in java tend going very verbose in function call on object every math operation and hard to read for debugging and analyse what happend...

I have see post process routine written in java to make from 'easy' written
complex math like [1] in java to make version [2] java before compiling to binary java application...

This miss of complex datatype in language design, not tempt scientific/math people going from Fortran to java


---

C++ have possibility to make operator overload for example complex handling, and have complex library support per default, but is not so popular in science and math people... possibly coming to late and seems more complex compare to 'C', so people still written i C or Fortran and using old but trusty fortran library...

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top