Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

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'm trying to input a second order differential equation to solve into matlab over x = 0 to x =1. I can't figure out how. Here's the equation:

$\displaystyle y'' = 1 + 0.1 \sqrt{1+(y')^2}$

with initial conditions at zero.

share|cite|improve this question
up vote 2 down vote accepted

MATLAB doesn't support second order differential equations outright; it's your job to turn your problem into a system of first order differential equations, as mentioned here.

To wit, first construct the appropriate function:

function dy = rapidash(t,y)
dy = zeros(2,1);
dy(1) = y(2);
dy(2) = 1+0.1*sqrt(1+y(2).^2);

and, using ode45() as an example, ode45(@rapidash,[0,1],(conditions)).

share|cite|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.