Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
12 views
9 pages
Lab Rep 1
Uploaded by
kate
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF, TXT or read online on Scribd
Download
Save
Save LabRep1 For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
12 views
9 pages
Lab Rep 1
Uploaded by
kate
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF, TXT or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save LabRep1 For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save LabRep1 For Later
You are on page 1
/ 9
Search
Fullscreen
BATAAN PENINSULA STATE UNIVERSITY
COLLEGE OF ENGINEERING AND ARCHITECTURE
DEPARTMENT OF ELECTRONICS ENGINEERING
ECEM 0313
Laboratory Report 1
January 27, 2023
SADJE, KATE NICHOLLE A.
BSECE III - B
Score
ENGR. KRISTINE P. ORTEGA
SOURCE CODE:
clc, clear
fprintf ('Choose a number from the options below:\n\n') fprintf('1-
Laplace/Inverse Laplace Transform\n2- Power Series\n3- Frobenius
Method\n4- Direction Field\n5- Euler’sMethod\n6- Modified Euler’s
Method\n7- Taylor’s Method\n') while true
method = input(''); if
isequal(method,1)
syms s t Y
prompt = {'Type the the right hand side function(EX.exp(-t)): ',
'Type the the left hand side function(EX.Y2 + 3*Y1 + 2*Y):',
'Type the initial value problem condition. ' , 'Type the
initial value problem condition. ', };reqn =
(input(prompt{1}));
lap = laplace(reqn, t ,s);con1
= input(prompt{3}); con2 =
input(prompt{4}); Y1 = s*Y-
con1;
Y2 = s*Y1-con2;
leqn = (input(prompt{2})); Sol =
solve(leqn - lap, Y);ilap =
ilaplace(Sol,s,t);
fprintf ('Equation:\n%s = %s\n',leqn,reqn);
fprintf ('Initial Value Condition:\ny(0) = %d\ny(0)=
%d\n',con1,con2)
fprintf ('Laplace Transform:\n%s\n',Sol)
fprintf ('Inverse Laplace Transform:\n%s\n',ilap);d=0;
break;
elseif isequal(method,2)syms
y(t)
eqn = input('Type your Equation(Ex.2*t*diff(y,2) + t*y +diff(y) ==
0:\n');
Sol = dsolve(eqn, 'ExpansionPoint' , 0);disp
('Power Series')
d=1;
break;
elseif isequal(method,3)
syms y(t)
eqn = input('Type your Equation(Ex.2*t*diff(y,2) + t*y +diff(y) ==
0:\n');
Sol = dsolve(eqn, 'ExpansionPoint' , 0 );
disp('Frobenius Method')
d=1;
break;
end
syms y(t)
eqn = diff(y,t)== input('Type your Equation(Ex.-
t*y^3):\n');
gsol = dsolve(eqn); cond=input('Conditions(Ex.y(0)==1):\n');
exact=(dsolve(eqn,cond));
d=2;
if isequal(method,4)
for c=linspace(0.25,10,5)
t=linspace(-3,3,100);
plot(t,subs(exact),'b','LineWidth',1);hold on
grid on
end
[t, y] = meshgrid(-3:0.2:3, -3:0.2:3);
S = input('Type your equation like this(Ex.-t.*y.^3):\n');L = sqrt(1
+ S.^2);
quiver(t, y, 1./L, S./L, 0.5);
set(gca, 'XLim', [-3 3], 'YLim', [-3 3]);
disp('Direction Field')
break;
elseif isequal(method,5)syms y
t
eqn = input('Type your equation again:\n');dy1 =
matlabFunction(eqn);
f1 = matlabFunction(exact);t =
input('t = ');
y1 = input('y = ');
h1 =input('Stepsize.h = ');
h = input('# of iterations.n=');tn1
=t+h*h1 ;
disp('Euler''s')
fprintf(' \n')
fprintf('\tt\t\t Euler\t\t Exact\n'); fprintf(' \n')
fprintf (' %f \t %f \t %f\n ', t, y1, f1(t));
for t1= t : h1 : tn1-h1 y1 =
y1 + dy1(t1, y1)*h1;d1 = t1 +
h1;
fprintf ('%f \t %f \t %f \n ', d1,y1,f1(d1))end
break;
elseif isequal(method,6)syms y
t
eqn = input('Type your equation again:\n', 's');
f=inline(eqn);
f1=matlabFunction(exact);
t=input('t = ');
y=input('Initial Value: y(0) = ');h
=input('Stepsize.h = ');
n = input('# of iterations.n = ');tn
=t+h*n;
disp('Modified Euler''s')
fprintf(' \n')
fprintf('\tt\t\t\t Exact\t\t\tModified Euler\n');
fprintf(' \n')
for i=1:n+1
y1=y+h*(f(t,y)+f(t+h,y+h*f(t,y)))/2; fprintf('
%f\t\t%f\t\t%f\n',t,f1(t),y1);t=t+h;
end
break;
else if isequal(method,7)syms t y
f=input('Type your equation again:\n');f1 =
matlabFunction(exact);
a =input('t = ');
ya =input('y = ');
m=input('# of iterations n = ');h =
input('Stepsize h = ');
b = a+m*h;
dfs(1) = symfun(f, [t y]);for
k=1:3
dfs(k+1) = diff(dfs(k),t)+f*diff(dfs(k),y);end
df = matlabFunction(symfun(dfs,[t y]));T =
zeros(1,m+1);
Y = zeros(1,m+1);
T(1) = a;
Y(1) = ya;
for i=1:m
tj = T(i);
yj = Y(i);
D = df(tj,yj);
Y(i+1) = yj + h*(D(1)+h*(D(2)/2+h*(D(3)/6+h*D(4)/24)));
T(i+1) = a + h*i;end
disp ('Taylor''s Method')
fprintf(' \n')
fprintf('\tt\t\t Taylor\t\t Exact\n'); fprintf(' \n')
for i=1: +1 : m+1
t=T(i);
y=Y(i);
fprintf (' %f \t %f \t %f \n', t,y,f1(t));end
break;
else
disp ('Input number must only be 1 to 7!' )end
end
end
if isequal(d,1) disp
('Equation:')disp
(eqn)
disp ('Solution:')
disp (Sol)
else if isequal(d,2)
fprintf('\nEquation:\n')
disp(eqn) fprintf('IVP\n')
disp(cond)
fprintf('General Solution:\n')
disp(gsol)
fprintf('Exact Solution:\n')
disp(exact)
end
end
You might also like
Winter 2022 Model Answer Paper
PDF
75% (4)
Winter 2022 Model Answer Paper
25 pages
Solution Manual - Applied Numerical Methods With MATLAB For Engineers and Scientists
PDF
80% (5)
Solution Manual - Applied Numerical Methods With MATLAB For Engineers and Scientists
236 pages
2000 Product Bundle Xp5efv
PDF
50% (2)
2000 Product Bundle Xp5efv
6 pages
Philosophical Perspectives in Education
PDF
100% (1)
Philosophical Perspectives in Education
22 pages
Cross-Cultural Servanthood
PDF
100% (2)
Cross-Cultural Servanthood
8 pages
The Holy Qur'an - What The Shias Say
PDF
No ratings yet
The Holy Qur'an - What The Shias Say
41 pages
Grade 10 English
PDF
No ratings yet
Grade 10 English
17 pages
1.0 Bisection Method
PDF
No ratings yet
1.0 Bisection Method
95 pages
Past Perfect Story 1 Unlocked
PDF
100% (1)
Past Perfect Story 1 Unlocked
6 pages
Practical Exam
PDF
No ratings yet
Practical Exam
9 pages
NA Assignment2 171465551 Sabbir Ahmed KIE180713
PDF
No ratings yet
NA Assignment2 171465551 Sabbir Ahmed KIE180713
30 pages
Numerical Analysis Assignment
PDF
No ratings yet
Numerical Analysis Assignment
14 pages
Applied Numerical Methods: Digital Assignment-1
PDF
No ratings yet
Applied Numerical Methods: Digital Assignment-1
18 pages
NMO Codes ALL
PDF
No ratings yet
NMO Codes ALL
25 pages
Function: 'ERROR, Inserte Otros Valores Iniciales'
PDF
No ratings yet
Function: 'ERROR, Inserte Otros Valores Iniciales'
13 pages
Labwork 6
PDF
No ratings yet
Labwork 6
2 pages
Nmo Final Programs
PDF
No ratings yet
Nmo Final Programs
16 pages
Assignment 1
PDF
No ratings yet
Assignment 1
9 pages
Lab 3
PDF
No ratings yet
Lab 3
10 pages
Matlabprogram
PDF
No ratings yet
Matlabprogram
11 pages
Initial Value Problem Presentation-1
PDF
No ratings yet
Initial Value Problem Presentation-1
29 pages
Initial Value & Integration & Differentiation Cheat
PDF
No ratings yet
Initial Value & Integration & Differentiation Cheat
11 pages
Matlab Assignment
PDF
No ratings yet
Matlab Assignment
4 pages
LAB4
PDF
No ratings yet
LAB4
6 pages
Lab Final
PDF
No ratings yet
Lab Final
8 pages
NR Matlab Cod PDF
PDF
No ratings yet
NR Matlab Cod PDF
4 pages
Mini Project Cal 2
PDF
No ratings yet
Mini Project Cal 2
13 pages
All Methods
PDF
No ratings yet
All Methods
7 pages
Numericals - Lab Report 01
PDF
No ratings yet
Numericals - Lab Report 01
7 pages
Python
PDF
No ratings yet
Python
8 pages
Q1 Gauss-Seidel Method Program
PDF
No ratings yet
Q1 Gauss-Seidel Method Program
8 pages
As Sing Ment
PDF
No ratings yet
As Sing Ment
7 pages
Machine Problem 10
PDF
No ratings yet
Machine Problem 10
4 pages
Hessayon, A. 'Translating Jacob Boehme'
PDF
100% (1)
Hessayon, A. 'Translating Jacob Boehme'
38 pages
Ce 335
PDF
No ratings yet
Ce 335
13 pages
F.Y Engg Grap
PDF
No ratings yet
F.Y Engg Grap
17 pages
1.bisection Method
PDF
No ratings yet
1.bisection Method
47 pages
Numerical Method For Engineering 3
PDF
No ratings yet
Numerical Method For Engineering 3
9 pages
Cal211-CC05-GROUP 8
PDF
No ratings yet
Cal211-CC05-GROUP 8
11 pages
Milne
PDF
No ratings yet
Milne
9 pages
Examen
PDF
No ratings yet
Examen
11 pages
Lab 4
PDF
No ratings yet
Lab 4
6 pages
Learning Styles
PDF
No ratings yet
Learning Styles
22 pages
Examen
PDF
No ratings yet
Examen
9 pages
Examen
PDF
No ratings yet
Examen
9 pages
Linear Regression
PDF
No ratings yet
Linear Regression
10 pages
Function Euler Method
PDF
No ratings yet
Function Euler Method
1 page
Matlab 8&9
PDF
No ratings yet
Matlab 8&9
6 pages
Nonlinear ODE. Solve The Nonlinear ODE
PDF
No ratings yet
Nonlinear ODE. Solve The Nonlinear ODE
6 pages
Differential Equation
PDF
No ratings yet
Differential Equation
17 pages
Hvalues M
PDF
No ratings yet
Hvalues M
1 page
Scilab Codes Sem III
PDF
No ratings yet
Scilab Codes Sem III
15 pages
MP2 Notes
PDF
No ratings yet
MP2 Notes
5 pages
22MATS21 MATLAB Progs
PDF
No ratings yet
22MATS21 MATLAB Progs
6 pages
Experiment-5: AIM:WAP in MATLAB To Find The Root of Following Equations Using Gauss Elimination
PDF
No ratings yet
Experiment-5: AIM:WAP in MATLAB To Find The Root of Following Equations Using Gauss Elimination
26 pages
Xavier University - Ateneo de Cagayan University College of Engineering Electronics Engineering Department
PDF
No ratings yet
Xavier University - Ateneo de Cagayan University College of Engineering Electronics Engineering Department
10 pages
Mae 305 Assignment 4
PDF
No ratings yet
Mae 305 Assignment 4
7 pages
CML Lab Manual
PDF
No ratings yet
CML Lab Manual
15 pages
Lab 9
PDF
No ratings yet
Lab 9
8 pages
Clear CLC: Numerical Integration
PDF
No ratings yet
Clear CLC: Numerical Integration
10 pages
Year 3 CEFR English Language PDPR Module/LP
PDF
No ratings yet
Year 3 CEFR English Language PDPR Module/LP
5 pages
CONM Lab Manual
PDF
No ratings yet
CONM Lab Manual
11 pages
19BCE1102 Brijesh Kumar Lab Fat Matlab Prof. Somnath Bera
PDF
No ratings yet
19BCE1102 Brijesh Kumar Lab Fat Matlab Prof. Somnath Bera
9 pages
NMO SPPU TE Mechanical All Programs With Solver
PDF
No ratings yet
NMO SPPU TE Mechanical All Programs With Solver
23 pages
MATLAB Code For NumericalA
PDF
No ratings yet
MATLAB Code For NumericalA
6 pages
EE 553 Homeworks Moyo
PDF
No ratings yet
EE 553 Homeworks Moyo
27 pages
Matlab Code
PDF
No ratings yet
Matlab Code
23 pages
Xavier University - Ateneo de Cagayan University College of Engineering Electronics Engineering Department
PDF
No ratings yet
Xavier University - Ateneo de Cagayan University College of Engineering Electronics Engineering Department
9 pages
SL-IV Lab Manual
PDF
100% (1)
SL-IV Lab Manual
35 pages
LeaP Math G7 Week 6 Q3
PDF
No ratings yet
LeaP Math G7 Week 6 Q3
4 pages
Year Abroad FAQ
PDF
No ratings yet
Year Abroad FAQ
23 pages
ERP Systems
PDF
No ratings yet
ERP Systems
36 pages
CBSE Sample Papers For Class 2 English With Solutions - Mock Paper 2
PDF
No ratings yet
CBSE Sample Papers For Class 2 English With Solutions - Mock Paper 2
5 pages
ElasticSearch Cheat Sheet
PDF
No ratings yet
ElasticSearch Cheat Sheet
5 pages
Using Student-Centered Methods With Teacher-Centered Students (Marilyn Lewis Hayo Reinders) (Z-Library)
PDF
No ratings yet
Using Student-Centered Methods With Teacher-Centered Students (Marilyn Lewis Hayo Reinders) (Z-Library)
126 pages
BUILDING THE NATION by HENRY
PDF
No ratings yet
BUILDING THE NATION by HENRY
2 pages
ENGLISH ITEM ANALYSIS (3nd Grading)
PDF
No ratings yet
ENGLISH ITEM ANALYSIS (3nd Grading)
11 pages
Won't+Stop+Now +Chord+Chart+ +A
PDF
No ratings yet
Won't+Stop+Now +Chord+Chart+ +A
2 pages
29-Article Text-160-1-10-20221121
PDF
No ratings yet
29-Article Text-160-1-10-20221121
8 pages
A Web-Based Modeling Tool For The SEMAT Essence Theory of Software Engineering
PDF
No ratings yet
A Web-Based Modeling Tool For The SEMAT Essence Theory of Software Engineering
7 pages
TL-WN822N User Guide
PDF
No ratings yet
TL-WN822N User Guide
54 pages
Travel Plans American English Teacher
PDF
No ratings yet
Travel Plans American English Teacher
6 pages
BSC CS FY - 3 - Web Technology
PDF
No ratings yet
BSC CS FY - 3 - Web Technology
36 pages
A Detailed Lesson Plan in Science 3
PDF
No ratings yet
A Detailed Lesson Plan in Science 3
5 pages
(Xi Sci. Physics) (CH-2 QP)
PDF
No ratings yet
(Xi Sci. Physics) (CH-2 QP)
2 pages
Randi Ramlan - BA
PDF
No ratings yet
Randi Ramlan - BA
1 page
EM-1 Practice Questions For Mid Term Examination
PDF
No ratings yet
EM-1 Practice Questions For Mid Term Examination
3 pages
Action Verbs in Chinese
PDF
No ratings yet
Action Verbs in Chinese
1 page
Statistics for Spatio-Temporal Data
From Everand
Statistics for Spatio-Temporal Data
Noel Cressie
No ratings yet
Differential Forms
From Everand
Differential Forms
Henri Cartan
5/5 (2)