필터 지우기
필터 지우기

I dont know how to integrate a function with variables depending on time

조회 수: 3 (최근 30일)
I have a function
syms theta(t)
fmov(t) = (2943*sin(theta(t)))/200 - (27*sin(2*theta(t))*diff(theta(t), t)^2)/4 + (3*(9*cos(theta(t))^2 + 2)*diff(theta(t), t, t))/2
fmov(t) = 
Which I want to integrate twice respect to time in order to obtain a function with just theta(t) and t as variables.
And I only have the min and max values of theta(t). It is an angle and range is from 60º until 0º.
I dont know what the final time will be and starting time is 0.
Can anyone help me?
  댓글 수: 3
Torsten
Torsten 2024년 1월 26일
편집: Torsten 2024년 1월 26일
I have a function
fmov(t) =
(2943*sin(theta(t)))/200 - (27*sin(2*theta(t))*diff(theta(t), t)^2)/4 + (3*(9*cos(theta(t))^2 + 2)*diff(theta(t), t, t))/2
fmov(t) is a given function of t and it equals the expression
(2943*sin(theta(t)))/200 - (27*sin(2*theta(t))*diff(theta(t), t)^2)/4 + (3*(9*cos(theta(t))^2 + 2)*diff(theta(t), t, t))/2
, so e.g.
sin(t) = (2943*sin(theta(t)))/200 - (27*sin(2*theta(t))*diff(theta(t), t)^2)/4 + (3*(9*cos(theta(t))^2 + 2)*diff(theta(t), t, t))/2
for fmov(t) = sin(t) ?
?
John D'Errico
John D'Errico 2024년 1월 26일
This is a second order nonlinear differential equation, where theta(t) is the unknown function. You generally can't just integrate it twice. Instead, this is why entire courses and sequences of courses are taught about how to solve differential equations. Since the ODE is not at all in a standard form, I have a funny feeling there will be no analytical solution. And that means only a numerical solution is probably an option. Since it is second order, you will need two initial values or a pair of boundary values. Regardless, two pieces of information will need to be provided by you. Tools like ODE45 or a bvp solver will be necessary.

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

채택된 답변

Sam Chak
Sam Chak 2024년 1월 26일
You can utilize the odeToVectorField() function to convert the 2nd-order differential equations to a system of 1st-order differential equations. Once you have the 1st-order form, you can then apply the ode45() solver to solve the problem.
syms theta(t)
myODE = (2943*sin(theta))/200 - (27*sin(2*theta)*diff(theta, t)^2)/4 + (3*(9*cos(theta)^2 + 2)*diff(theta, t, t))/2 == 0;
[V, S] = odeToVectorField(myODE)
V = 
S = 
M = matlabFunction(V, 'vars', {'t', 'Y'})
M = function_handle with value:
@(t,Y)[Y(2);((sin(Y(1)).*1.09e+2-sin(Y(1).*2.0).*Y(2).^2.*5.0e+1).*(-9.0./1.0e+2))./(cos(Y(1)).^2.*9.0+2.0)]
tspan = [0 30];
Y0 = [3*pi/4 0];
sol = ode45(M, tspan, Y0);
fplot(@(t) deval(sol, t, 1), tspan), grid on
xlabel('t'), ylabel('\theta(t)')

추가 답변 (0개)

카테고리

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

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by