hello. I want to plot some graph that ode(ordinary differential equation)'s solution(I will make this solution to polynomial from exponential with Taylor Series) . How can I plot that? How can I code it?
y''-5y'+4y = 0

답변 (1개)

Torsten
Torsten 2022년 5월 25일
편집: Torsten 2022년 5월 25일

0 개 추천

The general solution is
y(t) = C1*exp(4*t) + C2*exp(t)
for arbitrary constants C1 and C2.
Look up "dsolve" and the examples provided under

댓글 수: 9

Yeachan Choi
Yeachan Choi 2022년 5월 26일
hey, Thx But I should take this solution to polynomial eqn from exp with Taylor series... How can I do that???
Torsten
Torsten 2022년 5월 26일
Not clear. Include your precise assignment question.
Yeachan Choi
Yeachan Choi 2022년 5월 26일
I mean, I will ploting (y''-5y'+4y = 0)'s solution, y(t) = C1*exp(4*t) + C2*exp(t). But I want to make this for polynomial equation. (I will use Taylor Series.)
Torsten
Torsten 2022년 5월 26일
I don't understand
But I want to make this for polynomial equation. (I will use Taylor Series.)
Can you give an example ?
Yeachan Choi
Yeachan Choi 2022년 5월 26일
your solution is exponential function right? But I want to make your solution to be a polynomial function, so I will use Taylor Series in matlab
Torsten
Torsten 2022년 5월 26일
편집: Torsten 2022년 5월 26일
So you want to make the ansatz
y(t) = sum_{i=0}^{i=oo} a_i * t^i
and determine the coefficients a_i ?
Yeachan Choi
Yeachan Choi 2022년 5월 26일
I will give C1 C2 and the other coefficients as a randi(). So I need the code for Taylor series.
Torsten
Torsten 2022년 5월 26일
편집: Torsten 2022년 5월 26일
I give up.
All solutions to the equation
y''-5y'+4y = 0
are given by
y(t) = C1*exp(4*t) + C2*exp(t)
for constants C1 and C2.
There are no polynomial solutions, except for the case that C1 = C2 = 0.
So I can't understand what you mean "you want to make the solution a polynomial function".
Of course, you can do
syms C1 C2 t
f = C1*exp(4*t) + C2*exp(t);
taylor(f,t,'Order',8)
but why ?
Yeachan Choi
Yeachan Choi 2022년 5월 26일
haha But Thank you.

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

카테고리

태그

질문:

2022년 5월 25일

편집:

2022년 5월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by