필터 지우기
필터 지우기

Matlab code for Euler's method

조회 수: 4 (최근 30일)
Sam
Sam 2014년 3월 7일
댓글: Sam 2014년 3월 7일
This is my first time using matlab and I need to know matlab code for this IVP where
y' = 3y, y(1) = 2, 1=<t=<2, h = 0.5. Solve the system with Euler's method.

답변 (1개)

James Tursa
James Tursa 2014년 3월 7일
편집: James Tursa 2014년 3월 7일
Look at this link:
Look at the "Formulation of the method" and "Example" sections.
Simply replacing their example with your specific derivatives, you should be able to program this up in just a few lines of code.
  댓글 수: 3
James Tursa
James Tursa 2014년 3월 7일
Here is the example copied directly from the link:
h = 1
y' = y
y(0) = 1
y(n+1) = y(n) + h * y'(n)
Are you saying you can't code that up in MATLAB with appropriate substitutions for your particular equation, range, starting point, and stepsize?
Sam
Sam 2014년 3월 7일
Yes. Since I am new to matlab, I don't exactly know the codes to solve an IVP. But, I do know euler's method and such.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by