Help for OOP project
5 posters
Page 1 of 1
Help for OOP project
আমার OOP course এর প্রজেক্ট এ আমি Integration করতে চাই । কিন্তু কিভাবে করব বুঝতে পারছি না।
সাহায্য চাই।
আমি চাই ব্যবহারকারী একটা ফাংশন ইনপুট দিবে এবং আমার project সেটাকে integration করে দেখাব।
সাহায্য চাই।
আমি চাই ব্যবহারকারী একটা ফাংশন ইনপুট দিবে এবং আমার project সেটাকে integration করে দেখাব।
Re: Help for OOP project
ভাইয়া, ফোরামে noticeboard টা ব্যবহার করা হয় শুধুমাত্র নোটিশ দিতে।
এধরণের অনুরোধের জন্য Programming and Brainstorm Chamber টাই একমাত্র যায়গা
যাই হোক, তুমি যা করতে চাও সেটা নিয়ে কিছু প্রশ্ন করি।
১) প্রোগ্রামিং ভাষা কি হবে?
২) ফাংশন বলতে কি বুঝানো হচ্ছে?
৩) ফাংশন ইনপুট কিভাবে দেয়া হবে?
৪) ফাংশন টা ব্যবহারকারী ইনপুট দিলে এর পরে কি সেটা অন্য কোথাও ব্যবহৃত হবে না যেখানে ইনপুট দেয়া হলো সেখানেই ঢুকানোর সাথে সাথে কাজ করা শুরু করবে?
এতগুলা বোকা বোকা প্রশ্ন করলাম কারণ তোমার মাথায় ঢুকার সাধ্য খালি তোমারই আছে। আরেকটু বিস্তারিত দিলে সবার জন্য তোমার সাথে আলোচনা করা, বা তুমি কি ভেবে এসব বললে তা বুঝা অনেক সহজ হবে।
এধরণের অনুরোধের জন্য Programming and Brainstorm Chamber টাই একমাত্র যায়গা
যাই হোক, তুমি যা করতে চাও সেটা নিয়ে কিছু প্রশ্ন করি।
১) প্রোগ্রামিং ভাষা কি হবে?
২) ফাংশন বলতে কি বুঝানো হচ্ছে?
৩) ফাংশন ইনপুট কিভাবে দেয়া হবে?
৪) ফাংশন টা ব্যবহারকারী ইনপুট দিলে এর পরে কি সেটা অন্য কোথাও ব্যবহৃত হবে না যেখানে ইনপুট দেয়া হলো সেখানেই ঢুকানোর সাথে সাথে কাজ করা শুরু করবে?
এতগুলা বোকা বোকা প্রশ্ন করলাম কারণ তোমার মাথায় ঢুকার সাধ্য খালি তোমারই আছে। আরেকটু বিস্তারিত দিলে সবার জন্য তোমার সাথে আলোচনা করা, বা তুমি কি ভেবে এসব বললে তা বুঝা অনেক সহজ হবে।
Re: Help for OOP project
১।JAVA
২।x,sinx,cosx,(cosx)^n,atanx etc.
৩।আমি GUI ব্যবহার করব।
৪।বুঝিনাই।
আমি চাচ্ছি ব্যবহারকারী একটা ফাংশন দিবে , আমার প্রগ্রাম সেটাকে নিয়ে কিছু কাজ করবে এবং ফাংশনটির Integration করে দেখাবে।
input: lnx,x^n
output: xlnx-x,(x^n+1)/n+1.
দুঃখিত এখানে পস্ট দেওয়ার জন্য।
২।x,sinx,cosx,(cosx)^n,atanx etc.
৩।আমি GUI ব্যবহার করব।
৪।বুঝিনাই।
আমি চাচ্ছি ব্যবহারকারী একটা ফাংশন দিবে , আমার প্রগ্রাম সেটাকে নিয়ে কিছু কাজ করবে এবং ফাংশনটির Integration করে দেখাবে।
input: lnx,x^n
output: xlnx-x,(x^n+1)/n+1.
দুঃখিত এখানে পস্ট দেওয়ার জন্য।
Re: Help for OOP project
ওহ আচ্ছা। আমি ভেবেছিলান Integration মানে component integration। সেক্ষেত্রে যেসব বুঝো নাই, সেগুলা বুঝার দরকার নাই।
তুমি যেটা করবে, সেটায় আসলে.. আমার মাথায় একগাদা if else ছাড়া কিচ্ছু আসছে না। মানে কিছু নির্দিষ্ট ধরণের ইনপুটের জন্য কিছু নির্দিষ্ট আউটপুট থাকবে। কম্পিউটার বেচারা তো আর বানায়ে কিছু করে না। :/
অবশ্য আমার মনে হয় অন্যরা আমার চাইতে বেশি ভালো ধারণা দিতে পারবে এই বিষয়ে। প্রোগ্রামারদের দৃষ্টি আকর্ষন করছি।
তুমি যেটা করবে, সেটায় আসলে.. আমার মাথায় একগাদা if else ছাড়া কিচ্ছু আসছে না। মানে কিছু নির্দিষ্ট ধরণের ইনপুটের জন্য কিছু নির্দিষ্ট আউটপুট থাকবে। কম্পিউটার বেচারা তো আর বানায়ে কিছু করে না। :/
অবশ্য আমার মনে হয় অন্যরা আমার চাইতে বেশি ভালো ধারণা দিতে পারবে এই বিষয়ে। প্রোগ্রামারদের দৃষ্টি আকর্ষন করছি।
Re: Help for OOP project
I would like to say that do some research on internet. There
are hundreds of resources available on Java Mathematics, Calculus, and whatever
you want. You will find thousands of java
applet and source code. Try those
applets and see how they works, read source code to know how they are written. Before replying this post, I googled on your
topic and found tons of information. It’s very important to know how to find
information from internet. So try.
And try to ask more specific question. And it’s better if
you do little research before asking question.
Try to write your question elaborately as much as possible. Don’t ask a vague question.
are hundreds of resources available on Java Mathematics, Calculus, and whatever
you want. You will find thousands of java
applet and source code. Try those
applets and see how they works, read source code to know how they are written. Before replying this post, I googled on your
topic and found tons of information. It’s very important to know how to find
information from internet. So try.
And try to ask more specific question. And it’s better if
you do little research before asking question.
Try to write your question elaborately as much as possible. Don’t ask a vague question.
Re: Help for OOP project
To be honest, this will be difficult. To do something like this, first you'll need a expression evaluator. That means, you'll have to be able to evaluate any complex mathematical expression(for example, 4x+3sin40).
To write an expression evaluator, you'll need to learn the following things:
1. Lexical Analyzer
2. Shunting-Yard Algorithm
3. Evaluating a postfix expression
Once you have your expression evaluator, you'll have to use a numerical method to find the integration.
For 1-D integrals, i recommend using Adaptive Quadrature. For M-D, use either Monte Carlo or quasi-Monte Carlo method or any of it's variants.
Once again, doing this won't be easy. You'll have to give it a lot of time and energy. Let me know if you need any more help.
To write an expression evaluator, you'll need to learn the following things:
1. Lexical Analyzer
2. Shunting-Yard Algorithm
3. Evaluating a postfix expression
Once you have your expression evaluator, you'll have to use a numerical method to find the integration.
For 1-D integrals, i recommend using Adaptive Quadrature. For M-D, use either Monte Carlo or quasi-Monte Carlo method or any of it's variants.
Once again, doing this won't be easy. You'll have to give it a lot of time and energy. Let me know if you need any more help.
BIT0130-Shakkhor- Programmer
- Course(s) :
- BIT
Blood Group : B+
Posts : 209
Points : 328
Re: Help for OOP project
Integration is simply a summation.
Suppose your function is:
Do it in following steps:
1. Take a very small value d (say .01) and sum = 0
2. Loop a double value p from -1 to 1, increment by d
3. add f(p) with sum in every loop.
This way is seriously time inefficient. But its possibly the simplest solution that will work for ALL functions.
Here is a sample code:
There are some efficient algorithms to integrate in the Numarical Analysis book. Ask a second year guy for the book.
Check this google result
Suppose your function is:
- Code:
f(x) = 2x
Do it in following steps:
1. Take a very small value d (say .01) and sum = 0
2. Loop a double value p from -1 to 1, increment by d
3. add f(p) with sum in every loop.
This way is seriously time inefficient. But its possibly the simplest solution that will work for ALL functions.
Here is a sample code:
- Code:
double integrate(double low, double up){
double sum = 0, d = .01;
for (double p = low; p <= up; p =d) {
sum = (f(p)*d);
}
return sum;
}
double f(double x){
return 2*x;
}
double f(double x){
return 2*x;
}
There are some efficient algorithms to integrate in the Numarical Analysis book. Ask a second year guy for the book.
Check this google result
Last edited by BIT0102-Mohaimin on Fri Mar 23, 2012 1:29 pm; edited 2 times in total (Reason for editing : Mistake fixed in the code.)
BIT0102-Mohaimin- Programmer
- Course(s) :
- BIT
Blood Group : B+
Posts : 415
Points : 715
Re: Help for OOP project
You can use ScriptEngine to evaluate simple expressions. Here is an example:
ScriptEngine classes are found in javax.script package.
Always read the javadoc to learn about the classes.
- Code:
ScriptEngine engine = new ScriptEngineManager().getEngineByExtension("js");
try {
double value = (Double) engine.eval("4 3*4");
System.out.println(value);
} catch (Exception e) {
e.printStackTrace();
}
ScriptEngine classes are found in javax.script package.
Always read the javadoc to learn about the classes.
BIT0102-Mohaimin- Programmer
- Course(s) :
- BIT
Blood Group : B+
Posts : 415
Points : 715
Re: Help for OOP project
All the vias thanks a lot. I am working with your suggestions and my ideas. And i will try my best.
Re: Help for OOP project
Mohaimin,
I don’t think it’s a good idea to use ScriptEngine right
now. Let him to write his own parser. May be it will be buggy, something worse,
but he will learn by that way.
I don’t think it’s a good idea to use ScriptEngine right
now. Let him to write his own parser. May be it will be buggy, something worse,
but he will learn by that way.
Re: Help for OOP project
Problem is, he(Moshiur) mentioned function integration, and examples included symbols, not values.
Maybe Moshiur should clarify this part.
Maybe Moshiur should clarify this part.
Re: Help for OOP project
There was a big mistake in my code. I have corrected it.
From
From
- Code:
sum = f(p);
- Code:
sum = (f(p)*d);
BIT0102-Mohaimin- Programmer
- Course(s) :
- BIT
Blood Group : B+
Posts : 415
Points : 715
Re: Help for OOP project
I think (To Amit vaia) if i can find indefinite integration of a function then i can easily evaluate this function in any range.
Re: Help for OOP project
BIT0330-MOSHIUR wrote:I think (To Amit vaia) if i can find indefinite integration of a function then i can easily evaluate this function in any range.
In software engineering, specified requirement is everything.
If you only wanted indefinite integration, the approach can be of one type.
If you wanted evaluation, the approach will be different.
If you want both, the approach will be even more different.
And none of the approaches are of same difficulty level, nor do they need same level of work.
So, when you ask something, specify it clearly
Re: Help for OOP project
Congratulations, kid. You've just reached the boundary where humans and computers are separated. Computers can't find indefinite integrals, that's something only humans can do. Indefinite integrals have an unlimited number of solutions. Only a human can decide which one is the simplest. Sure, you can plug rule after rule, and more rules after that to find some sort of simple form, but that chances are very slim.
See, the difference between humans and computers is, humans can solve problems. But computers, can only execute your solutions.
I suggest you take Mohaimin's advice and use the simple summation technique to find definite integrals. Adaptive Quadrature isn't very hard either (5-6 lines algorithm). You'll be needing a custom expression evaluator though, ScriptEngine probably won't work.
See, the difference between humans and computers is, humans can solve problems. But computers, can only execute your solutions.
I suggest you take Mohaimin's advice and use the simple summation technique to find definite integrals. Adaptive Quadrature isn't very hard either (5-6 lines algorithm). You'll be needing a custom expression evaluator though, ScriptEngine probably won't work.
BIT0130-Shakkhor- Programmer
- Course(s) :
- BIT
Blood Group : B+
Posts : 209
Points : 328
Re: Help for OOP project
BIT0130-Shakkhor wrote:Congratulations, kid. You've just reached the boundary where humans and computers are separated. You can't find indefinite integrals, that's something only humans can do. Indefinite integrals have an unlimited number of solutions. Only a human can decide which one is the simplest. Sure, you can plug rule after rule, and more rules after that to find some sort of simple form, but that chances are very slim.
See, the difference between humans and computers is, humans can solve problems. But computers, can only execute your solutions.
That's why I said I can only think about a lot of if-else when I thought he wanted only indefinite integrals.
Like++ for explaining it in a lot more easier way.
Similar topics
» Project ideas for software project lab I & II
» About Java project
» Project Workflow
» Anyone to help on project report????
» Project Cartoon
» About Java project
» Project Workflow
» Anyone to help on project report????
» Project Cartoon
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|
Tue Sep 29, 2015 2:45 pm by Sophiawood
» Cisco EHWIC SFP/GE WAN Card
Mon Sep 07, 2015 11:08 am by Sophiawood
» Huawei S1700-28GFR-4P-AC Price
Thu Jun 25, 2015 2:31 pm by Sophiawood
» teach yourself C++ / Herbert Schildt Solutions
Wed Jun 03, 2015 1:52 pm by Abdullah Al Noman
» teach yourself c by herbert schildt pdf
Wed May 13, 2015 11:01 pm by Raquib Ridwan
» ASA 5506X With Firepower ASA5506-K9
Fri Apr 10, 2015 4:31 pm by Sophiawood
» New Trends in Deal Business
Tue Feb 03, 2015 9:38 pm by nersoa
» PoE Power Allocation for WS-C2960S-24PS-L
Wed Nov 05, 2014 11:12 am by Sophiawood
» How to cure back pain
Fri Oct 31, 2014 7:15 pm by Bergen Guildford