# Recent content by Moly

1. ### Newton for a 4x4 system of nonlinear eqns

Hi All. I think i figured it out... i am attaching the program below for a linear set of eqns... that was just to verify that all is working well... however, i was told that the method should converge in one iteration for a linear system, and for me it happens in 3.. am i doing something wrong...
2. ### MATLAB Setting up Newton Raphson integral with matlab

Thanks Gib. I figured where i went wrong.. i still have a question that i will post later today
3. ### MATLAB Double integrals with matlab

Now, this is giving me the corrrect answer but not sure if i cheated in a way or not... what do you think: close all clear all x0=0; xt=1; xstep=110; dx=1/(xstep-1); y0=0; yt=1; ystep=110; dy=1/(ystep-1); sum2=0; for i1=1:ystep+1 sum1=0; y=(i1-1)*dy; x2step=floor(y/dx)...
4. ### MATLAB Double integrals with matlab

oh... forgot to say that I am using trapazoidal rule for the integration
5. ### MATLAB Double integrals with matlab

the program that i put together is giving me the integral=24.8427 and the answer is actually 0.316... my program is copied below, what am i doing wrong: x0=0; xt=1; xstep=11; dx=1/(xstep-1); y0=0; yt=1; ystep=11; dy=1/(ystep-1); sum2=0; for i1=1:xstep sum1=0; y=(i1-1)*dy...
6. ### MATLAB Double integrals with matlab

Hi Everyone. I would like to integrate the following using matlab: \int_0^1 ~\int_0^x e^{-x^2} ~dy ~dx looks pretty simple but don't know how to set up the embedded for loops for the integral with in the integral especially that the upper limit of the inner integral is x and not a number...
7. ### Newton for a 4x4 system of nonlinear eqns

Hi All. Can somebody give me a sample matlab code for Newton-Raphson Method for Nonlinear 4x4 System of Equations. I'm trying to set a very ugly one up and haven't seen NR before the beginning of this week. I've figured the NR for a single eqn but this is driving me nuts.
8. ### MATLAB Setting up Newton Raphson integral with matlab

Hi All. I have an equation that i want to numerically find the root of by using Newton Raphson. However the equation involves an integral which i am using the trapazoidal rule to evaluate. And here is the simplified version of it: 1 = e^{-cy} \int_0^1 e^{-y(1-x)} dx So i am supposed...
9. ### Partial derivative

Try this: replace every x with the constant a... now the equation should look like it is in one variable, y. So what you need now is to find the second derivative with respect to y. Does that make life easier?
10. ### Matlab animation - how to from figures

Compared to the questions out there, my question seems VERY SIMPLE. I have a code that generates a few graphs. Instead of super-imposing the graphs on one figure, I would like matlab to generate an animation of those graphs for me. I tried looking at help and my intution tells me that...
11. ### Fortran Beginner fortraner: messing up arithmatic

Thanks a lot Borek. I changed Xstep and Nstep from integers to real and now the calculations come out right. I am sure i will have another silly question in a few minutes and your help is muuuuuuuuuuuuuuuuuuuuuuuuuuuuch appreciated
12. ### Fortran Beginner fortraner: messing up arithmatic

Hi All. I am trying to rewrite a program that i have in matlab to one in fortran. as i chug along, i am comparing the results and i am getting funny answers. This is the program in have in fortran so far: ccccccccccccccccccccccccccccccccccccccccccccccccc program main implicit...

thanks
14. ### MATLAB Matlab - number format

Thank you for your reply. i tried the first few before posting my question and could not really figure it out. any advice as to which specific option to use?