Loading [MathJax]/jax/output/HTML-CSS/jax.js
Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Mathematics LibreTexts

Search

  • Filter Results
  • Location
  • Classification
    • Article type
    • Stage
    • Author
    • Embed Hypothes.is?
    • Cover Page
    • License
    • Show Page TOC
    • Transcluded
    • PrintOptions
    • OER program or Publisher
    • Autonumber Section Headings
    • License Version
    • Print CSS
    • Screen CSS
  • Include attachments
Searching in
About 123 results
  • https://math.libretexts.org/Bookshelves/Scientific_Computing_Simulations_and_Modeling/Physical_Modeling_in_MATLAB_(Downey)/04%3A_Vectors/4.04%3A_Indexing_Errors
    An index can be any kind of expression, but the value of the expression has to be a positive integer, and it has to be less than or equal to the length of the vector. >> Y(0) Array indices must be pos...An index can be any kind of expression, but the value of the expression has to be a positive integer, and it has to be less than or equal to the length of the vector. >> Y(0) Array indices must be positive integers or logical values. If it’s not an integer, you get an error: >> Y(1.5) Array indices must be positive integers or logical values. If the index is too big, you also get an error: The error messages use the word array rather than matrix, but they mean the same thing, at least for now.
  • https://math.libretexts.org/Bookshelves/Scientific_Computing_Simulations_and_Modeling/Physical_Modeling_in_MATLAB_(Downey)/02%3A_Scripts/2.09%3A_Exercises
    You observe that every day 5 percent of the bikes in Boston are dropped off in Cambridge, and 3 percent of the bikes in Cambridge get dropped off in Boston. The precondition is that the variables b an...You observe that every day 5 percent of the bikes in Boston are dropped off in Cambridge, and 3 percent of the bikes in Cambridge get dropped off in Boston. The precondition is that the variables b and c contain the number of bikes in each location at the beginning of the day. In the next chapter, we will see how to execute your script automatically and how to plot the values of b and c over time.
  • https://math.libretexts.org/Bookshelves/Scientific_Computing_Simulations_and_Modeling/Physical_Modeling_in_MATLAB_(Downey)/13%3A_Optimization/13.01%3A_Optimal_Baseball
    Now we’ll use that code to find the launch angle that maximizes range, that is, the distance the ball travels before landing. This is similar to the event function we saw in Chapter 11.3, except that ...Now we’ll use that code to find the launch angle that maximizes range, that is, the distance the ball travels before landing. This is similar to the event function we saw in Chapter 11.3, except that it uses W(2) as the event value, which is the y-coordinate. The ball’s initial velocity is 40 m/s in the x-direction and 30 m/s in the y-direction. The maximum duration of the simulation is 10 s, but we expect an event to stop the simulation first.
  • https://math.libretexts.org/Bookshelves/Scientific_Computing_Simulations_and_Modeling/Physical_Modeling_in_MATLAB_(Downey)/05%3A_Functions/5.05%3A_Multiple_Input_Variables
    The arguments you provide are assigned to the input variables in order, so in this case 3 is assigned to a and 4 is assigned to b. This error message might be confusing, because it suggests that the p...The arguments you provide are assigned to the input variables in order, so in this case 3 is assigned to a and 4 is assigned to b. This error message might be confusing, because it suggests that the problem is in sum_squares rather than in the function call. That’s a better error message, because it’s clear that the problem isn’t in the function, it’s in the way we’re using the function.
  • https://math.libretexts.org/Bookshelves/Scientific_Computing_Simulations_and_Modeling/Physical_Modeling_in_MATLAB_(Downey)/01%3A_Modeling_and_Simulation/1.06%3A_Chapter_Review
    An expression is a sequence of operands and operators that specifies a mathematical computation and yields a value. A function is a named computation; for example, log10 is the name of a function that...An expression is a sequence of operands and operators that specifies a mathematical computation and yields a value. A function is a named computation; for example, log10 is the name of a function that computes logarithms in base 10. A function call is a command that causes a function to execute and compute a result. Finally, a string is a value that consists of a sequence of characters (as opposed to a number).
  • https://math.libretexts.org/Bookshelves/Scientific_Computing_Simulations_and_Modeling/Physical_Modeling_in_MATLAB_(Downey)/14%3A_Springs_and_Things/14.04%3A_Celestial_Mechanics
    To keep things simple, we’ll consider only the effect of the Sun on the Earth and ignore the effect of the Earth on the Sun. Fg=Gm1m2r2ˆPwh...To keep things simple, we’ll consider only the effect of the Sun on the Earth and ignore the effect of the Earth on the Sun. Fg=Gm1m2r2ˆPwhere G is the universal gravitational constant (see https://greenteapress.com/matlab/gravity), r is the distance of the Earth from the Sun, and ˆP is a unit vector in the direction of P.
  • https://math.libretexts.org/Bookshelves/Scientific_Computing_Simulations_and_Modeling/Physical_Modeling_in_MATLAB_(Downey)/03%3A_Loops/3.10%3A_Chapter_Review
    A loop variable is a variable that gets assigned a different value each time through the loop. An accumulator is a variable that is used to accumulate a result a little bit at a time. The numbers that...A loop variable is a variable that gets assigned a different value each time through the loop. An accumulator is a variable that is used to accumulate a result a little bit at a time. The numbers that make up the sequence are called . A series is the sum of a sequence of elements. Generalization is a way to make a program more versatile, for example, by replacing a specific value with a variable that can have any value.
  • https://math.libretexts.org/Bookshelves/Scientific_Computing_Simulations_and_Modeling/Physical_Modeling_in_MATLAB_(Downey)/02%3A_Scripts/2.03%3A_The_Fibonacci_Sequence
    The Fibonacci sequence, denoted F, is a sequence of numbers where each number is the sum of the previous two. The following expression computes the nth Fibonacci number: \[F_n = \frac{1}{\sqrt...The Fibonacci sequence, denoted F, is a sequence of numbers where each number is the sum of the previous two. The following expression computes the nth Fibonacci number: Fn=15[(1+52)n(152)n] In this example, the message says the error is in fibonacci, but the actual problem is that we have not assigned a value to n.
  • https://math.libretexts.org/Bookshelves/Scientific_Computing_Simulations_and_Modeling/Physical_Modeling_in_MATLAB_(Downey)/09%3A_Ordinary_Differential_Equations/9.06%3A_Time_Dependence
    Suppose that the growth rate for rats depends on the current population and the availability of food, which varies over the course of the year. The index here is end, which is a special word in MATLAB...Suppose that the growth rate for rats depends on the current population and the availability of food, which varies over the course of the year. The index here is end, which is a special word in MATLAB that means “the index of the last element.” You can use it in an expression, so Y(end - 1) is the second-to-last element of Y.
  • https://math.libretexts.org/Bookshelves/Scientific_Computing_Simulations_and_Modeling/Physical_Modeling_in_MATLAB_(Downey)/11%3A_Second-order_systems/11.05%3A_Chapter_Review
    In this chapter, we used Newton’s laws of motion to write a differential equation that describes the motion of a falling penny. We defined an event as something of interest that happens during a simul...In this chapter, we used Newton’s laws of motion to write a differential equation that describes the motion of a falling penny. We defined an event as something of interest that happens during a simulation, like a collision between moving objects, and we wrote an event function, which allows ode45 to figure out when an event occurs. In the next chapter, we extend Newtonian motion to two dimensions and model the flight of a baseball.
  • https://math.libretexts.org/Bookshelves/Scientific_Computing_Simulations_and_Modeling/Physical_Modeling_in_MATLAB_(Downey)/06%3A_Conditionals/6.08%3A_Adding_a_continue_Statement
    If gcd(a,b) is greater than 1, a and b share a common factor and we can use the continue statement to skip to the next pair. The continue statement causes the program to end the current iteration imme...If gcd(a,b) is greater than 1, a and b share a common factor and we can use the continue statement to skip to the next pair. The continue statement causes the program to end the current iteration immediately, jump to the top of the loop, and “continue” with the next iteration. In this case, since there are three loops, it might not be obvious which loop to jump to, but the rule is to jump to the innermost loop (which is what we want).

Support Center

How can we help?