フィルターのクリア

Definite Integral with symbolic upper and lower limits and a constant

11 ビュー (過去 30 日間)
Alexandros
Alexandros 2017 年 9 月 15 日
コメント済み: Star Strider 2017 年 9 月 16 日
Hi! I have the following integration: on both sides is -1/k*int(1/v)dv=int(1ds) where int is the symbol of integration The limits for left integral is from v0 to v The limits for right integral is from 0 to s
I have tried the following in code:
>> g=inline('(1/-k)*(1/v)')
g =
Inline function:
g(k,v) = (1/-k)*(1/v)
>> int(g(v))
Error using inline/subsref (line 12)
Not enough inputs to inline function.
Also I have tried this:
>> syms k
>> g=inline('(1/-k)*(1/v)')
g =
Inline function:
g(k,v) = (1/-k)*(1/v)
>> int(g(k,v))
ans =
-log(v)/k
Is there a way to take into account the v0 to v integration limits? The result should be: -1/k*(log(v)-log(v0))
Also k is a constant.
This is a Dynamics Mechanics sample problem by Meriam & Kraige

採用された回答

Star Strider
Star Strider 2017 年 9 月 15 日
Try this:
syms k v v0
assume(v > 0)
assume(v0 > 0)
g(k,v) = (1/-k)*(1/v); % Symbolic Function
Ig = int(g(k,v), v, v0, v)
Result:
Ig =
-(log(v) - log(v0))/k
You can define symbolic functions in R2012a and later.
  9 件のコメント
Alexandros
Alexandros 2017 年 9 月 16 日
Hi. I get a four decimal place accuracy. Is there a way to get what you got for k?
Star Strider
Star Strider 2017 年 9 月 16 日
Yes.
format long g
k = fzero(@(k) 1.1*k-log(1+k*8*(10/60)), 1)
See the documentation on the format (link) function for details.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by