Solve Ordinary Differential Equations in Matlab

แชร์
ฝัง
  • เผยแพร่เมื่อ 31 ธ.ค. 2024

ความคิดเห็น • 66

  • @mausamverma
    @mausamverma 14 ปีที่แล้ว +1

    Dr. Blanchard,
    Your tutorials are very clear and ideal for beginners but at the same time crucial for advanced users. Please keep posting more of these as this is very noble way of spreading knowledge in addition to your university stage.
    God bless you.
    Thanks a lot

  • @hockeyavalanche73
    @hockeyavalanche73 11 ปีที่แล้ว

    Thanks! My professor did a very poor job at explaining ODE's, spent 2 weeks and learned nothing. I spent 7 minutes watching this, took some notes and I have a much better understanding of them. I can even makes some sense of my professor's slides.

  • @patrickwalsh5153
    @patrickwalsh5153 9 ปีที่แล้ว +2

    Thank you. That was very helpful. Also, as a former paratrooper studying physics, I like your example.

  • @Quancept
    @Quancept 6 ปีที่แล้ว

    Clean and clear tutorial. I am new to Matlab and this was so easy to follow. Thank you so much!

  • @書小
    @書小 12 ปีที่แล้ว

    the latter method worked. I just add "rk = ....." after ode45, and plot t & rk. Thank you for your help!

  • @jakeblanchard
    @jakeblanchard  12 ปีที่แล้ว +1

    I think something like this would work. After you run ode45, you could try
    plot(t,rk(t,y))
    I haven't tried this. It may fail because the rk routine was not written expecting vectors for t and y. More likely you would have to write a new version of rk to accommodate this. Or you could write a loop and calculate the acceleration one at a time for each pair of values for t and y.

  • @jakeblanchard
    @jakeblanchard  12 ปีที่แล้ว

    The mass can be any arbitrary function of t and y. That is one of the beauties of the numerical approaches. It is very easy to put in arbitrary functions for the parameters.

  • @johndouglas132
    @johndouglas132 10 ปีที่แล้ว

    Many thanks for putting this video up. Very clear.

  • @aravkharkwal
    @aravkharkwal 10 ปีที่แล้ว

    Thank you. Helped me a lot before an exam.

  • @WilliamJPintoTriana
    @WilliamJPintoTriana 14 ปีที่แล้ว

    jakeblanchard
    If you use Firefox, you need to install the following complement: DownloadHelper (there are other options) and when you're watching the video, appears on the screen, an icon at the bottom of the addon where you can download the video at the size you want.
    Or you can use aTubeCatcher too.

  • @WilliamJPintoTriana
    @WilliamJPintoTriana 14 ปีที่แล้ว

    @jakeblanchard
    If you use Firefox, you need to install the following complement: DownloadHelper (there are other options) and when you're watching the video, appears on the screen, an icon at the bottom of the addon where you can download the video at the size you want.
    Or you can use aTubeCatcher too.

  • @A-003
    @A-003 15 ปีที่แล้ว

    Thank you VERY MUCH sir for your help, it totaly helped me. God bless you

  • @evropanzeu
    @evropanzeu 12 ปีที่แล้ว

    Dear Jake,
    I ve been struggling with ode15i. It seems to me it is actually the most general way of solution offered by matlab. I want to create arbitrary nonlinear ODE and to have the solution plotted (I just want to play..). In help, there is only some weissinger function.
    Could you ever, when you have time, make a video with ode15i for a nonlinear ODE (SOMETHING LIKE (Dy)^2-y*t+sin(y)=0 ) and with plotted solution? I think not only me would appreciate such video for sure! :-)

  • @ReturnOfTheMack7
    @ReturnOfTheMack7 13 ปีที่แล้ว

    @jakeblanchard a number does not have units... no one should assume you have 'hidden' the correct units behind the fraction. you should leave it as a variable and explain the number and units [kg/m] as you do with m and g.

  • @chopper1lady
    @chopper1lady 11 ปีที่แล้ว

    Hi,
    Thank you for the video, it is very helpful :) I have only one question: there is an online and free source for problems to be done in matlab?

  • @shikha527
    @shikha527 12 ปีที่แล้ว

    Dear Jake,
    I ve been struggling with ode15s. It seems to me it is actually the most general way of solution offered by matlab. will u tell me how to make a . m file for this.

  • @TheCapoarte
    @TheCapoarte 11 ปีที่แล้ว

    Awesome job, thanks for posting.

  • @RaeRae17
    @RaeRae17 16 ปีที่แล้ว

    This is pretty cool, thank you!

  • @uoweme5grand
    @uoweme5grand 13 ปีที่แล้ว

    let`s say the function has consists of time being squared. so the dy/dt function has a t in it. would ode 45 still work?

  • @書小
    @書小 12 ปีที่แล้ว

    Hi. you said that "rk" is what "f" returns. I' wondering if there is a way to plot the acceleration ? plot rk agianst time? how do you get rk out of f.m and plot it?

  • @sdmurciam
    @sdmurciam 12 ปีที่แล้ว

    thanks, it really helps, but i need solve the same problem with variable mass, how i do that?

  • @ReturnOfTheMack7
    @ReturnOfTheMack7 13 ปีที่แล้ว +1

    the units aren't right... it's one thing to say it won't model reality and another to write an equation that doesn't make sense mathematically either.

  • @do7awi
    @do7awi 16 ปีที่แล้ว

    very useful :) thank you so much.

  • @jillukevin
    @jillukevin 13 ปีที่แล้ว

    sir even if iam using the exact equation and coding as shown in this video it says input argument ' y ' is undefined . im new to this can u help me sir

  • @sonnyskaa
    @sonnyskaa 10 ปีที่แล้ว

    Thanks for all your uploads. I am trying to solve an ODE where I want to run it backwards, hence I have the value of the function and its derivative at t-final. How would I use ode45 when I want to run it backwards??

    • @sonnyskaa
      @sonnyskaa 10 ปีที่แล้ว

      I tried the following way
      initialcondition = [y0,y0deriv];
      xspan = xhigh:-2:xlow;
      [x,y] = ode45(@odefunc,xspan,initialcondition);

    • @jakeblanchard
      @jakeblanchard  10 ปีที่แล้ว

      The safest thing to do is to make a substitution like tau=-t and then you can do a forward solution in tau.

    • @sonnyskaa
      @sonnyskaa 10 ปีที่แล้ว

      so the code would be
      initialcondition = [y0,y0deriv];
      xspan = xlow:xhigh
      xspanminus=-xspan
      [x,y] = ode45(@odefunc,xspanminus,initialcondition);???

    • @jakeblanchard
      @jakeblanchard  10 ปีที่แล้ว

      Sonny Skaaning
      No. You have to make that substitution in your original differential equation. Then tau starts at 0 and moves forward. From there everything is like a typical ODE.

    • @sonnyskaa
      @sonnyskaa 10 ปีที่แล้ว

      Thanks for all your help
      This is then how my odefunc look like
      function dydt = odefunc(t,y)
      y = [y(1);y(2)];
      A = [0 1; 2 1/y(1)]
      end
      Then my code for running the ode45 is
      yend=-3
      yendderivative = 0
      tspan =[0,100]
      initialcondition = [yend,yendderivative]; %IC
      [t,y] = ode45(@odefunc,xspan,initialcondition);
      plot(t,y(:,1));
      So where should I do that change of variables from tau=-t??? I have conditions at t=100 and not t=0 thus I want to run it backwards.
      Thanks a lot for the help.

  • @tomtomtramp
    @tomtomtramp 13 ปีที่แล้ว

    Thanks for the vids! But I'm writing the wrong code. I am developing a system to analysis the rocking motion of a block subjected to an earthquake excitation. The state vector is y(t)={theta(t) , theta'(t)}. and the Time-derivative vector f(t) is y'(t)= {theta'(t) , p^2(sin(alpha*sgn[theta(t)]-theta(t))+u''/g*cos(alpha*sgn[theta(t)]-theta(t))]}. I have the values for p, alpha, u'' and g. But I need theta(t), and theta'(t). theta(t) is the rotation angle to time, t. Please help, I need it!

  • @JoeJoeJoeCheung
    @JoeJoeJoeCheung 13 ปีที่แล้ว

    life saver!!!!!

  • @MIssssLate
    @MIssssLate 15 ปีที่แล้ว

    Thank you very much!!!

  • @azharshah316
    @azharshah316 16 ปีที่แล้ว

    good explanation. Thanks

  • @LTF85199
    @LTF85199 16 ปีที่แล้ว

    Thank you ,thank you, thank you

  • @drabhisekkumarsingh937
    @drabhisekkumarsingh937 12 ปีที่แล้ว

    please sir tell me , how to solve first order differntial equation with the help of ode45

  • @darcytakhar
    @darcytakhar 11 ปีที่แล้ว

    I love u man!

  • @lyzzts
    @lyzzts 9 ปีที่แล้ว

    goes to uw madison. has to watch a youtube video to understand this. finds out it's by a uw madison professor. lol

  • @pratik9056
    @pratik9056 9 ปีที่แล้ว

    I have on ODE with two functions f, g which are both functions of x. I also have the initial condition for these functions. How do I go about solving it on Matlab?

    • @jakeblanchard
      @jakeblanchard  9 ปีที่แล้ว

      +Pratik Rao
      Do you mean that you have two first order equations, like df/dt=... and dg/dt=...
      If so, this is very similar to solving a single second order ODE, so you might take a look at this:
      th-cam.com/video/fx3bl4oA_0U/w-d-xo.html

    • @icybreakers19
      @icybreakers19 9 ปีที่แล้ว

      +Jake Blanchard Yes. I realised that my Ode had no analytical solution and hence I had to solve it numerically using ode45. I have m'(x) on my LHS and on the RHS, I have m terms as well as another function dia(x) and it's derivative. However, there is (m^2 - 1) term in the denominator and want the code to stop computations starting from m = 1 as that would be a singularity. The other challenge is to plot the solution of the ode upto m = 1. So I used a for statement:
      for m = 1: Inf (%1 to any other number larger than it )
      However, this isn't working and it's carrying on computations at and beyond the singularity.

    • @jakeblanchard
      @jakeblanchard  9 ปีที่แล้ว

      +No
      Write out all the equations and send them to blanchard@engr.wisc.edu and I can take a look at them.

  • @MIssssLate
    @MIssssLate 15 ปีที่แล้ว

    Sorry, can anyone plz tell, me do I have to put END in the end??? Thank u!!!!!!!!!!!

  • @tkguha6918
    @tkguha6918 11 ปีที่แล้ว

    nice video, thanks

  • @MIssssLate
    @MIssssLate 15 ปีที่แล้ว

    I am very sorry, when I do this I get this error, ??? Undefined function or variable 'V'.
    Error in ==> d at 4
    rk=-g+((4/15)*(V^2)/mass);
    what shall I do, and what is the problem, if anyone could help.... pleaseeeee... ))))

  • @human-fq7wu
    @human-fq7wu 8 ปีที่แล้ว

    Thanks dude.

  • @GeniusNation
    @GeniusNation 6 ปีที่แล้ว +1

    Morgan Freeman !

  • @kechitikhaoula2269
    @kechitikhaoula2269 9 ปีที่แล้ว

    merci bcp
    svp comment peux modéliser les modèles épidémiologies sirs avec matlab

    • @jakeblanchard
      @jakeblanchard  9 ปีที่แล้ว

      Kechiti Khaoula
      Sorry, I don't speak French and the Google translation was difficult to follow.

    • @kechitikhaoula2269
      @kechitikhaoula2269 9 ปีที่แล้ว

      sorry,
      please how can I model the epidemiologies models (s-i-r-s with matlab)

    • @jakeblanchard
      @jakeblanchard  9 ปีที่แล้ว

      Kechiti Khaoula
      You'll have to tell me more about those models. I don't know anything about them.

  • @akalanka1234
    @akalanka1234 10 ปีที่แล้ว

    Thanks....!

  • @mekele7
    @mekele7 15 ปีที่แล้ว

    nice

  • @nitinbadare
    @nitinbadare 14 ปีที่แล้ว

    its a good v deo

  • @jakeblanchard
    @jakeblanchard  12 ปีที่แล้ว

    I can try to help. Send me what you have so far and I can look at it.

  • @nourali5870
    @nourali5870 10 ปีที่แล้ว

    execuse me sir ... please how to fix this
    Error using ==> load
    Unable to read file templates: No such file or directory.

    • @jakeblanchard
      @jakeblanchard  10 ปีที่แล้ว

      It's hard to say. I would have to see your script. Are you using global variables? That may be the root of the problem.

  • @MIssssLate
    @MIssssLate 15 ปีที่แล้ว

    aaaa... ok... thank you very much!!! I get this now.. I am stupid.. sorry!!!

  • @jakeblanchard
    @jakeblanchard  12 ปีที่แล้ว

    I've never used ode15i. Sorry.
    jake

  • @jeffcampbell33
    @jeffcampbell33 11 ปีที่แล้ว +3

    "y" instead of "v" again? Really?

  • @ScaricoOleoso
    @ScaricoOleoso 11 ปีที่แล้ว

    Anyone else think this guy sounds like Al Franken?