taylor series expansion with initial condition
조회 수: 2 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
채택된 답변
John D'Errico
2020년 1월 5일
편집: John D'Errico
2020년 1월 5일
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
John D'Errico
2020년 1월 5일
Yes, but you cannot do what you want.
syms x f(x) p g(x) a q h(x) r
f1 = taylor([f(x) g(x) h(x)],x,'order',[3 3 2]);
Error using sym/taylor (line 99)
The value of 'Order' is invalid. It must satisfy the function: isPositiveInteger.
The taylor function appears not to be vectorized in the sense that you can expand each term ot the vector of functions to a different order.
So this next is valid:
f1 = taylor([f(x) g(x) h(x)],x,'order',3);
And then you should be able to proceed further.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!