How to model an equation?

조회 수: 3 (최근 30일)
Danny Maefengea
Danny Maefengea 2020년 9월 11일
댓글: Danny Maefengea 2020년 9월 11일
Hi there, I have been trying to think of how to model the problem bellow in MATLAB but I couldn't. Can anybody help here please?
Thank you very much for your help.
A ball starts falling down through dense liquid. Its velocity (in cm/s) is given by the equation: dv/dt = 1.6 − 0.025v^2 .
If v(0) = 0cm/s, show that it will take approximately 6.77s for the ball to reach a velocity of 7.0cm
If the container is 1 meter deep, determine, the time the ball has reached the bottom.
  댓글 수: 1
Alan Stevens
Alan Stevens 2020년 9월 11일
Type help ode45 in the Matlab workspace.

댓글을 달려면 로그인하십시오.

채택된 답변

BOB MATHEW SYJI
BOB MATHEW SYJI 2020년 9월 11일
I think this should work. When you give time t1 for which the velocity you want, and the depth of the container as input, the function returns the velocity at time t1 and the time taken to hit the bottom as the output
function [velocity, time]= diff_eqn(t1,depth)
%Inputs given are time and depth of container
%function returns the velocity at time t1 and
%time taken to hit the bottom of container
syms y(t)
ode = diff(y)+0.025*y^2==1.6;
cond=y(0)==0;
ySol(t)=dsolve(ode,cond);
velocity=double(ySol(t1))
time=depth/velocity
end
  댓글 수: 1
Danny Maefengea
Danny Maefengea 2020년 9월 11일
Thank you so much Bob for your help. I really appreciate it. Now I have some fair ideas on how to work on the problem.
Once again thank you.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by