查找现金预支费用的同等利率 +促销率
我从信用卡中预支“金额”现金,支付 预付费用(以百分比形式给出),促销费率为“int” 时间“len”。我每月必须至少支付所欠金额的“min”%。
我将“金额”存入投资账户,赚取“p”% 利息,并且 也从该帐户每月付款。
问题:对于什么值的“p”,在“len”时间后我会收支平衡?
以下是我在 Mathematica 中的设置方式:
DSolve[{
(* I start off owing amount plus the fee *)
owed[0] == amount*(1+fee),
(* The amount I owe increases due to credit card interest,
but decreases due to monthly payments *)
owed'[t] == int*owed[t]-min*12*owed[t],
(* I start off having amount *)
have[0] == amount,
(* The amount I have increases due to investment interest,
but decreases due to monthly payments *)
have'[t] == p*have[t]-min*12*owed[t],
(* After len, I want to break even *)
owed[len] == have[len]
},
{owed[t], have[t]}, {t}]
Mathematica 返回“DSolve::bvnul: 对于一般的某些分支 解,给定的边界条件导致空解”, 这实际上是合理的:只有一个“p”值可以 产生上述微分方程的解。
我如何强制 Mathematica 找到这个值?
我尝试求解owed[t],然后将owed[t] 替换为have[t], 然后求解owed[len] == have[len],但这会产生类似的结果 错误。在“owed[len] == have[len]”上运行Reduce会产生一些结果 复杂且丑陋。
I take a cash advance of 'amount' from my credit card, paying an
up-front 'fee' (given as a percentage), with a promotional rate 'int'
for time 'len'. I must pay at least 'min'% of the owed amount monthly.
I put 'amount' into an investment account earning 'p'% interest, and
also make the monthly payments from this account.
Question: for what value of 'p' will I break even after time 'len'?
Here's how I set it up in Mathematica:
DSolve[{
(* I start off owing amount plus the fee *)
owed[0] == amount*(1+fee),
(* The amount I owe increases due to credit card interest,
but decreases due to monthly payments *)
owed'[t] == int*owed[t]-min*12*owed[t],
(* I start off having amount *)
have[0] == amount,
(* The amount I have increases due to investment interest,
but decreases due to monthly payments *)
have'[t] == p*have[t]-min*12*owed[t],
(* After len, I want to break even *)
owed[len] == have[len]
},
{owed[t], have[t]}, {t}]
Mathematica returns "DSolve::bvnul: For some branches of the general
solution, the given boundary conditions lead to an empty solution",
which is actually reasonable: there's only one value of 'p' that will
yield a solution for the differential equations above.
How do I coerce Mathematica into finding this value?
I tried solving for owed[t], then substituting owed[t] into have[t],
and then solving owed[len] == have[len], but this yield a similar
error. Running Reduce on "owed[len] == have[len]" yielded something
complex and ugly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
方程:
如果int和min都是常数,则只是一个指数函数。初始条件
给出
这就是有[t]的解决方案
现在对于有[t]你可以使用:
这给你满足你的收支平衡条件的有[t]的表达式。
为了获得 p 的值,您必须使用最后一个方程:
或者,在将 has[0] 替换为它的值之后:
最后一个方程似乎不容易求解 p。我尝试了一些东西(当然不是太多),它的抵抗力很强。
但是......给定其余参数的数值可以通过任何数值方法轻松解决(我猜)
The equation:
if both int and min are constants, is just a exponential function. With the initial condition
gives
And that's the solution for owed[t]
Now for have[t] you may use:
That gives you the expression for have[t] that meets your break even condition.
For obtaining the value of p, you must use the last equation:
or, after replacing have[0] for it's value:
This last equation seems not easily solved for p. I tried a few things (not too much, certainly) and it resists strong.
But ... given numerical values for the rest of the parameters is trivially solved by any numerical method (I guess)