💾
EC
  • Introduction
  • EC Course
    • Syllabus
    • Preparation for EC
    • Tutorial
      • Tutorial: arduino-stm32
        • Tutorial: arduino-stm32 Installation
        • Tutorial: arduino-stm32 Part1
        • Tutorial: arduino-stm32 Part2
      • Tutorial: MDK uVision
        • Tutorial: Installing MDK uVision
        • Tutorial: Create a Project with uVision
        • Tutorial: Adding library header in uVision
        • Tutorial: Re-using Project Configuration
        • Debugging in uVision
      • Tutorial: PlatformIO in CLion
      • Tutorial: PlatformIO in VSCode
      • Tutorial: Repository Management
      • Tutorial: Managing library header files
      • Tutorial: PinName Configuration
      • Tutorial: Bitwise Macro
      • Tutorial: Custom initialization
      • Tutorial: Documentation
      • Tutorial: Creating Application API
      • Tutorial: 7-Segment Display
      • Tutorial: DC motor driver connection
      • Tutorial: USART with TeraTerm
      • Tutorial: Finite State Machine programming
      • Tutorial: Bluetooth
      • Tutorial: Zigbee with Nucleo board
    • LAB
      • LAB Report Template
      • LAB: Smart mini-fan with STM32-duino
      • LAB: Portable Fan with mbed
      • LAB: GPIO Digital InOut
      • LAB: GPIO Digital InOut 7-segment
      • LAB: EXTI & SysTick
      • LAB: Timer & PWM
      • LAB: Stepper Motor
      • LAB: Input Capture - Ultrasonic
      • LAB: USART - LED, Bluetooth
      • LAB: ADC - IR reflective sensor
      • LAB: Line Tracing RC Car
    • Sample code
      • Code Templates
    • Hardware
      • Nucleo-F411RE
      • LAB Hardware
        • Electronic Chips
        • HUINS Embedded Kit
    • Projects
      • Line Tracing Car Project
      • Design Project
        • Past Projects
      • Project Grading Criteria
    • Study Resource for MCU
      • Hexa-Decimal Table
      • Bitwise Op for Register
      • System Clock
      • Timer
      • USART
      • ADC
  • STM32 M4 Programming
    • Documentation
      • C++ API Docs
    • Firmware Library
      • PinName Configuration
      • GPIO Digital
      • RCC
      • EXTI_SysTick
      • TIMER
      • USART
    • Troubleshooting
    • mbed for STM32
      • Tutorial: mbed-Part 1
      • Tutorial: mbed - Part 2
      • Tutorial: mbed - Part 3
      • Using mbed API on uVision
    • mbed OS
  • Other Programming
    • Arduino
    • Socket Programming
      • Window Socket Programming
      • Arduino WiFi
    • Cube-MX
    • Github
    • Markdown
      • Example: API documentation
    • MATLAB
  • C Programming
    • C-Programming Lessons
      • Installing Visual Studio Community
        • Visual Studio Community 2022
      • Installing VS Code(Mac/Linux)
      • Creating Header Lib
      • Pointer
      • Array
      • 2D Array
      • Structure
      • Dynamic Alloc
      • Bitwise Operation
  • Numerical Programming
    • Syllabus
    • Preparation for NP
    • Math Review
    • Tutorial
      • TA Session Video
      • Tutorial: NP Library Header Files
      • Tutorial - Sine Taylor
      • Tutorial: Passing a Function, Function callback
      • Tutorial: Nonlinear solver
      • Tutorial: Differentiation
      • Tutorial: Integration
      • Tutorial: Matrix Structure
      • Tutorial: Eigenvalue problem
      • Tutorial: ODE-IVP
      • Tutorial: Curve Fitting
      • Tutorial: Create Github Repos of NP lib
      • Tutorial: Version Control in Github
      • Tutorial: Documentation with Markdown
      • Exercise: Version Control and Documentation
    • Example: MATLAB
    • Example: NP Library
    • Assignment
      • Assignment Factorial and Power
      • Assignment: Version Control and Documentation
    • Problem Bank
