Placement 2025 Scholarship: Your Future Starts Here | 6 Guaranteed Job Interviews | Limited to 100 seats. Apply Now

01D 00H 31M 19S

Menu

Executive Programs

Workshops

Projects

Blogs

Careers

Placements

Student Reviews


For Business


More

Academic Training

Informative Articles

Find Jobs

We are Hiring!


All Courses

Choose a category

Mechanical

Electrical

Civil

Computer Science

Electronics

Offline Program

All Courses

All Courses

logo

CHOOSE A CATEGORY

Mechanical

Electrical

Civil

Computer Science

Electronics

Offline Program

Top Job Leading Courses

Automotive

CFD

FEA

Design

MBD

Med Tech

Courses by Software

Design

Solver

Automation

Vehicle Dynamics

CFD Solver

Preprocessor

Courses by Semester

First Year

Second Year

Third Year

Fourth Year

Courses by Domain

Automotive

CFD

Design

FEA

Tool-focused Courses

Design

Solver

Automation

Preprocessor

CFD Solver

Vehicle Dynamics

Machine learning

Machine Learning and AI

POPULAR COURSES

coursePost Graduate Program in Hybrid Electric Vehicle Design and Analysis
coursePost Graduate Program in Computational Fluid Dynamics
coursePost Graduate Program in CAD
coursePost Graduate Program in CAE
coursePost Graduate Program in Manufacturing Design
coursePost Graduate Program in Computational Design and Pre-processing
coursePost Graduate Program in Complete Passenger Car Design & Product Development
Executive Programs
Workshops
For Business

Success Stories

Placements

Student Reviews

More

Projects

Blogs

Academic Training

Find Jobs

Informative Articles

We're Hiring!

phone+91 9342691281Log in
  1. Home/
  2. Syed Saquib/
  3. Week 3 - Solving second order ODEs

Week 3 - Solving second order ODEs

