필터 지우기
필터 지우기

, I need help! I do not get to have the graph of the solution of a differential equation.

조회 수: 2 (최근 30일)
  • I have a differential equation of the first order. It describes the basic velocity profile of fluid flowing over an inclined plane.
  • I used the Euler method with Matlab to solve the equation.
  • My goal is to plot the graph of the solution of this equation. I want to have the velocity U on axis (ox) on the interval [0,18], in fonction of the height of the flow channel y, on axis (oy) in the interval [0,200] .
  • No errors in the program are displayed, but the result I get is different from that of the article on which I work. The velocity profile should be parabolic while I get a straight line!
  • I Attach the program that I do, the graph that I get and the graph that I must have.Could you please help me understand and solve the problem? I will be very grateful.

채택된 답변

Roger Stafford
Roger Stafford 2015년 1월 2일
I am guessing that you left out the parentheses in the denominator of F, which would presumably be this instead:
F=@(x,s)(2-(x./100))./(1+sqrt(1+0.003*x.^2.*(1-exp(-x./25)).^2.*(200-x)./50));
^ ^
The values for U I get with this alteration do not agree with those in your 'profile vitesse.pdf' plot but the shape appears to be similar to that plot.
Also I find it curious that F, as you have defined it, does not depend on the second argument 's', so you are simply finding U(x) = the integral of F(t) from t = 0 to x where F does not depend on U. In other words, it is not really a differential equation but merely an integral which could have been solved using 'cumtrapz'.
  댓글 수: 8
Roger Stafford
Roger Stafford 2015년 1월 5일
Not quite identical. There is the discrepancy between U being 16.2473 with matlab and somewhere near 15.3 for the article for x = 200.
Nadjah
Nadjah 2015년 1월 6일
Hello; The graph '' profile vitesse.pdf '' is the one I got with Maple and that I found (before to solve the problem with Matlab)) close to that of the article (herewith the graph of the article). Whilst if we correct the term in denominator: F=@(x,s)(2-(x./100))./(1+sqrt(1+0.003*x.^2.*(1-exp(-x./25)).^2.* (200-x)./50) ) which becomes: F=@(x,s)(2-(x./100))./(1+sqrt(1+0.003*x.^2.*(1-exp(-x./25)).^2.*(200-x))) you will notice that the result of Matlab is much better! Thank you.

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

추가 답변 (1개)

Andres Bayona
Andres Bayona 2019년 4월 25일
Hi, I was wondering if it were possible that you shared the code with me. I would really appreciate it!

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by