1. Use Matlab to solve the differential equation (d^2φ/dt)=-(g/R)sin(φ), for the case that the board is released from φ0 = 20 degrees, using the values R = 5 m and g = 9.8 m/s^2 . Make a plot of φ against time for two or three periods. To do this, you'll need two .m files: one with your main code, which calls ode45, and one with the differential equation you're solving.
2. On the same picture, plot the approximate solution φ(t)=φ0cos(⍵t), with the same φ0 = 20 degrees. (⍵=sqrt(g/R))
3. Generate two new plots comparing the numerical and analytical solutions for φ0 = 40 degrees and φ0 = 90 degrees.
clc;clear all;close all;
%initial condition phi=20degree
tspan = [0:0.01:50];
y0=[20;0];
[t, y] = ode45('fun_1', tspan, y0);
omega=sqrt(9.8/5);
y1=20*cos(omega*tspan);
figure (1)
plot(t,y(:,1));
hold on
plot(t,y1);
xlabel('t');
ylabel('phi(t)in degree');
title('initial conditon phi=20degree')
%initial condition phi=40degree
y0=[40;0];
[t, y] = ode45('fun_1', tspan, y0);
omega=sqrt(9.8/5);
y2=40*cos(omega*tspan);
figure (2)
plot(t,y(:,1));
hold on
plot(t,y2);
xlabel('t');
ylabel('phi(t)in degree');
title('initial conditon phi=40degree')
%initial condition phi=90degree
y0=[90;0];
[t, y] = ode45('fun_1', tspan, y0);
omega=sqrt(9.8/5);
y3=90*cos(omega*tspan);
figure (3)
plot(t,y(:,1));
hold on
plot(t,y3);
xlabel('t');
ylabel('phi(t)in degree');
title('initial conditon phi=90degree')
%the file name should be in fun_1
function f = fun_1(t,y)
f=zeros(2,1);
%state space form of the differential equation
f(1)=y(2);
f(2)=-(9.8/5)*sind(y(1));
1. Use Matlab to solve the differential equation (d^2φ/dt)=-(g/R)sin(φ), for the case that the board is...
Solve the ordinary differential equation using the numerical solver ode45: dw/dt=7e^(-t) where x(0)=0 Plot(t,x) for t=0:0.02:5 in Matlab
Matlab Code for these please. 4. Using inbuilt function in MATLAB, solve the differential equations: dx --t2 dt subject to the condition (01 integrated from0 tot 2. Compare the obtained numerical solution with exact solution 5. Lotka-Volterra predator prey model in the form of system of differential equations is as follows: dry dt dy dt where r denotes the number of prey, y refer to the number of predators, a defines the growth rate of prey population, B defines the...
I need to solve the following differential equation in Matlab. dr/dt*pi(3r - r^2) = -0.5*sqrt(17r) How would I write the code for this? Please keep it as simple as possible as I'm new to Matlab.
Find an approximate solution to the pendulum problem such that d2 theta /dt2 +g/l theta = 0. Use an approximate solver in matlab to find the solution to the exact equation d2 theta/dt2 +g/l * sin( theta) = 0. Compare the two solutions when the initial angle is 10, 30, and 90. Find a way to quantify the difference. One approximate method for solving differential equations is Runge-Kutta, which in Matlab goes by the name ode45. I have made a...
[10pts] Let's imagine that we have a first-order differential equation that is hard or impossible to solve. The general form is: df g(e) f(t)-he) dt where g(t) and h(t) are understood to be known. It turns out that any first order differential equation is relatively easy to solve using computational techniques. Specifically, starting from the definition of the derivative... df f(t+dt)-S(t) (dt small) dt dt we can rearrange the equation to become... www f(t+dt)-f(t)+dt-df (dt small) dt In other words,...
use the Euler method to solve the differential equation : dv/dt = ve^(1+t)+0.5v for t, between 0 and 0.2, in steps of 0.02; with the initial condition, v=1 when t=0. Compare your results to the excel analytical solution in tabular and graphical forms
write MATLAB scripts to solve differential equations. Computing 1: ELE1053 Project 3E:Solving Differential Equations Project Principle Objective: Write MATLAB scripts to solve differential equations. Implementation: MatLab is an ideal environment for solving differential equations. Differential equations are a vital tool used by engineers to model, study and make predictions about the behavior of complex systems. It not only allows you to solve complex equations and systems of equations it also allows you to easily present the solutions in graphical form....
MATLAB CODE: Task 2 8y dt Solve the above ordinary differential equation (ODE) using Euler's method with step sizes of: 2. h 0.75 3. h 0.5 4. h 0.001 a) For each step size, plot the results at each step starting from y(0) 3 to y(3). b) Plot on the same figure as part a) the analytical solution which is given by: 9 24 -8t c) Calculate and print the percentage error between the Euler's method and the analytical result...
Find the transfer function, G(s) = C(s)/R(s), corresponding to the differential equation d^3 c/dt^3 + 3 d^2 c/dt^2 + 7 dc/dt + 5c = d^2 r/dt^2 + 4 dr/dt + 3r
SOLVE USING MATLAB PLEASE THANKS! The governing differential equation for the deflection of a cantilever beam subjected to a point load at its free end (Fig. 1) is given by: 2 dx2 where E is elastic modulus, Izz is beam moment of inertia, y 1s beam deflection, P is the point load, and x is the distance along the beam measured from the free end. The boundary conditions are the deflection y(L) is zero and the slope (dy/dx) at x-L...