Aim-To solve second order ordinary differential equation using matlab Objectives- To solve the second order ODE with graph of velocity v/s displacement Data- L= 1 meter t=0 M=1 kg b=0.05 g=9.81 m/s^2   Program- 1. code function of ODE45 for main program-   function[dtheta_dt]=ode_func(t,theta,b,g,l,m)…

    • Syed Saquib

      updated on 23 Apr 2022

    Aim-To solve second order ordinary differential equation using matlab

    Objectives- To solve the second order ODE with graph of velocity v/s displacement

    Data- L= 1 meter

    t=0

    M=1 kg

    b=0.05

    g=9.81 m/s^2

     

    Program-

    1. code function of ODE45 for main program-

     

    function[dtheta_dt]=ode_func(t,theta,b,g,l,m)
    theta1=theta(1)
    theta2=theta(2)
    dtheta1_dt=theta2;
    dtheta2_dt=-(b/m)*theta2-(g/l)*sin(theta1);
    dtheta_dt=[dtheta1_dt;dtheta2_dt];
    end
     
     
     
     
     
    2. Main program-
     
     
    clear all
    close all
    clc
    b=0.05;
    g=9.81;
    l=1;
    m=0.1
    %initial condition
    theta_0=[0;5];
    %time points
    t_span=linspace(0,20,500);
    % to solve ode
    [t,results]=ode45(@(t,theta)ode_func(t,theta,b,g,l,m),t_span,theta_0);
    plot(t,results(:,1))
    hold on
    plot(t,results(:,2))
    ylabel('time')
    xlabel('velocity')
    legend('Displacement','Anglular velocity')
    grid on
    hold off
    displacement=results(:,1);
    velocity=results(:,2);
    %fixed coordinates
    x0=0;
    y0=0;
    ct=1;
    for i = 1:length(displacement)
    %coordinates
    x1=1*sin(displacement(i));
    y1=-1*cos(displacement(i));
    figure(2)
    %plotfixed link
    plot([-2 2],[0 0],'linewidth',15,'color','b')
    hold on
    plot([x0 x1],[y0 y1],'linewidth',4)
    plot(x1,y1,'-o','markersize',20,'markerfacecolor','b')
    %axisetting
    axis([-2 2 -2 2])
    % to chnage the frame movie
    M(ct)=getframe(gcf);
    ct=ct+1;
    hold off
    end
    movie(M)
    videofile=VideoWriter('simple pendulum.avi','Uncompressed AVI');
    open(videofile)
    writeVideo(videofile,M)
    close(videofile)
     
     
    Results-
     
     
    Postion of the setup-
     
     
     
    Animation-
     
    https://youtu.be/Rmw6D85LJlg
     
     

    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.

    Please  login to add a comment

    Other comments...

    No comments yet!
    Be the first to add a comment

    Read more Projects by Syed Saquib (43)

    Week - 4 - 2D meshing for Plastic components

    Objective:

    calendar

    14 Feb 2024 04:24 PM IST

      Read more

      Week 3 - 2D meshing for Sheet metal

      Objective:

       

      calendar

      14 Feb 2024 04:10 PM IST

        Read more

        Project

        Objective:

        AIM: To carry out a system-level simulation of an All-Terrain Vehicle (ATV). OBJECTIVES : To carry out a Simulation of ATV. To prepare a technical report explaining the model properties & comments on the results.   THEORY : All-Terrain Vehicle (ATV) An All-Terrain Vehicle (ATV), also known as a light utility…

        calendar

        03 Jan 2024 10:45 AM IST

        • HTML
        Read more

        Project 1

        Objective:

          Aim : Develop a double-acting actuator model using Simscape Multibody and Simscape components.   Objective : The mechanical system of the cylinder needs to be built using Simscape Multibody library components/blocks, and the hydraulic system needs to be modeled using Simscape library physical components. Theory : The…

        calendar

        16 Oct 2023 03:59 PM IST

        • HTML
        Read more

        Schedule a counselling session

        Please enter your name
        Please enter a valid email
        Please enter a valid number

        Related Courses

        coursecard

        Design loads considered on bridges

        Recently launched

        10 Hours of Content

        coursecard

        Design of Steel Superstructure in Bridges

        Recently launched

        16 Hours of Content

        coursecard

        Design for Manufacturability (DFM)

        Recently launched

        11 Hours of Content

        coursecard

        CATIA for Medical Product Design

        Recently launched

        5 Hours of Content

        coursecardcoursetype

        Accelerated Career Program in Embedded Systems (On-Campus) Courseware Partner: IT-ITes SSC nasscom

        Recently launched

        0 Hours of Content

        Schedule a counselling session

        Please enter your name
        Please enter a valid email
        Please enter a valid number

        logo

        Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.

        https://d27yxarlh48w6q.cloudfront.net/web/v1/images/facebook.svghttps://d27yxarlh48w6q.cloudfront.net/web/v1/images/insta.svghttps://d27yxarlh48w6q.cloudfront.net/web/v1/images/twitter.svghttps://d27yxarlh48w6q.cloudfront.net/web/v1/images/youtube.svghttps://d27yxarlh48w6q.cloudfront.net/web/v1/images/linkedin.svg

        Our Company

        News & EventsBlogCareersGrievance RedressalSkill-Lync ReviewsTermsPrivacy PolicyBecome an Affiliate
        map
        EpowerX Learning Technologies Pvt Ltd.
        4th Floor, BLOCK-B, Velachery - Tambaram Main Rd, Ram Nagar South, Madipakkam, Chennai, Tamil Nadu 600042.
        mail
        info@skill-lync.com
        mail
        ITgrievance@skill-lync.com

        Top Individual Courses

        Computational Combustion Using Python and CanteraIntroduction to Physical Modeling using SimscapeIntroduction to Structural Analysis using ANSYS WorkbenchIntroduction to Structural Analysis using ANSYS Workbench

        Top PG Programs

        Post Graduate Program in Hybrid Electric Vehicle Design and AnalysisPost Graduate Program in Computational Fluid DynamicsPost Graduate Program in CADPost Graduate Program in Electric Vehicle Design & Development

        Skill-Lync Plus

        Executive Program in Electric Vehicle Embedded SoftwareExecutive Program in Electric Vehicle DesignExecutive Program in Cybersecurity

        Trending Blogs

        Heat Transfer Principles in Energy-Efficient Refrigerators and Air Conditioners Advanced Modeling and Result Visualization in Simscape Exploring Simulink and Library Browser in Simscape Advanced Simulink Tools and Libraries in SimscapeExploring Simulink Basics in Simscape

        © 2025 Skill-Lync Inc. All Rights Reserved.

                    Do You Want To Showcase Your Technical Skills?
                    Sign-Up for our projects.