Question: Here we use Matlab to numerically solve a simple ordinary differential equation: x + x = 0 x ( 0 ) = 0 . 1

Here we use Matlab to numerically solve a simple ordinary differential equation:
x+x=0
x(0)=0.1
As a first step, we re-wnite this equation as:
hat(x)=-x
Wc use ODE45 function to solve this ODE. To use ODE45, you need two Matlab functions. The first one defines your equation. I have called this ofe_function_fiest_order:
dydt=(-y(1))
end
The second one calls ODE45 to solve the equation that you have defined. I have called this obs 1st order
What
tepan=(0101)
yo =10.11
plot (t,y(:,1))
The last line in the function plots the results.
I have uploaded these two functions as two scparate files. Make a new folder in your computer, Copy both of these files in the same folder. Open Matlab. Go to that directory. Type
ODE_1st Order
and enter.
You should be looking at the solution of that equation.
Now solve the following problem:
x-xcosx-1=0
x(0)=0.05
 Here we use Matlab to numerically solve a simple ordinary differential

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!