Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Integrating Nested If Statement' topicStudent Support Forum > General > Archives > "Integrating Nested If Statement"

Next Comment >Help | Reply To Topic
Author Comment/Response
Renee Anderson
01/27/05 4:30pm

I am trying to solve a problem that requires me to use two piecewise functions. I need to integrate them and then solve for a variable that was initially inside of the integral. The best way I have found to do this was to use if statements. Is is possible to integrate a nested if statement like this?

m[y_,x_]=If[x=Lab,(MB*x)/Lab,(MB*(Lac-x)/Lbc)]
mbar1[y_,x_]=If[x=y ,(P*y*(Lab-y)*x)/(Lab*
y),(P*y*(Lab-y)*(Lab-x))/(Lab*(Lab-y))]
mbar2[y_,x_]=If[x=y,(P*(y-Lab)*(Lac-y)*(x-Lab))/(
Lbc*(y-Lab)),P*(y-Lab)*(Lac-y)*(Lac-x)/(Lbc*(Lac-y))]
mbar[y_,x_]=If[y=Lab,mbar1[y,x],mbar2[y,x]]
M=Table[m[y,x]+mbar[y,x],{y,1,0.45*Lac,0.05*Lac}]
MatrixForm[k = a1*M + a3*(M)^11]\)
DelBA = Integrate[k*((Lab - x)),{x,o,Lac}]

I have also tried piecewise functions, but the program will not integrate it. Is there another way to do this?

Thanks for any help you can provide.
Renee Anderson
Civil Engineering Graduate Student
Colorado School of Mines

URL: ,

Subject (listing for 'Integrating Nested If Statement')
Author Date Posted
Integrating Nested If Statement Renee Anderson 01/27/05 4:30pm
Re: Integrating Nested If Statement yehuda ben-s... 01/29/05 5:53pm
Re: Integrating Nested If Statement Renee Anderson 01/31/05 12:57pm
Next Comment >Help | Reply To Topic