查找现金预支费用的同等利率 +促销率

发布于 2024-10-08 00:20:50 字数 1020 浏览 4 评论 0原文

我从信用卡中预支“金额”现金,支付 预付费用(以百分比形式给出),促销费率为“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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

静待花开 2024-10-15 00:20:50

方程:

owed'[t] == int owed[t]-min 12 owed[t] 

如果intmin都是常数,则只是一个指数函数。初始条件

owed[0] == amount*(1 + fee)  

给出

owed[t_] := amount E^((int - 12 min) t) (1 + fee)  

这就是有[t]的解决方案

现在对于有[t]你可以使用:

DSolve[{
  have'[t] == p*have[t] - min*12*owed[t],
  have[len] == owed[len]},
 {have[t]}, {t}]  

这给你满足你的收支平衡条件的有[t]的表达式。

为了获得 p 的值,您必须使用最后一个方程:

 have[0] == amount  

或者,在将 has[0] 替换为它的值之后:

(amount E^(-len p) (1 + fee) (12 E^(len p) min + 
   E^(len (int - 12 min)) (-int + p)))/(-int + 12 min + p) == amount 

最后一个方程似乎不容易求解 p。我尝试了一些东西(当然不是太多),它的抵抗力很强。

但是......给定其余参数的数值可以通过任何数值方法轻松解决(我猜)

The equation:

owed'[t] == int owed[t]-min 12 owed[t] 

if both int and min are constants, is just a exponential function. With the initial condition

owed[0] == amount*(1 + fee)  

gives

owed[t_] := amount E^((int - 12 min) t) (1 + fee)  

And that's the solution for owed[t]

Now for have[t] you may use:

DSolve[{
  have'[t] == p*have[t] - min*12*owed[t],
  have[len] == owed[len]},
 {have[t]}, {t}]  

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:

 have[0] == amount  

or, after replacing have[0] for it's value:

(amount E^(-len p) (1 + fee) (12 E^(len p) min + 
   E^(len (int - 12 min)) (-int + p)))/(-int + 12 min + p) == amount 

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)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文