Added: 3 years ago
From: jakeblanchard
Views: 18,765
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:
see all

All Comments (28)

Sign In or Sign Up now to post a comment!
  • Hi Mr.Jakeblanchard,

    I have a query to ask in matlab which i hope you can help with. I have some 50 images which i want to stack along the Z direction at a fixed interval between the images/slices i.e. images are parallel to X-Y plane. After stacking I want to develop a 3D image by using some kind of interpolation between the slices. Is this possible to do in matlab??. If possible can you shed some light on what lines should I proceed??

    Thankyou for your time!!!

  • @MsChano87

    I have no idea if this is possible. Sorry.

  • Thanks for the very useful video. I can't understand how can I find the guess of my bvp.. could you help me? and how did you choose yours?

  • @fgiuglia

    I try not to solve a problem numerically until I have a pretty good idea what the answer should look like. The best approach is to work out some kind of approximate analytical solution. Then this can be used as an initial guess for the numerical solution.

  • @jakeblanchard

    Thank you very much. Sorry if I am not smart, but what is the link with the constants in the initial guess and your solution?

    

  • @fgiuglia

    I knew the analytical solution for my problem, so it was pretty easy to formulate a rough guess. Also, this is a linear equation so the guess is relatively unimportant. Guesses are much more important for nonlinear equations.

    I'll repeat, if you are going to solve a problem numerically, you should already know what the solution looks like. Use approximations to allow for analytical solutions of a simplified problem. Then you can use this approximation for the guess.

  • @jakeblanchard

    One more suggestion. The first time you use a tool like bvp4c, test it on a problem for which you know the exact solution. Then you can be sure you're using the tool correctly. Then you can move on to solve harder problems for which you don't have an analytical solution.

  • @jakeblanchard thank you, I will try to manage it!

  • Thanks for the very useful video. I can't understand how can I find the guess of my bvp.. could you help me?

  • I got an error saying:

    ??? Error using ==> bvp4c

    Unable to solve the collocation equations -- a singular Jacobian encountered.

    how do i solve this?

  • @uoweme5grand

    It could be you need a better initial guess. It also might be a problem with the equations themselves. I'd have to see the code to be sure. You can send me the code if you want me to look at it. Send to blanchard "at" engr.wisc.edu

  • I typed your exact script in and it didn't work. says there is an error, "Error in ==> bvp5 at 4 sol=bvp4c(@bvp5ode,@bvp5bc,sol­init); " and "??? Error using ==> times Matrix dimensions must agree"

    I'm guessing I have to rename a file or something syntax like. Does anyone know whats going on here?

  • @hellsangelsdeath

    You can download some working files from

    blanchard "dot" ep "dot" wisc "dot" edu/PublicMatlab/#BVP

  • Just curious, how does changing the initial mesh to having just 5 points affect your final answer?

  • @brynntheoose

    As you reduce the size of the initial mesh you will increase the error.

  • This was extremely helpful, especially the section on defining the boundary conditions as a vector, thank you!

  • Thanks for the video. Could you tell me how can I find the initial conditions like y(0)=0 and y'(pi/2)=1 for example for a given ODE or system of ODEs? I have read that we can do so by using Jacobian matrix ,but I don't know what to look for exactly. The initial conditions should be prescribed such that the ODE becomes stable i.e the real parts of the eigenvalues be negative.

  • @supernova1387

    No, I've never seen what you describe. I've only done problems where the boundary conditions are prescribed.

  • Great Video!!! Thank you so much.

    Your explanation is very clear.

    Could you give me a suggestion, please.

    If my boundary condition is in form y'... for example ... y'(0) = 0 and y'(10) = 0.

    How I can solve it in MATLAB?

    I try to guess initial point of y(0), but it seems wrong,

    Thank you in advance ;)

  • @jejeejajar

    You don't have to guess y(0), though there are algorithms that work that way. You can directly prescribe the derivative at either boundary. This is described in the video above. Go to about the 7:37 mark and watch until the end. That should help. Drop me a note if you still have questions.

  • @jakeblanchard

    Thank you so much for your response.

    I'll try to solve it.

    I doubt why I missed your video, it's wonderful ;)

  • thx man :)

  • THANK YOU SO MUCH. It was very wonderfully explained. Felt so easy about BVPs. Hats off :)

  • hi, this is a really excellent video ya put up, very well explained!! im using matlab to solve a 2nd order BVP at the mo, however my system of first order ode's have non constant coefficients dependant on my independant variable u. is it just a matter of defining the coeffs and multiplying them by my y(1) and y(2) in my ode file before i execute the script? i seem to be getting errors relating back to my ode file. my bc's consist of y and y' at one given point. any insight wud be great, thanks

  • bvp4c will handle nonlinear equations. If you search the web for "MATLAB Central Tutorial BVP4C" you will find a zip file put together by Kierzenka. The pdf in that zip file describes a solution for a nonlinear equation.

  • Hi jake, thanks alot for your prompt response. my equation is actually linear in y, its just the coefficients of y, y' and y" are dependant on my independant variable u. i've since looked at, and printed off (paper is so much easier on the eyes) that tutorial by Kierzenka, thanks alot for suggesting it. they do quite a few examples that mirror my own problem to an extent.. i imagine i'll have the code working pretty soon. thanks again!!

  • hi, many thanks for this video and relevant others. it makes my life much easier. really appreciate it.

  • Very nice explanations on solving boundary value problems! THANKS FOR THAT!

    But when trying to compile the code in Matlab (R2008a) I realized that there are semicolons (;) missing for the vectors dydx and res in the functions describing the differential equation and the boundary conditions, respectively. Matlab needs vertical vectors to handle the ODE. Or am I wrong? At least it worked out fine when adding the semicolons.

  • Good point. You are correct. There is a typo in the scripts shown in this video. Specifically, the boundary condition function should be written as

    function res=bvp4bc(ya,yb)

    res=[ya(1)-1; yb(1)];

Loading...
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more