All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
OBJECTIVE: In this project, the first order derivative is discretized to obtain the desired order of accuracy. It is then discretized with forward differencing scheme to compare the results. Formula for the fourth order approximation of the first derivative: THE MATLAB CODE: close all clear all clc %Given function sin(x)/x^3;…
Jerrold C William
updated on 05 Jun 2019
OBJECTIVE:
In this project, the first order derivative is discretized to obtain the desired order of accuracy. It is then discretized with forward differencing scheme to compare the results.
Formula for the fourth order approximation of the first derivative:
THE MATLAB CODE:
close all
clear all
clc
%Given function sin(x)/x^3;
%Derivative of Given function ((x^3*cos(x))-(sin(x)*3x^2))/x^6;
%Let x= pi/3;
x = pi/3;
analytical_derivative_solution = (((x^3)*cos(x))-(sin(x)*3*(x^2)))/(x^6);
function out =sin_x(x)
out=sin(x)/x^3;
end
%Forward_difference= (f(x+dx)-f(x))/dx
%central_differenc(Or second order)=(f(x+dx)-f(x-dx))/2dx
%fourth_order_differencing =(f(x-(2*dx)))-(8*f(x-dx))+(8*f(x+dx))-(f(x+(2*dx)))/(12*dx)
dx=pi/400000;
Forward_difference = (sin_x(x+dx)-sin_x(x))/dx;
Central_diffrence = (sin_x(x+dx)-sin_x(x-dx))/(2*dx);
Fourth_order_difference = ((sin_x(x-(2*dx)))-(8*sin_x(x-dx))+(8*sin_x(x+dx))-(sin_x(x+(2*dx))))/(12*dx);
%error
first_order_error = abs(Forward_difference - analytical_derivative_solution)
second_order_error = abs(Central_diffrence - analytical_derivative_solution)
fourth_order_error = abs(Fourth_order_difference - analytical_derivative_solution)
y = [first_order_error ,second_order_error ,fourth_order_error];
%2D bar graph
bar(y,0.4);
title('Comparison of first,second and fourth order approximations');
xlabel('Approximation');
RESULTS:
THE FOLLOWING GRAPH WAS OBTAINED;
Leave a comment
Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.
Other comments...
SHELL MESHING OF AN INTERIOR PANEL SUBSTRATE FOR FINITE ELEMENT ANALYSIS
SHELL MESHING OF A INTERIOR PANEL SUBSTRATE FOR FINITE ELEMENT ANALYSIS OBJECTIVE: Structural mesh is oftained for the complex interior panel plastics of a car for finite element analysis, by extracting mid surfaces with thickness elements using manual and auto generated methods. ABSTRACT & PRE-REQUISITES:…
26 Jul 2019 05:13 AM IST
MESHING A BONNET FOR STRUCTURAL ANALYSIS USING ANSA
MESHING A BONNET FOR STRUCTURAL ANALYSIS USING ANSA OBJECTIVE: The given CAD of a car bonnet is to be meshed for structural analysis with the required mesh parameters. ABSTRACT: To work with thin-walled solids, using a midsurface shell model can reduce the degrees of freedom in your model by factors of ten…
16 Jul 2019 06:51 AM IST
SURFACE WRAP OF AN ENGINE ASSEMBLY
SURFACE WRAP OF AN ENGINE ASSEMBLY OBJECTIVE: To extract a surface wrap of a CAD model, thereby eliminating the control volumes from which the 3D structure of meshed elements have been obtained. PROJECT WALKTHROUGH: Firstly, the topology of the CAD has to be taken care of, in order to eliminate any possibility of…
28 Jun 2019 08:28 AM IST
SURFACE MESHING OF A BMW M6
OBJECTIVE: The given CAD model of BMW M6 is to be eliminated from it\'s topological errors & render surface mesh, expel the errors occuring during the wholesome process. PREREQUISITES: CAD CLEAN UP & ITS USES: Meshing for FEA and CFD is simple: Just start with your CAD model, break it up into a bunch of small pieces,…
06 Jun 2019 11:58 AM IST
Related Courses
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.