Skip to main content
added 4 characters in body
Source Link
Meva
  • 223
  • 2
  • 8

I need to put a condition for b inside p01, p02 definitions or just state this condition at the beginning of my problem.

p01[x_] := 2*h[2]/κ*Log[xκ*Log[(x - b)/(-b)] + θ[2]/κ*x + 1/2;
p02[x_] := 2*h[2]/κ*Log[xκ*Log[(x - b)/(1 - b)] + θ[2]/κ*(x - 1); 
forh2[x_] = Integrate[p01[x], {x, 0, b}] + Integrate[p02[x], {x, b, 1}] - M*g;
fortheta2[x_] = Integrate[(x - b)*p01[x], {x, 0, b}] + Integrate[(x - b)*p02[x], {x, b, 1}];

When executing, for h2 and fortheta2, I get lots of conditions related to b. I know it does complain about Log[1/-b]. In my physical problem 0<b<1 . How can I add this condition so that forh2, fortheta2 make sense.

I need to put a condition for b inside p01, p02 definitions or just state this condition at the beginning of my problem.

p01[x_] := 2*h[2]/κ*Log[x - b/(-b)] + θ[2]/κ*x + 1/2;
p02[x_] := 2*h[2]/κ*Log[x - b/(1 - b)] + θ[2]/κ*(x - 1); 
forh2[x_] = Integrate[p01[x], {x, 0, b}] + Integrate[p02[x], {x, b, 1}] - M*g;
fortheta2[x_] = Integrate[(x - b)*p01[x], {x, 0, b}] + Integrate[(x - b)*p02[x], {x, b, 1}];

When executing, for h2 and fortheta2, I get lots of conditions related to b. I know it does complain about Log[1/-b]. In my physical problem 0<b<1 . How can I add this condition so that forh2, fortheta2 make sense.

I need to put a condition for b inside p01, p02 definitions or just state this condition at the beginning of my problem.

p01[x_] := 2*h[2]/κ*Log[(x - b)/(-b)] + θ[2]/κ*x + 1/2;
p02[x_] := 2*h[2]/κ*Log[(x - b)/(1 - b)] + θ[2]/κ*(x - 1); 
forh2[x_] = Integrate[p01[x], {x, 0, b}] + Integrate[p02[x], {x, b, 1}] - M*g;
fortheta2[x_] = Integrate[(x - b)*p01[x], {x, 0, b}] + Integrate[(x - b)*p02[x], {x, b, 1}];

When executing, for h2 and fortheta2, I get lots of conditions related to b. I know it does complain about Log[1/-b]. In my physical problem 0<b<1 . How can I add this condition so that forh2, fortheta2 make sense.

deleted 83 characters in body
Source Link
Sumit
  • 16k
  • 2
  • 33
  • 74

I need to put a condition for b inside p01, p02 definitions or just state this condition at the beginning of my problem.

p01[x_] := 
  2*h[2]/\[Kappa]*Log[xκ*Log[x - b/(-b)] + \[Theta][2]θ[2]/\[Kappa]*xκ*x + 1/2;
p02[x_] := 
  2*h[2]/\[Kappa]*Log[xκ*Log[x - b/(1 - b)] + \[Theta][2]θ[2]/\[Kappa]*κ*(x - 1); 
forh2[x_] = 
  Integrate[p01[x], {x, 0, b}] + Integrate[p02[x], {x, b, 1}] - M*g;
fortheta2[x_] = 
  Integrate[(x - b)*p01[x], {x, 0, b}] + 
   Integrate[(x - b)*p02[x], {x, b, 1}];

When executing, for h2 and fortheta2, I get lots of conditions related to b. I know it does complain about Log[1/-b]. In my physical problem 0<b<1 . How can I add this condition so that forh2, fortheta2 make sense.

I need to put a condition for b inside p01, p02 definitions or just state this condition at the beginning of my problem.

p01[x_] := 
  2*h[2]/\[Kappa]*Log[x - b/(-b)] + \[Theta][2]/\[Kappa]*x + 1/2;
p02[x_] := 
  2*h[2]/\[Kappa]*Log[x - b/(1 - b)] + \[Theta][2]/\[Kappa]*(x - 1); 
forh2[x_] = 
  Integrate[p01[x], {x, 0, b}] + Integrate[p02[x], {x, b, 1}] - M*g;
fortheta2[x_] = 
  Integrate[(x - b)*p01[x], {x, 0, b}] + 
   Integrate[(x - b)*p02[x], {x, b, 1}];

When executing, for h2 and fortheta2, I get lots of conditions related to b. I know it does complain about Log[1/-b]. In my physical problem 0<b<1 . How can I add this condition so that forh2, fortheta2 make sense.

I need to put a condition for b inside p01, p02 definitions or just state this condition at the beginning of my problem.

p01[x_] := 2*h[2]/κ*Log[x - b/(-b)] + θ[2]/κ*x + 1/2;
p02[x_] := 2*h[2]/κ*Log[x - b/(1 - b)] + θ[2]/κ*(x - 1); 
forh2[x_] = Integrate[p01[x], {x, 0, b}] + Integrate[p02[x], {x, b, 1}] - M*g;
fortheta2[x_] = Integrate[(x - b)*p01[x], {x, 0, b}] + Integrate[(x - b)*p02[x], {x, b, 1}];

When executing, for h2 and fortheta2, I get lots of conditions related to b. I know it does complain about Log[1/-b]. In my physical problem 0<b<1 . How can I add this condition so that forh2, fortheta2 make sense.

Source Link
Meva
  • 223
  • 2
  • 8

How to put a conditional expression for a variable inside a function definition or outside

I need to put a condition for b inside p01, p02 definitions or just state this condition at the beginning of my problem.

p01[x_] := 
  2*h[2]/\[Kappa]*Log[x - b/(-b)] + \[Theta][2]/\[Kappa]*x + 1/2;
p02[x_] := 
  2*h[2]/\[Kappa]*Log[x - b/(1 - b)] + \[Theta][2]/\[Kappa]*(x - 1); 
forh2[x_] = 
  Integrate[p01[x], {x, 0, b}] + Integrate[p02[x], {x, b, 1}] - M*g;
fortheta2[x_] = 
  Integrate[(x - b)*p01[x], {x, 0, b}] + 
   Integrate[(x - b)*p02[x], {x, b, 1}];

When executing, for h2 and fortheta2, I get lots of conditions related to b. I know it does complain about Log[1/-b]. In my physical problem 0<b<1 . How can I add this condition so that forh2, fortheta2 make sense.