Powered by GitBook
On this page
  • Problem Bank
  • Additional Problems for Numerical Programming
  • Non-Linear Equations
  • Problem #1
  • Linear Equations
  • Problem #1
  • Problem #2
  • Problem #3
  • Eigenvalue-vector
  • Problem #1
  • Least Squares Regression
  • Problem #1
  • ODE-IVP
  • Problem #1
  • Problem #2

Was this helpful?

  1. Numerical Programming

Problem Bank

PreviousAssignment: Version Control and Documentation

Last updated 5 months ago

Was this helpful?

Problem Bank

Additional Problems for Numerical Programming


Non-Linear Equations

Problem #1

Find the root for f(x) between x=[4, 4.5] : f (x) = sin(10x) + cos(3x)


Linear Equations

Problem #1

Multiple Mass-Spring System

Find the acceleration for each mass of the three mass-four spring system., when

  • x1 = 0.05 m, x2 = 0.04 m, x3 = 0.03 m

The dynamic of the system can be expressed as

The parameters:

  • k1 = k4 = 10 N/m, k2 = k3 = 30 N/m, and m1 = m2 =m3 = 1 kg

Hint

Solve as Ay=b, where y=[acc1; acc2; acc3]


Problem #2

Ohm’s law and Kirchhoff’s Current law:

An electrical network has two voltage sources and six resistors. By applying both Ohm’s law and Kirchhoff’s Current law:

Solve the linear system for the current i1, i2, and i3 if

  • R1 = 1, R2 = 2, R3 = 1, R4 = 2, R5 = 1, R6 = 6

  • V1 = 20, V2 =30


Problem #3

Truss Analysis

Consider the loading of a statically determinate pin-jointed truss shown below. The truss has seven members and five nodes, and is under the action of the forces R1, R2, and R3 parallel to the y-axis

**Find the member forces (Fi) obtained from the following system of equations **


Eigenvalue-vector

Problem #1

Building Earthquake Analysis

A three-story building modeled as a mass-spring system. Each floor mass is represented by m_i, and each floor stiffness is represented by k_i for i = 1 to 3. For this case, the analysis is limited to horizontal motion of the structure as it is subjected to horizontal base motion due to earthquakes.

  • X_i represent horizontal floor translations (m) [Eigenvector]

  • ω_n is the natural, or resonant, frequency (radians/s). [Eigenvalue]

Determine the eigenvalues and eigenvectors for this system.

Hint

Solve by expressing it as


Least Squares Regression

Problem #1

Distance Estimation

A parachutist jumps from a plane and the distance of his drop is measured. Suppose that the distance of descent d as a function of time t can be modeled by

Find values of α and β that best fit the data as

  • t=[ 5 10 15 20 25 30]

  • d=[ 30 83 126 157 169 190]


ODE-IVP

Problem #1

Newton's Law of Cooling

The rate at which the temperature of a body changes is proportional to the difference between the temperature of the body T(t) and the temperature of the surrounding medium (Tm) :

Approximate the temperature T at t = 4 min of a ceramic insulator

  • Baked at 400 C (T_init) and cooled in a room in which the temperature(Tm) is 25 C

  • Use k = −0.213

Solution

T(4) = 184.96.


Problem #2

Headlamp Mirror Design

An automobile heading light mirror is designed to reflect the light given off by the headlamp in rays parallel to the real surface. By using the principle of optics that the angle of light incidence equals the angle of light reflection. Assume the first-order differential equation that models the desired shape of the mirror is

The mirror is designed so that the distance of the mirror directly above the lamp is 1 cm, i.e., y(0) = 1

Estimate y at (a) x = 1 (b) x = 2

  • Use the Runge-Kutta method with h = 0.1

[A−λI]v=0{\bf{[A - }}{\rm{\lambda }}{\bf{I]v = 0}}[A−λI]v=0
d=αt+βt2e−0.1td = αt + βt^2e^{−0.1t}d=αt+βt2e−0.1t
image-20241127103937635
image-20241127104000466
image-20241127104033155
image-20241127105437524
image-20241127105800651
image-20241127105853843
image-20241127111634179
image-20241127112046935
image-20241127110358127
image-20241127110912733