Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #11800 > unrolled thread

Re: How to solve the integrate problem

Started byAlexei Boulbitch <Alexei.Boulbitch@iee.lu>
First post2012-09-19 08:55 +0000
Last post2012-09-19 08:55 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: How to solve the integrate problem Alexei Boulbitch <Alexei.Boulbitch@iee.lu> - 2012-09-19 08:55 +0000

#11800 — Re: How to solve the integrate problem

FromAlexei Boulbitch <Alexei.Boulbitch@iee.lu>
Date2012-09-19 08:55 +0000
SubjectRe: How to solve the integrate problem
Message-ID<k3c1a6$eth$1@smc.vnet.net>
But that is exactly what I have written you. The answer is given by the function

Integrate[f[x], {x, 0, xmax}, Assumptions -> Q >= 0]

Take care: Mathematica is case-sensitive. According to what you have written in this message, all you parameters are positive, are they? If yes, you may include all of them into assumptions like the following:

Integrate[f[x], {x, 0, xmax}, Assumptions -> {Q >= 0. P>0,v>0, g>0,B>0}]

If you have some other relations (like inequalities) between parameters, include them also. This might help.
However, since you have a piecewise function, f,  the answer is also a piecewise function of the upper integration boundary,
xmax. The construct

Manipulate[
 Integrate[f[x], {x, 0, xmax}, Assumptions -> Q >= 0],
{xmax, 0, 2}]

allows you to dynamically check what happens when you vary xmax. For this you need first to fix numerical values of all parameters except x and xmax.
Check Menu/Help/Integrate and Menu/Help/Manipulate.

Have fun, Alexei

Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG

Office phone :  +352-2454-2566
Office fax:       +352-2454-3566
mobile phone:  +49 151 52 40 66 44

e-mail: alexei.boulbitch@iee.lu<mailto:alexei.boulbitch@iee.lu>


From: =1B$BD%EP6,=1B(B [mailto:toc531@gmail.com]
Sent: Tuesday, September 18, 2012 5:56 AM
To: Alexei Boulbitch
Subject: Re: How to solve the integrate problem

Thank you. I think I didn't make my question clear. I explain my question again.
Each unit purchased costs "v",each unit sold produces a revenue of "p",each unit disposed as salvage gives a revenue of "g",and there is an additional cost"B" associated with each unit of demand not satisfied. If a quantity "Q" a demand "x" occurs, the profit is

P(Q,x)=-Qv+px+g(Q-x)  if x<=Q
       -Qv+pQ-B(x-Q)  if x>=Q
The expected value of the profit, as a function of Q, is given by

E[P(Q)]=integrate[{P(Q,x)},{x,0,infinite}]

Question:I don't know how to use mathematica to solve E[P(Q)]

Thank you.





2012/9/17 Alexei Boulbitch <Alexei.Boulbitch@iee.lu<mailto:Alexei.Boulbitch@iee.lu>>
x>Q ,Q(P-W)-M(x-Q),  x belongs(Q,infinite)
x<=Q,P*x-W*Q+S(Q-x), x belongs(0,Q)

Q,P,W,M,S are unknown constant number.

I want to *dx*

THANK U
It is not very clear, what do you mean by "I want to *dx*". If you need
to integrate your expression, try this:

(* This is your function *)

f[x_] := If[x > Q, Q (P - W) - M (x - Q), P*x - W*Q + S (Q - x)]

(* Here it is drawn with arbitrarily selected values of its parameters to see, how it looks like *)

Plot[f[x] /. {Q -> 1, P -> 2, W -> 1, M -> 1.5, S -> 3}, {x, 0, 3}]

(* Here the integral is calculated. It is a piecewise function and its value depends upon the value of Q *)
(* as well as upon the value xmax *)

Manipulate[
 Integrate[f[x], {x, 0, xmax}, Assumptions -> Q >= 0], {xmax, 0, 2}]

If you want to calculate the derivative, consider this:

D[f[x], x]

If[x > Q, -M, P - S]

Have fun, Alexei


Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG

Office phone :  +352-2454-2566
Office fax:       +352-2454-3566
mobile phone:  +49 151 52 40 66 44

e-mail: alexei.boulbitch@iee.lu<mailto:alexei.boulbitch@iee.lu>

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web