MathOverflow is a question and answer site for professional mathematicians. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I programmed a Nystrom Algorithm specifically for my problem:

This is the exact equation i want to solve:


And this is my algorithm

function [T U] = Nystrom(a,b,u0,h,w,v,e)
    % a is the initial value
    % b is the final value
    % u0 is a vector with the initial conditions y(0) and y'(0)
    % h is the size of every step
    % w, v and e are constants.

    M=(b-a)/h+2; %Steps
    T=zeros(1,M+2); %Time vectors
    U=zeros(2,M+2); %y and y' vector
    T=a:h:b; % i use uniform steps of size h
    U(:,1)=u0; %i stablish the initial conditions

    U(1,2)=U(1,1)+h*U(2,1)+(h^2)/2 * (w^2-e*cos(T(1))*sin(U(1,1))-v*U(2,1));

    for i=3:M

    for i=1:M


The problem is, it doesn't work and i don't know why. It's throwing values bigger and bigger in every step, but solving the same problem with other methods gives different, quite smaller values.

Any idea could help. Thank you!

share|cite|improve this question
Dear Federico, try Yo may get an answer there more quickly. – András Bátkai Dec 3 '12 at 7:46
First of all: Why is it $\sin(U(\dots))$ when the equation reads $\sin t$? Which one is a typo? – fedja Dec 4 '12 at 2:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.