Hey everyone. I want to extract numerical data from files let's say g0001.txt to g0060.txt and store it in a matrix with each element is an array.
like this:
M=[g1() g2() g3() ...g60()]
matrix order can be 1 x 60 , i.e. to say 1 row and 60 columns and each element is an array...
Hey guys i am a little confused in how to write arrays to a output file in FORTRAN 77. Here is the piece of code:
Please assume that rri and eei arrays have been defined correctly above
open (16,file='output.out')
write (16,6100) rri eei
format (5e16.8)
However in the output file...
Yup, well that was the error.
Thank you all of you, this program has been fun to debug. I don't know why the compiler didn't show this error or why the hell it was pointing to courant sub routine. I had to find this one manually by reading it.
Just a thought, do you guys see a possible error in this line?
open (16,file='boplot00.out',status='old')
write (16,6100) rri,eei
6100 format (5e16.8)
Is the correct way to open a new file for storing results ?
Hey Mark44, that's a great idea. I did, as you said and added the print statement.
print*, x0, e(k-1), x0/(e(k-1)
Well none of the values were equal to 0 or negative, hence i don't think that was the error in code.
But it's a start in debugging, and I would love to hear more such...
Do any of you guys have experience with f2c program ?
I was wondering whether I could translate the given FORTRAN code to C, which will make debugging and changing code easier.
Mark44, here it is:(it is huge)
program coad1d
parameter (n=400)
implicit double precision (a-h,o-z)
common /const/ rq0,dlnr,scal,ax
common /cour/ c(n,n),ima(n,n)
common /grid/ g(n),r(n),e(n)
common /kern/ ck(n,n),ec(n,n)
dimension...
Hey everybody, I am a mechanical engineer and new to Fortran(I have decent experience in programming in C, Matlab and understand languages similar to them). However the Fortran programming structure is new to me. Hence I am facing problems debugging a Fortran code.
Here is the link of the code...
Sorry for again disturbing all of you guys, but there seems to be another problem in the program.
It runs initially, but when I enter the values initially asked, the program stops mid-way showing an error:
Run-time Error
*** Error 112, Reference to undefined variable, array element or...
Hey everybody, I am a mechanical engineer and new to Fortran(I have decent experience in programming in C, Matlab and understand languages similar to them). However the Fortran programming structure is new to me. Hence I am facing problems debugging a Fortran code.
Here is the link of the code...
Someone I know clicked the image attached while on an airplane... I am confused regarding the strange contrasting pattern of clouds seen in this picture which makes us perceive that sun is leaving a trail(not really)... What caught my attention in this picture is the orientation of the...
Look at DOF in another way... Try to find the minimum number of coordinates you need to know the exact position of CO2 molecule , there are three atoms with each having x,y coordinates. Assume that you know the distance between Carbon And oxygen atoms.
I think your solution is wrong... it should come h1=3h2...but it's the last line of the question that's bugging me... i think we got to understand h2 relative to h1...
Well i am into designing of low - cost products right now, and am confused what sort of specialization should i undertake which helps me in designing new and innovative products. For ex. i have developed a low cost method for domestic cylinder users a way through which they can get the amount of...
Hi everybody, i am currently studying Mechanical engineering and about to enter second year... i was thinking of doing my masters in mechanical from world renowned colleges like MIT, Caltech, etc. ... i want to know which among such colleges are the best ? And what should one have to do to...
The relationship between refractive index and speed of light is by it's definition.The result sin i/ sin r is obtained by Fermat's principle which says light travels a path in shortest time.
Thank you very much.I am deeply interested in physics and thought of going to CMI.But after reading that article I don't think that I am going to that institute
e is a number originally defined as 1+(1/1!)+(1/2!)+(1/3!)+(1/4!)...∞. When you find the derivative of a^x then you get it as a^x*logea.When you find the derivative of a^x using first principle then you find the limith→0 (ah-1)/h.This limit on solving using binomial theorem for a^h you get the...
I know elliptic integrals.It comes when you try to find time period of a simple pendulum without taking usual approximation:that angular displacement is very small and that
sin(θ)≈θ in radians.But even elliptical integrals can't be solved analytically.You have to solve it in a...
Oh!Sorry.I didn't think about that.Well then all terms written by you are correct.But linear momentum should be conserved in such problems if mass of man is not much greater than mass of bullet.However in your problem it seems that book has assumed the mass of man to be much greater than mass of...
Yes it's correct.But should we neglect mass of man in comparison to mass of bullet?
If not then conserve linear momentum along cos component of velocity, i.e.
M*v=-m*vB*cos(θ).
'-' sign indicates man gets velocity in opposite direction of motion of bullet.Then the problem bcms complex bcs...
You can prove it graphically.By observing overall sum of areas.Areas above x-axis are positive, while below x- axis are negative.So when from nT to 0 all the positive and negative areas get added and cancel each other except from T to 0.That's your RHS.
I tried to find the length of a sine curve using calculus.I got stuck in the integral of integral(sqrt(cos(x)^2+1), x, 0, a). Limits are from 0 to point a,i.e. length of curve from 0 to any point a.With some approximations I found out the length of sine curve as a result.I have attached the...
Can you tell me that what would you do if nozzle is not very small, i.e. it has a small area 'a' and let's finite amount of water out(not point sized particles)??You also know area of topmost layer of water as 'A'.
Think it yourself.The answer becomes more interesting.
Hint:In that case don't...
Just take a small element of water of mass dm at a height s above the nozzle.
Initial energy=Potential Energy=dm*g*h
Final energy after just coming out from nozzle(assuming it to be at height 0)=0.5*dm*u^2
Equating final and initial energy you can get u=sqrt(2gs).
Here however we assume that...
You can find time period from purely energy method.
This is how:
Initial energy at mean position=potential energy stored at spring=0.5*k*d^2
Where d is extension of spring at mean position(mg/k).This term is constant.
Now write energy at any position=potential energy stored + kinetic energy of...
connecting rods touch disc at two points at r, and R.One is anti-clockwise torque and other is also anti-clockwise.So both get added.That's what it seems if you have both rods touching disc to brake it down.It seems unclear here.Though you haven't stated it here that only one rod touches disc or...
Use energy conservation to get velocity(u) of water just outside nozzle.You will get u=sqrt(2gs). Assuming nozzle is very small.Here s is distance of nozzle from topmost layer of water(4.00m). After getting velocity use kinematic equation (v^2)=(u^2)-2gh.
For highest point v=0.Thus getting...
Weight=Mass*Acceleration due to gravity=m*g
Assuming 60kg weight at 9.8 m/s^2 calculate mass m(60/9.8=6.122)). This will give mass.Now multiply mass by 9.6 to get kgf or weight for that place(6.122*9.6=58.775). Use results in significant figures if needed.
But in which plane?
I mean that whether the door is on floor and rotating about vertical axis or in an erect position rotating about vertical axis.Moment of inertia in both cases is different.
Compare AC with waves on a string.Particles in string oscillate about their position but net displacement in a time period their net displacement is zero.Yet your energy gets transferred across string and even released if there is some damping(just as resistance in case of DC or AC circuits)...
Write kinematic equations for car a and car b separately.
For car a:d=0.5*a*(t^2)
For car b:s=v*t+starting distance.
equate d and s.Get t
Here a=4.5(acceleration) v=25(velocity) t is time in seconds.
Consider the loop consisting of atoms.Each atom has electron's and in metals these electrons are free to move.Due to action of magnetic field we have force on electron as e*(v x B). Here 'x' is cross product of vectors.So electrons move to one end and all protons remain where there are.Thus...
Those lines are just drawn for sake of our convenience, to show connection between two very close numbers.You are right they don't exist there.
You will also get such lines for Fractional Part of x ({x}).
The attachment shows the graph using Microsoft Maths.Step function is also known as Greatest Integer Function(GIF).In GIF you only take integral part of that number.
Ex. No. is 2.348947 Here GIF of this(also represented as [2.348947]=2 known informally as box function-same as GIF) is 2...