Question

In: Advanced Math

solve an ODE of whatever expression using ode45 in matlab obtaining the result [t,y]. Evaluate the...

solve an ODE of whatever expression using ode45 in matlab obtaining the result [t,y]. Evaluate the solved ODE in a point. Everything should be done in matlab.

Solutions

Expert Solution

clc;
clear all;

%y'=-ty/sqrt(2-y^2), y(0)=1, t in [0,5]
f=@(t,y)-t.*y./(sqrt(2-y.^2));
tspan=[0,5];
y0=1;

[t,y1] = ode45(f , tspan, y0);
[t,y1]

%%%%%Solution


ans =

0 1.0000
0.1250 0.9922
0.2500 0.9697
0.3750 0.9342
0.5000 0.8881
0.6250 0.8341
0.7500 0.7747
0.8750 0.7120
1.0000 0.6478
1.1250 0.5836
1.2500 0.5208
1.3750 0.4602
1.5000 0.4027
1.6250 0.3489
1.7500 0.2994
1.8750 0.2543
2.0000 0.2137
2.1250 0.1778
2.2500 0.1463
2.3750 0.1192
2.5000 0.0961
2.6250 0.0765
2.7500 0.0603
2.8750 0.0470
3.0000 0.0363
3.1048 0.0290
3.2096 0.0229
3.3145 0.0180
3.4193 0.0140
3.5077 0.0113
3.5960 0.0090
3.6844 0.0072
3.7728 0.0057
3.8513 0.0046
3.9297 0.0037
4.0082 0.0030
4.0867 0.0024
4.1582 0.0019
4.2298 0.0016
4.3014 0.0013
4.3730 0.0010
4.4393 0.0008
4.5057 0.0007
4.5721 0.0005
4.6384 0.0004
4.7006 0.0004
4.7628 0.0003
4.8250 0.0002
4.8872 0.0002
4.9154 0.0002
4.9436 0.0002
4.9718 0.0001
5.0000 0.0001


Related Solutions

Show to use ode45 built-in function in MATLAB to solve the following ODE problem: dydx=x^2 /...
Show to use ode45 built-in function in MATLAB to solve the following ODE problem: dydx=x^2 / y y(0)=2   Calculate y(x) for 0 ? x ? 20 and compare the results to analytical solution y = sqrt((2x^3 / 3) + 4)
2. Use MATLAB (ode45) to solve the second-order Euler-Cauchy ODE given in the thick-walled tube elasticity...
2. Use MATLAB (ode45) to solve the second-order Euler-Cauchy ODE given in the thick-walled tube elasticity problem handout for the case: ?r(1) = 0.1, dur(1)/dr = −0.02 Have your MATLAB code print out the values for the constants you determined in the general solution; i.e. “C1 = ... , C2 = ...” make a comparison plot showing your exact solution and the numerical MATLAB result on the same axes.
solve using both methods (Dsolve and ODE45 on matlab) please provide steps 1) y'+y=e^x 2) y'+2y=...
solve using both methods (Dsolve and ODE45 on matlab) please provide steps 1) y'+y=e^x 2) y'+2y= 2 sin(x)
Implement the Lorenz-63 model in MATLAB, and solve numerically (using MATLAB’s ode45 or other built-in solver)...
Implement the Lorenz-63 model in MATLAB, and solve numerically (using MATLAB’s ode45 or other built-in solver) for any random, non-zero initial conditions to reproduce, qualitatively, Figures 3 and 4. Note that, as usual, you should label your axes and make the plots as “pretty” as possible. The model equations are dx/ dt = σ(y − x), dy /dt= x(ρ−z)−y, dz/dt = xy − βz. Use parameter values σ = 10, ρ = 28, and β = 8/3.
Find the general solution y(t) to the following ODE using (a) Method of Undetermined Coefficients AND...
Find the general solution y(t) to the following ODE using (a) Method of Undetermined Coefficients AND (b) Variation of Parameters: 2y"-y'+5y = cos(t) - et Sin(t)
Use MATLAB DSOLVE to solve the folloing ODE and plot it: 300x'' + 60x' + 6840...
Use MATLAB DSOLVE to solve the folloing ODE and plot it: 300x'' + 60x' + 6840 = f(t)
solve using powers series method, full procedure please: y´(t) = -y(t) + t
solve using powers series method, full procedure please: y´(t) = -y(t) + t
Find the general solution y(t) to the following ODE using ONLY the Variation of Parameters: y"+4y'-2y...
Find the general solution y(t) to the following ODE using ONLY the Variation of Parameters: y"+4y'-2y = 2x2-3x+6
y'' + y=tanx+3x-1 solve the ode and find the general solution?
y'' + y=tanx+3x-1 solve the ode and find the general solution?
subject:engineering mathematics solve [cos(x+y)-sin(x+y)]dx-sin(x+y)dy=0,is the ODE exact?Find an integrating factor and solve the ODE.
subject:engineering mathematics solve [cos(x+y)-sin(x+y)]dx-sin(x+y)dy=0,is the ODE exact?Find an integrating factor and solve the ODE.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT