# taylor series expansion with initial condition

조회 수: 7(최근 30일)
MINATI 4 Jan 2020
댓글: MINATI 5 Jan 2020
syms x f(x) p
f1=taylor(f(x),x,'order',3)
(D(D(f))(0)=p; D(f)(0)=1; f(0)=0;
%%% I want to put initial conditios (D(D(f))(0)=p; D(f)(0)=1; f(0)=0; in f1 to
find f1=x+p*x^2/2 in symbolic form. Guide me please

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

### 채택된 답변

John D'Errico 5 Jan 2020
편집: John D'Errico 5 Jan 2020
Why not try it! ??? Make an effort. For example, this seems the obvious thing to try. So what does this do?
syms x f(x) p
f1=taylor(f(x),x,'order',3)
f1 =
(D(D(f))(0)*x^2)/2 + D(f)(0)*x + f(0)
subs(f1,f(0),0)
ans =
(D(D(f))(0)*x^2)/2 + D(f)(0)*x
Can you finish the next two steps on your own?
##### 댓글 수: 5표시숨기기 이전 댓글 수: 4
MINATI 5 Jan 2020
Now everything is OK
but can it be possible to bring
[ f(1) g(1) h(1) ] = [ x+p*x^2/2 a*x+q*x^2/2 1+r*x]
as I have to incorporate this in another code

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

### Community Treasure Hunt

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

Start Hunting!

Translated by