Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am trying to create a code on matlab, I have done the first part of creating a script to solve my ode, but now

image text in transcribedI am trying to create a code on matlab, I have done the first part of creating a script to solve my ode, but now I need help with eulers method using the specified parameters above. Thanks!

CHE222 Lab 8 - Tuesday, March 13 Learning Outcomes: After this lab, you should be able to use Euler's method for numerical integration. Prelab - 2 Points: For the arbitrary function calculates and outputs the value of G for any inputted y value. Your function definition should loolk omething like this: ay =-3y + 30, create a new MATLAB function that dt dt function dy = functionname(y,t) Create a new script that uses your created function to implement Euler's method to approximate the value oty over a time period of 0 to 100 seconds. You may assume yo-0 and you may use At-2. The algorithm for Euler's Method is described below. Euler's method: Given an initial value of yo at time to and an expression for the first derivative *- f(t, y), the value of the variable y after a time interval of At, denoted by y1, can be estimated by: dt Eq. 1 Which can be iteratively evaluated to estimate the value of y at each subsequent time step until a specified time tfinal Algorithm (1) Determine the number of required steps n using n - (2) Starting from i = 0, set yi and ti to their initial values of yo and to (3) Calculate the derivative using the function f (ti,yi) (4) Estimate the value of yit1 at time ti + t using: final LO At 2 (5) Calculate the value of ti+1 using tH-t + t and also update the iterator using 1 = 1 + 1. (6) Ifi is less than or equal to n, repeat steps 3-5. Otherwise, stop

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

8. Set goals that relate to practice as well as competition.

Answered: 1 week ago

Question

2. What potential barriers would you encourage Samuel to avoid?

Answered: 1 week ago