Skip to main content
1-Visitor
June 14, 2022
Solved

Solving for variable in piecewise integral

  • June 14, 2022
  • 1 reply
  • 1311 views

Hi All,

 

Relatively new to MathCAD, so apologies if there is an easy fix here.

 

I've prepared a calculation file that take some various data and creates a piecewise function using if statements.

 

The clip below shows a graph of the piecewise function, and the equation I am trying to solve.  

GH_10342329_1-1655237761791.png

M(9.575 ft) = 0.967 lbf is confirmation that the function M(d) is working properly.  I am looking to try to solve for a value of d that will provide M(d)=0.  I am getting a "Pattern Match Error" with the equation I used above.

 

I'm wondering if it would be helpful to solve this equation within a range, but I've hit a dead end on figuring out how to approach that.

 

Any help is greatly appreciated.

Thanks

 

 

 

 

Best answer by LucMeekes

the solve and the right arrow are constructs that work for symbolics. You don't have that, You simply have a function M(d) where you want to find the value of d such that M(d) equals zero.

That can be simply accomplished using the root() function.

Assign a guess value to d, then call the root function. Like this:

 

d:= 9*ft

dzero:= root(M(d),d)

 

Now you can check if dzero results in an M-value of (near) zero, e.g. with:

 

M(dzero)=

 

The result should be very small.

 

Success!
Luc

1 reply

LucMeekes23-Emerald IVAnswer
23-Emerald IV
June 14, 2022

the solve and the right arrow are constructs that work for symbolics. You don't have that, You simply have a function M(d) where you want to find the value of d such that M(d) equals zero.

That can be simply accomplished using the root() function.

Assign a guess value to d, then call the root function. Like this:

 

d:= 9*ft

dzero:= root(M(d),d)

 

Now you can check if dzero results in an M-value of (near) zero, e.g. with:

 

M(dzero)=

 

The result should be very small.

 

Success!
Luc

1-Visitor
June 14, 2022

Worked perfectly, thank youA