Question
I'm trying to solve this differential equations by using matlab and I've got a plot from the code attached. But I wanna get a plot of completely sinusoidal form. If I can magnify the plot and expand x-axis, maybe we can get the sinusoidal form. So help me with this problem by using matlab. Example is attached in below. One is the plot from this code and another is example.


function second_order_ode2
t=[0:0.001:1];
initial_x=0;
initial_dxdt=0;
[t,x]=ode45(@rhs,t,[initial_x initial_dxdt]);
plot(t,x(:,1))
xlabel('t')
ylabel('x')
function dxdt=rhs(t,x)
dxdt_1=x(2);
dxdt_2=(-50*x(2)-1000*x(1)+61.25+((1-cos(4*pi*10*t))/2).*(47380*x(1).^3-7428*x(1).^2+366*x(1)-7));
dxdt=[dxdt_1;dxdt_2];
end
end


Figure 파일(E) 편집 보기 삽입ⓛ 둘 데스크탑(D) 창W 도움말(H) 0.07 0.06 0.05 0.04 0.03 0.02 0.01 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
p Ul moving bar was 20 mm from the fixed yoke 0.012 Time stepping method(FEM) Proposed method 0.010 0.008 E 0.00 0.004 0.00
Figure 파일(E) 편집 보기 삽입ⓛ 둘 데스크탑(D) 창W 도움말(H) 0.07 0.06 0.05 0.04 0.03 0.02 0.01 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
p Ul moving bar was 20 mm from the fixed yoke 0.012 Time stepping method(FEM) Proposed method 0.010 " 0.008 E 0.00 0.004 0.00EE -0.002 -0.004し 0.0 0.2 1.0 0.6 0.4 0.8 Time [s]
0 0
Add a comment Improve this question Transcribed image text
Answer #1

open matlab figure and double click on axis

change the axes limits so that sinusoidal waveform of given magnitude can be identified.

Figures Figure 1 X File Edit View Insert Tools Debug Desktop Window Help Figure 1 0.0616 0.0614 H 0.0612 - 0.061 H x 0.06089-

-----------------------------------------------------------

to expand x axis scale go to axis editor and open ticks so that X tick locations can be selected by step by.

------------------------------------------------------------

Figures-Fiqure 1 Edit Axes Ticks X File Edit View Debug Desktop Window Insert Tools Help X Axis Y Axis Z Axis Figure 1 X Tick

------------------------------------------------

to expand X axis 2 nd line of code can be written as

t=[Xstart:0.001:Xlimit];

Xstart may be from 0 or specified value.

Xlimit is the extended value

-----------------------------------------------------

final code

---------------------------------------------------------

function second_order_ode2
t=[0:0.001:10];
initial_x=0;
initial_dxdt=0;
[t,x]=ode45(@rhs,t,[initial_x initial_dxdt]);
plot(t,x(:,1))
xlabel('t')
ylabel('x')
function dxdt=rhs(t,x)
dxdt_1=x(2);
dxdt_2=(-50*x(2)-1000*x(1)+61.25+((1-cos(4*pi*10*t))/2).*(47380*x(1).^3-7428*x(1).^2+366*x(1)-7));
dxdt=[dxdt_1;dxdt_2];
end
end

-----------------------------------------------------------------------------

