动力学方程问题 [英] Dynamic equation Problems

查看:104
本文介绍了动力学方程问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

iam为我的客户提出一份涵盖与银行交易的申请书
例如贷款,分期付款及其他内容
我在每期文章中都有一个问题,他们有不同的数学方程式
例如,有些时候他们每月付款一次
其他他们先付款然后每月付款等等
所以我需要做的只是1列,我需要在其中添加方程式,然后工作取决于它
以这个为例
我的客户贷款1000000(贷款条件)
1- 100000必须存入帐户
所以我必须知道我有900000可以处理
2-他必须每月有50000,直到他最终获得​​贷款
同一笔贷款中的那两个条件
所以我如何将其保存在数据库中并稍后了解
&第二如何让我的客户写这些方程式

感谢您的帮助
关于问候

iam making an application for my customer that cover his dealing with banks
like loan & installments & other things
i have probelm with each installment they have different math equation
for example some time they pay monthly
other they pay part in the first then monthly payment etc
so what i need to do is just 1 column that i need to add equation in it then work depend on it
take this for example
my customer take loan 1000000 (loan codition)
1- 100000 must be deposit in the account
so i must know that i have 900000 to work on it
2-he must be 50000 monthly untill he finsih loan
those 2 conditon in the same loan
so how i save this in my database & understand it later
& second how to let my client write those equation

thanks for any help
with regards

推荐答案

似乎您有2个选择开始逻辑流程.

1.)使用某种枚举类型,并允许用户通过CombBox单选按钮进行选择,然后单击按钮.询问您的用户他们想要什么.根据选择,您可以设置枚举供以后使用

Seems you have 2 options to start your logic flow.

1.) Use some enum type and allow the user to select via CombBox radio button, button click. Ask your users what they want. Depending on the selection you set the enum for later use

public enum CalculationType : int
{
    LargeDeposit = 1,
    SmallDeposit = 2
}


注意:我被设为int类型的枚举.这将使您能够将类型转移到后端并从中注销. (SQL不在乎对象类型,仅在乎具体数据).


2.)使用对象类型和接口.


Note: I am made the enum of int type. This will alow you to transfer the type to the backend and key off of it. (SQL does not care about object types, only concrete data).


2.) Use object types and interfaces.

public interface IAccount
{
   IResult Calculate();
}

public class LargeDepositAccount : IAccount
{
   public IResult Calculate()
   {
        //Access the appropriate back end data and calaulate
        // or access the apprpriate SPROC and return the calculation
   }
}

public class SmallDepositAccount : IAccount
{
    public IResult Calculate()
   {
        //Access the appropriate back end data and calaulate
        // or access the apprpriate SPROC and return the calculation
   }

}



如果您的客户需要定期更改实际公式,则需要与他们一起探讨他们如何建立论坛.我看到过围绕将配置文件解析为公式而构建的库,或者您对某些注释的建议是允许它们将其存储在Excel中.
您确实必须与该客户一起工作.他们想如何更新公式以及他们对系统的了解程度如何.

这是一篇包含方程式解析器的文章
带有图形的方程式计算器 [用于从Excel快速通过/检索数据的组件 [ MEF [ 这实际上取决于您的客户对他们如何与系统交互的期望.

祝您好运:)



If your client needs to change the actual formulas regularily you will need to work with them on how they want to build the forumula. I have seen libraries built around parsing config files into formulas or as some comments to you have suggested allow them to store it in Excel.
You really have to work with the client on that one. How to they want to update the formulas and what level of the system understanding do they have.

Here is an article that has an equation parser included
Equation Calculator with Graphing[^]

Here is an article on talking to excel
Component for Fast Pass/Retrieve Data from Excel[^]

Note: I am sure there are many other articles on doing the same (maybe even better). I just did a quick CP search and thats what came up. Again, you really need to ask your client how they want to input the formulas. If they are hoping you come up with a suggestion they give them a few options and ask them which they would prefer.

On the other hand, if your client is adding formulas then you could use injection. Take a look at MEF[^] and follow option 2. This will allow your client to build new "AccountTypes" and inject them into your system with out touching any base code.
It really depends on your clients expection of how they interact with the system.

Good luck:)


您需要做的第一件事就是使问题形式化.

我的意思是理解一般情况并使用一些严谨的语言来描述它;可以是英语,并且可以毫无歧义地使用,可以是数学公式,可以是一组可供选择的允许概括的示例.

您当前的问题陈述无法被利用.

根据您的发言,我可以猜测您保持了帐户余额并考虑了变动.这些可以是一次性的,也可以是定期的.在这种情况下,可以通过提供变动的日期,金额和期间(即数字列表)来描述帐户的整个历史记录.

月0,-1000000,一次
第1个月,+ 100000,一次
第2个月,+ 50000,每月18次

转换为三个记录:
The first thing you need to do is to formalize the problem.

I mean understand the general case and describe it using some rigourous language; can be English used in a non-ambiguous way, can be mathematical formulas, can be a well chosen set of examples that allow generalization.

You current problem statement cannot be exploited.

From what you say, I can guess that you maintain an account balance, and consider movements. These can be one-time or periodic. If this is the case, the whole history of an account could be described by providing the dates, amounts and periods of the movements, i.e. a list of numbers.

Month 0, - 1000000, once
Month 1, + 100000, once
Month 2, + 50000, 18 times, monthly

Translates to three records:
0, -1000000,  1, 0<br />
1,  +100000,  1, 0<br />
2,   +50000, 18, 1


这篇关于动力学方程问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