Solve a second order differential equation
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
hi.i want to solve this second order differential equation in matlab an plot figure. can you help me please?
d2a/de2=(((((2+c2)./(1+c2)).*(Fu.^2))+1)*(a.^c2)-((2+c2)./(1+c2)).*(Fu.^2./a)-a.^(2+(2.*c2)))./( ((2+c2)/((3+c2).*(1+c2))).*Fu.^2 );
Fu=1
c2=0,0.5,1
채택된 답변
Ameer Hamza
2020년 11월 4일
This is a second-order ODE which can be solved using ode45(). See the example titled "Solve Nonstiff Equation" here: https://www.mathworks.com/help/matlab/ref/ode45.html#bu3uj8b
댓글 수: 10
Mj
2020년 11월 4일
thanks alot. i am beginner in matlab.is it possible for you to send me the code?
Can you write your equation in MATLAB form? Then It will be easier for me to write a solution.
Mj
2020년 11월 4일
yes. the equation is :
x=(((((2+c2)./(1+c2)).*(Fu.^2))+1)*(a.^c2)-((2+c2)./(1+c2)).*(Fu.^2./a)-a.^(2+(2.*c2)))./( ((2+c2)/((3+c2).*(1+c2))).*Fu.^2 )
x=d2a/de2
Fu=1
c2=0,0.5,1
What are the initial conditions? Following code shows an example
Fu=1;
c2=0;
dAdt = @(t, A) [A(2);
(((2+c2)./(1+c2).*Fu.^2+1)*A(1).^c2-(2+c2)./(1+c2).*Fu.^2./A(1)-A(1).^(2+2.*c2)) ./( (2+c2)/((3+c2).*(1+c2)).*Fu.^2 )];
tspan = [-2 0];
IC = [1; -0.1];
[t, A] = ode45(dAdt, tspan, IC);
plot(t, A(:,1), '-o');
legend({'$\alpha$'}, 'Interpreter', 'latex', ...
'FontSize', 16, 'Location', 'best')
Mj
2020년 11월 4일
does it need initial condition? what initial condition did you use in this code?
This is the line for initial condition
IC = [1; -0.1];
First is the value for alpha and second is for d_alpha. Initial condition is applied at left side of interval in tspan.
is it possible to solve this by fourth order Rung-kutta method?
ode45() also use RK-(4,5) algorithm as desribed here: https://www.mathworks.com/help/matlab/ref/ode45.html#bu0200e-1
Mj
2020년 11월 4일
i put my initial condition instead of yours, but it did not give me the righ figure.
IC = [0.75; 0];
The alpha value as the initial condition is 0.75. But I do not have d-Alpha in the same place. Elsewhere, d-alpha value is zero.
do you know what should i do?
excuse me because of my boring questions.
This is the solution according to the equation you shared. Check if there is a mistake in writing the equation.
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