Add a comment
Know the answer?
Add Answer to:
I'm trying to solve this differential equations by using matlab and I've got a plot from the code attached. But...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I'm trying to solve this differential equations by using matlab and I've got a plot from the code attached. But...

    I'm trying to solve this differential equations by using matlab and I've got a plot from the code attached. But I wanna get a plot of completely sinusoidal form. If I can magnify the plot and expand x-axis, maybe we can get the sinusoidal form. So help me with this problem by using matlab. Example is attached in below. One is the plot from this code and another is example. function second_order_ode2 t=[0:0.001:1]; initial_x=0; initial_dxdt=0; [t,x]=ode45(@rhs,t,[initial_x initial_dxdt]); plot(t,x(:,1)) xlabel('t') ylabel('x')...

  • I'm trying to solve this differential equations by using matlab. But I don't know the reason why I can't ge...

    I'm trying to solve this differential equations by using matlab. But I don't know the reason why I can't get the solutions. I've attached matlab code and few differential equation. Please find a the way to solve this problem. second oder ode2.m x+ function, second-oder-ode2 t-0:0.001:30 initial-x = 0; initial-dxdt = 0: lt.影=ode45( @rhs, t, [initial.x initial.dxdt ] ); plot(t.(:,1l): xlabel( t); ylabel(x): 申 function dxdt=rhs( t, x) dxdt-1 =x(2); dxdt-2 (-50 x(2)+61.25+((1-cos(4 pi 10 t))/2) (47380 x(1)-3-7428 x(1) 2...

  • Write a rate law for the reaction. The graph below shows a plot of the rate...

    Write a rate law for the reaction. The graph below shows a plot of the rate of a reaction versus the concentration of the reactant A for the reaction A products (Figure 1). Rate = k Rate = k[A] Rate = k [A] Rate = k [A] Submit Previous Answers ✓ Correct Figure Part C < 1 of 1 > Estimate the value of k. 0.012 Express your answer using two significant figures. 0.01 0.008 10 AD O ? Rate...

  • I'm trying to solve this problem by using matlab. But I don't know reason why I can't get the solutions. I w...

    I'm trying to solve this problem by using matlab. But I don't know reason why I can't get the solutions. I wanna get a plot of this differential equation. Please find a way how to solve this problem. May there're errors in the code. Please check it.    second-oder-ode2.m x 曱function, second-oder-ode2 t=0:0.001 :30; initial-× = 0; in i t i al-dxdt 0; lt,影=ode45( @rhs, t. [initial.x initial-dxdt ] ); plot( (:, 1) ) ; xlabel( 't); ylabel(): function dxdt=rhs( t,...

  • matlab help, please my code is here: %% exercise2 %a Fs = 8000; % sampling frequency tn = 0:1/Fs:0.005; % here, bit dura...

    matlab help, please my code is here: %% exercise2 %a Fs = 8000; % sampling frequency tn = 0:1/Fs:0.005; % here, bit duration is 0.005s instead of 1/300s phi1 = 0; phi0 = 0; % phases of the sinusoid x1 = cos(2*pi*1650*tn + phi1); % tone for binary 1 x0 = cos(2*pi*1850*tn + phi0); % tone for binary 0 xx = [x1, x0]; % FSK signal for ¡°1,0¡± tt = [tn, tn + 0.005]; % time figure(1) plot(tt, xx); %...

  • Use the attached Matlab code as a basis to solve the following ordinary differential equation usi...

    Question 1 QUESTION 2 Use the attached Matlab code as a basis to solve the following ordinary differential equation using Euler's method, with timestep of 0.1, from t-0to t-100. d)0) -0 - sin (5vt cos(у Plot y versus t from t=0 to t=100. How many local maxima are on this interval(do not include end points). Be careful to count them all! Answer should be an integer 1 w% Matlab code for the solution of Module 2 3 dt-9.1; %dt is...

  • Please solve the following Question using mainly the equations attached and the drawing amplitude must be...

    Please solve the following Question using mainly the equations attached and the drawing amplitude must be a value not an equation, the value should be taken from the table? Equations: Pre-work: Read Section 4.1, 4.1.1, 4.1.2 of Principles of Communications by Ziemer and Tranter. A Bessel function table is given in the Appendix at the end of this lab sheet]. 1. Determine and draw the single-sided amplitude spectrum of a frequency modulated signal with a modulation index of 0.3 and...

  • Water at 50 °Fis circulated from a large tank, through a filter, and back to the...

    Water at 50 °Fis circulated from a large tank, through a filter, and back to the tank Calculate the volumetric flow rate through the filter for the following given information: Patm V.. Valve Pump Filter Pump power: W=200 lbf.ft/s Pump efficiency: 1p-0.9 Total pipe length: /= 200 ft Pipe diameter: d=0.1 ft Pipe surface relative roughness: /d=0.01 Elbow loss factor (each): Kelbow=1.5 Valve loss factor: Kvalve-6 Inlet and Exit type: sudden, Fig. 6.22 Filter loss factor Kriter=12 F (velocity, ft/s...

  • Water at 50 °F is pumped from pond 1 to pond 2. Calculate the volumetric flow...

    Water at 50 °F is pumped from pond 1 to pond 2. Calculate the volumetric flow rate and pump power for the following given information Patm h Opump Patm ... Total pipe length: /=500 ft Pipe diameter: d=8 in Pipe material: new cast iron Elbow type: flanged, 90° regular Valve type: globe, flanged, fully open Inlet and Exit type: sudden, Fig. 6.22 Pump head: hp 250 ft Pump efficiency: np=0.85 h-200 ft F (velocity, ft/s x diameter. (Vd) for water...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT