1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Solving B-spline Need Help

  1. Oct 27, 2014 #1
    • Moved from a technical math section
    Hi all,

    The control points are five and they are:

    b0 = (0,0)
    b1 = (1,3)
    b2 = (3,0)
    b3 = (4,3)
    b4 = (6,0)

    The degree d is 2.

    The number of knots t are 8 and they are:

    t0 = 0
    t1 = 1
    t2 = 2
    t3 = 3
    t4 = 4
    t5 = 5
    t6 = 6
    t7 = 7

    What is the next step to solve this b-spline?

    Thank you
     
  2. jcsd
  3. Oct 27, 2014 #2

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    It's not clear what you mean when you say, "What is the next step to solve this b-spline?"
     
  4. Oct 28, 2014 #3
    You should see the theory to understand what I'm asking about:

    B_spline.png
     
  5. Oct 28, 2014 #4

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    Looks to me like that's a lot of algebra to crank thru.
     
  6. Oct 28, 2014 #5

    RUber

    User Avatar
    Homework Helper

    Step 1: define your ##N_{i,0}## basis functions.
    Step 2: define your ##N_{i,1}## basis functions in terms of your ##N_{i,0}## basis functions.
    Step 3: define your ##N_{i,2}## basis functions in terms of your ##N_{i,1}## basis functions.
    Step 4: sum them up to make your ##\mathbf{B}## spline.
    If you are comfortable with linear algebra, this looks like something a computer would do a lot faster.
     
  7. Oct 29, 2014 #6
    What I suppose to do with the below equation (the example 8.3)?

    ##N_{0,1}(t) = \frac{t-t_{0}}{t_{1}-t_{0}}N_{0,0}(t)+\frac{t_{2}-t}{t_{2}-t_{1}}N_{1,0}(t)##
    ##= \frac{t-2}{4-2}N_{0,0}(t)+\frac{5-t}{5-4}N_{1,0}(t)##
    ##= \frac{t-2}{2}N_{0,0}(t)+\frac{5-t}{1}N_{1,0}(t)##
    ##= \frac{t-2}{2}N_{0,0}(t)+(5-t)N_{1,0}(t)##

    I can't multiply them because of the ##N_{0,0}(t)## and ##N_{1,0}(t)##.

    What is the value of the ##N_{0,0}(t)## and ##N_{1,0}(t)##?

    For example, if the value of the ##N_{0,0}(t)## and ##N_{1,0}(t)## is 3 and 4 respectively, then the equation will be:

    ##\frac{t-2}{2}N_{0,0}(t)+(5-t)N_{1,0}(t)##
    ##= (\frac{t-2}{2})3+(5-t)4##
    ##= \frac{3t-6}{2}+(20-4t)##

    btw, honestly, this is not a homework.
     
  8. Oct 29, 2014 #7

    RUber

    User Avatar
    Homework Helper

    First, define all your ##N_{i,0}## functions. Notice that these are only non-zero over the single unit ##[t_i,t_{i+1}]## and on that unit they are 1.
    Then, define your ##N_{i,1}## functions.
    For example, ##N_{0,1} =\frac{t-0}{1-0}N_{0,0}+\frac{2-t}{2-1}N_{1,0}=t \text{ on }[0,1), = 2-t \text{ on }[1,2)##.
    Notice that these are continuous linear functions interpolating your points.
    Also, ##N_{1,1} =\frac{t-1}{2-1}N_{1,0}+\frac{3-t}{3-2}N_{2,0}=t-1 \text{ on }[1,2), = 3-t \text{ on }[2,3)##.
    Moving on the the ##N_{i,2} ## quadratic basis functions, you have:
    ##N_{0,2} =\frac{t-0}{2-0}N_{0,1}+\frac{3-t}{3-1}N_{1,1}=\frac{t^2}{2} \text{ on }[0,1), = \frac{2t-t^2}{2}+\frac{(3-t)^2}{2} \text{ on }[1,2)##.
    If you are doing this with a computer, it should be much faster than doing it by hand.
    Just pay attention to where the functions are non-zero and sum the pieces appropriately.
     
  9. Nov 11, 2014 #8
    Why ##\frac{1}{6}(7-t)^2(1,2)+\frac{1}{3}(-t^2+12t-34)(3,5)+\frac{1}{6}(t-5)^2(6,2)## on ##5≤t<7##?

    Why not

    ##5<t≤7##

    or

    ##5≤t≤7##

    or

    ##2≤t≤4##

    or

    ##?≤t≤?##

    and so on?

    spl.png
     
  10. Nov 11, 2014 #9

    RUber

    User Avatar
    Homework Helper

    All the functions should be equal at the nodes, so it is just a matter of only defining each point once. Though for implementation it doesn't impact the method.
     
  11. Nov 12, 2014 #10
    I am sorry but I still do not understand. Please use a basic english which is easy to understand as english is not my native language.

    Why chose 5 <= t < 7 and 7 <= t < 8 (see the image below) for the final step?

    proxy.php?image=http%3A%2F%2Fs29.postimg.org%2Fikdekeok7%2Fspl.png
     
  12. Nov 12, 2014 #11

    RUber

    User Avatar
    Homework Helper

    It does not matter. Both should be equal at t=7.
     
  13. Nov 13, 2014 #12
    What is does not matter?

    Why?
     
  14. Nov 13, 2014 #13

    RUber

    User Avatar
    Homework Helper

    Does not matter means the result will be te same either way.
    A spline is designed to be a continuous function. If they were different at t=7, it would not be continuous.
    In any case, if you find it easier to define the point by the right function rather than the left, there should be no problems.
     
  15. Jan 2, 2015 #14
    Why the final answer is 5 <= t < 7 and 7 <= t <= 8?
     
  16. Jan 4, 2015 #15

    RUber

    User Avatar
    Homework Helper

    Reading definition 8.2 in the material posted above, it says that the final answer will be defined from ##t_d## to ##t_{n-d}##.
    Since in this example (8.3), d=2, your interval for the spline will be from ##t_2## to ##t_{6-2}##, which covers the points 5, 7, and 8.
    Was this the heart of your misunderstanding?
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Solving B-spline Need Help
Loading...