Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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|improve this question
add comment

1 Answer 1

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|improve this answer
add comment

Your Answer

 
discard

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.