, 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