How to find an explicit function when using Runge-Kutta or one of the pertinent codes in Matlab (ode45)

1 view (last 30 days)
Dear scholars,
I have a question which is almost trivial, but I like to make a shot for this;
I need an explicit answer function. On the other hand, Runge-Kutta, DQM, any other numerical methods or even the available codes like ode23, 45; all give us the numerical values of the pertinent function. But, I need explicit function in temporal domain, since I need to take derivative and apply other algebraic operations for further findings and survey.
Any ideas?

Answers (1)

James Tursa
James Tursa on 6 Apr 2020
Edited: James Tursa on 6 Apr 2020
  3 Comments
Alireza Babaei
Alireza Babaei on 7 Apr 2020
Edited: Alireza Babaei on 7 Apr 2020
James,
Here is the code I have tried including the nonlinear equation, I have
clc
clear all
close all
syms t y(t)
c = 7.5;
m = 25;
k = 10;
IC1 = 0;
IC2 = 2;
eq = diff(y(t),t,2) + (c/m) * diff(y,t,1) + (k/m) * y + 0.0065*y(t)^3
%dsolve(eq == 0, y(0) == 0, subs(diff(y),t,0) == 1)
an1 = dsolve(eq == 0, [y(0) == IC1, subs(diff(y),t,0) == IC2])
ezplot(an1)
grid on

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!