1 / 33

Modeling and Simulations 1

Modeling and Simulations 1. Why Modeling?. Fundamental and quantitative way to understand and analyze complex systems and phenomena. Complement to Theory and Experiments, and often integrate them. Becoming widespread in: Computational Physics, Chemistry, Mechanics, Materials, Biology,etc.

Download Presentation

Modeling and Simulations 1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Modeling and Simulations 1

  2. Why Modeling? • Fundamental and quantitative way to understand and analyze complex systems and phenomena. • Complement to Theory and Experiments, and often integrate them. • Becoming widespread in: Computational Physics, Chemistry, Mechanics, Materials, Biology,etc.

  3. Experiment Theory Computation Mathematical Modeling? Mathematical modeling seeks to gain an understanding of science through the use of mathematical models on computers.

  4. Mathematical Modeling • Is often used in place of experiments when experiments are too large, too expensive, too dangerous, or too time consuming. • Can be useful to investigate the use of pathogens (viruses, bacteria) to control an insect population, tumor growth, etc. • Is a modern tool for scientific investigation.

  5. Mathematical Modeling Has emerged as a powerful, indispensable tool for studying a variety of problems in scientific research, product and process development, and manufacturing. • Seismology • Climate modeling • Economics • Environment • Material research • Drug design • Manufacturing • Medicine • Biology

  6. Mathematical Modeling Process

  7. Real World Problem Identify Real-World Problem: • Perform background research, focus on a workable problem. • Conduct investigations (Labs), if appropriate. • Learn the use of a computational tool: MATLAB, Maple, Mathematica, Excel, etc.. Understand current activity and predict future behavior.

  8. Example 1: Falling Rock Determine the motion of a rock dropped from height, H, above the ground with initial velocity, V. A discrete model: Find the position and velocity of the rock above the ground at the equally spaced times, t0, t1, t2, …; e.g. t0 = 0 sec., t1 = 1 sec., t2 = 2 sec., etc. |______|______|____________|______ t0 t1 t2 … tn

  9. Working Model SimplifyWorking Model:Identify and select factors to describe important aspects of Real World Problem; determine those factors that can be neglected. • State simplifying assumptions. • Determine governing principles, physical laws. • Identify model variables and inter-relationships.

  10. Governing principles: d = v*t and v = a*t. • Simplifying assumptions: • Gravity is the only force acting on the body. • Earth is flat. • No drag (air resistance). • Model variables are H,V, g, t, x, and v • Rock’s position and velocity above the ground will be modeled at discrete times (t0, t1, t2, …) until rock hits the ground.

  11. Mathematical Model RepresentMathematical Model: • Express the Working Model in mathematical terms; write down mathematical equations whose solution describes the Working Model. • In general, the success of a mathematical model depends on how easy it is to use and how accurately it predicts.

  12. v0 v1 v2 … vn x0 x1 x2 … xn |______|______|____________|_____ t0 t1 t2 … tn t0 = 0; x0 = H; v0 = V t2= t1 + Δt x2= x1 - (v1*Δt) v2= v1 + (g*Δt) … t1= t0 + Δt x1= x0 - (v0*Δt) v1= v0 + (g*Δt)

  13. Computational Model TranslateComputational Model: Change Mathematical Model into a form suitable for computational solution. • Existence of unique solution • Choice of the numerical method • Choice of the algorithm • Software

  14. Computational Model TranslateComputational Model: • Change Mathematical Model into a form suitable for computational solution. • Computational models include software such as MATLAB,Maple, Excel, or Mathematica, or languages such as C, C++, or Java.

  15. Pseudo Code Input V- initial velocity H-initial height g -acceleration due to gravity Δt -time step imax- maximum number of steps Output ti - t value at time step i xi - height at time ti vi - velocity at time ti

  16. Initialize Set ti = t0 = 0; vi = v0 = V; xi = x0 = H print ti, xi, vi Time stepping: i = 1, imax Set ti = t(i-1) + Δt Set xi = x(i-1) -vi*Δt Set vi = v(i-1) + g*Δt print ti, xi, vi if (xi < 0), Set xi = 0; quit

  17. Results/Conclusions Simulate  Results/Conclusions: Run “Computational Model” to obtain Results; draw Conclusions. • Verify your computer program; use check cases; explore ranges of validity. • Graphs, charts, and other visualization tools are useful in summarizing results and drawing conclusions.

  18. Falling Rock: Model

  19. Interpret Conclusions • If model results do not “agree” with physical reality or experimental data, reexamine the Working Model (assumptions) and repeat modeling steps. • Often, the modeling process proceeds through several iterations until model is “acceptable”.

  20. Interpret Conclusions(ctd.) • To create a more realistic model of a falling rock, some of the simplifying assumptions could be dropped; e.g., incorporate drag - depends on shape of the rock is proportional to velocity. • Improve discrete model: • Approximate velocities in the midpoint of time intervals instead of the beginning. • Reduce the size of Δt.

  21. Example 2: Simple Pendulum

  22. Example 2 Compute and plot the linear response of a simple pendulum having a mass of 10 grams and a length of 5 cm. The initial conditions are Also compare the generated plot with the nonlinear plot.

  23. Solution • The differential equation of motion for the simple pendulum without any damping is given by • If we consider the system to be linear, i.e., for small angles,

  24. So the linearized version of the above non-linear differential equation reduces to • In order to use MATLAB to solve it, we have to reduce it to two first order differential equations as MATLAB uses a Runge-kutta method to solve differential equations.

  25. Let When the values of ‘theta’ and the first derivative of ‘theta’ are substituted in the second order linearized differential equation, we get the following two first order differential equation:

  26. For a nonlinear system, • The second order non-linear differential equation reduces to the following, two first order differential equation:

  27. Computational Model • For the linear case the function file is saved as ‘linear.m’. function yp = linear(t,y) yp = [y(2);((-g/l) *(y(1)))]; • For the non linear case the function file is saved as ‘nonlinear.m’. function yp = nonlinear(t,y) yp = [y(2);((-g/l) *sin(y(1)))];

  28. Computational Model

  29. Computational Model tspan = [0 5]; y0 = [1.57;0]; [t,y] = ode45('linear',tspan,y0) plot(t,y(:,1)) grid on; xlabel(‘Time’) ylabel(‘Theta’) title(‘Theta Vs Time’) hold on;

  30. Computational Model • After running the program for the linear version, change the name of the function in the third line of the main code from ‘linear’ to ‘nonlinear’. • By doing this, the Ode45 command will now solve the nonlinear differential equations and plot the result in the same graph. To differentiate between the linear and the non-linear curve, use a different line style.

  31. Oscillating Model

  32. Conclusions From the plots we can see that the time period for the non linear equation is greater than that of the linear equation.

  33. Thank You!

More Related