cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Solve block - This function cannt be used here

DS_10051556
1-Newbie

Solve block - This function cannt be used here

Hi all,

See attached worksheet.  I took these equations out of a engineering paper and I cannot get them to work.  The find function is creating an error.

 

Thanks,

Dan

1 ACCEPTED SOLUTION

Accepted Solutions
LucMeekes
23-Emerald III
(To:DS_10051556)

As Fred indicated, your problem is caused by using square brackets in the wrong place.

If you type an expression and want to keep a part of it together, you should ONLY use round brackets:  (  and  ).

Note that if you type the opening bracket   (   Prime will create the pair   (  and  ).

You should never type square brackets in an expression in order to 'bracket' a part of that expression. Prime will change round brackets to square brackets automatically if there's a need for it (or whenever it feels like); but you should never type them for that purpose.

There are two uses for square brackets:

-You type a  [  in blank space or adjacent to an operator to create an array (a vector or a Matrix), here too Prime will create the pair   [   and    ].

-You type a  [  immediately adjacent to a variable to add an index to that variable. In that case the variable must be/hold an array.

 

That said, your worksheet doesn't need to define the derivatives explicitly, and it doesn't need the solve block. It could look like this:

LucMeekes_0-1632935530339.png

The prime operator   '   takes the derivative of the function it is attached to. The function must be a single parameter function. All your functions are single parameter, they only have x, so it can be used here.

The root function takes two or four parameters, the first two of which are a function and a variable (that must be a parameter of the function). It searches for a value of that variable where the function value is zero. The third and fourth parameters to root define the boundaries for the variable between which the zero should be found. Alternatively you can define a guess value for the parameter before calling root, different guess values may produce different roots, depending on the function. Note that root does NOT always find the root closest to the guess value.

LucMeekes_1-1632936221183.png

In case of surprise, check the function by plotting it.

 

Success!
Luc

View solution in original post

2 REPLIES 2

When you used the square brackets, 

Fred_Kohlhepp_0-1632933405976.png

you created a  one- valued vector, so the derivative function doesn't work

Fred_Kohlhepp_1-1632933523175.png

Try eliminating the square brackets:

Fred_Kohlhepp_2-1632933604008.png

 

 

LucMeekes
23-Emerald III
(To:DS_10051556)

As Fred indicated, your problem is caused by using square brackets in the wrong place.

If you type an expression and want to keep a part of it together, you should ONLY use round brackets:  (  and  ).

Note that if you type the opening bracket   (   Prime will create the pair   (  and  ).

You should never type square brackets in an expression in order to 'bracket' a part of that expression. Prime will change round brackets to square brackets automatically if there's a need for it (or whenever it feels like); but you should never type them for that purpose.

There are two uses for square brackets:

-You type a  [  in blank space or adjacent to an operator to create an array (a vector or a Matrix), here too Prime will create the pair   [   and    ].

-You type a  [  immediately adjacent to a variable to add an index to that variable. In that case the variable must be/hold an array.

 

That said, your worksheet doesn't need to define the derivatives explicitly, and it doesn't need the solve block. It could look like this:

LucMeekes_0-1632935530339.png

The prime operator   '   takes the derivative of the function it is attached to. The function must be a single parameter function. All your functions are single parameter, they only have x, so it can be used here.

The root function takes two or four parameters, the first two of which are a function and a variable (that must be a parameter of the function). It searches for a value of that variable where the function value is zero. The third and fourth parameters to root define the boundaries for the variable between which the zero should be found. Alternatively you can define a guess value for the parameter before calling root, different guess values may produce different roots, depending on the function. Note that root does NOT always find the root closest to the guess value.

LucMeekes_1-1632936221183.png

In case of surprise, check the function by plotting it.

 

Success!
Luc

Top Tags