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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Newbie problem using Solver Block

ddenholm
6-Contributor

Newbie problem using Solver Block

I am using MathCAD Prime 5.0.0.0 and I am trying to use a Solver Block for the first time in Prime (I recall using it successfully in the pre-Prime MC).

 

I am wanting to solve a single ODE. So I decided to run through the Task 3-3:Solving ODEs with Solve Blocks tutorial on the support site to figure out the correct syntax etc.

 

I defined the 3 variables: m, c, and k as shown in the tutorial.

I defined the function u(t) as shown in the tutorial.

I then created a solve block by clicking on the Solve Block button under the Math menu tab.

 

That put the Solve Block with the Guess Values, Constraints, and Solver regions in my MathCAD worksheet.

 

My understanding from the tutorial is that I did not need to enter anything in the Guess Values regions but that I would need to enter the formula for the derivatives of x(t) in the Constraints region along with the two initial value expressions. And that I would then need to enter the x := odesolve(x(t), 20) in the Solver region.

 

But as I was typing the derivatives formula m*x''(t) + c*x'(t) +k*x(t)=u(t), the MathCAD syntax checker highlights the first x in the formula with the message "This variable is undefined. Check that the label is set correctly."

 

But the tutorial does not show x being defined or set anywhere. I am probably being dense but I am hoping someone will explain what I am doing wrong. 🙂

 

ACCEPTED SOLUTION

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

You've used an evaluation '=' instead of an equals '='. Type [CTRL-=]  instead of just =.

 

Success!
Luc

View solution in original post

7 REPLIES 7
LucMeekes
23-Emerald III
(To:ddenholm)

Please attach your worksheet.

 

Luc

ddenholm
6-Contributor
(To:LucMeekes)

OK, I have attached the file... I am assuming I am making some newbie mistake.

 

Thanks!

LucMeekes
23-Emerald III
(To:ddenholm)

You've used an evaluation '=' instead of an equals '='. Type [CTRL-=]  instead of just =.

 

Success!
Luc

ddenholm
6-Contributor
(To:LucMeekes)

Thanks!... It works for me too.

 

They might want to make it clear in the documentation and the tutorial that you have to use ctl-=.  🙂

 

Just sayin'

LucMeekes
23-Emerald III
(To:ddenholm)


@ddenholm wrote:

They might want to make it clear in the documentation and the tutorial that you have to use ctl-=.  🙂

 

Just sayin'


As a matter of fact.... They do, at least in the documentation:

https://support.ptc.com/help/mathcad/en/index.html#page/PTC_Mathcad_Help%2Fto_define_a_solve_block.html where it says you have to use the "Equal To operator".

 

Success!

Luc

P.S. You may want to mark this topic as 'answered'...

Werner_E
25-Diamond I
(To:ddenholm)

How did you type the prime symbols for the derivatives?

You can't simply type quotes but have to use the derivative symbols from the operators menu.

If you are happy, they keyboard shortcut ctrl+' works for you (it doesn't in my version - I have to type ctrl+ä on my German keyboard!).

B1.png

ddenholm
6-Contributor
(To:Werner_E)

 

I think I was entering the primes correctly for the derivatives. I selected them from the menu Math/Operators/Calculus/x'

 

I uploaded my file in a reply to an earlier post if you want to take a look at it.

 

Thanks!

Announcements

Top Tags