Skip to main content
1-Visitor
January 30, 2019
Solved

Newbie problem using Solver Block

  • January 30, 2019
  • 2 replies
  • 4163 views

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. ๐Ÿ™‚

 

Best answer by LucMeekes

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

 

Success!
Luc

2 replies

23-Emerald IV
January 30, 2019

Please attach your worksheet.

 

Luc

ddenholm1-VisitorAuthor
1-Visitor
January 31, 2019

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

 

Thanks!

LucMeekes23-Emerald IVAnswer
23-Emerald IV
January 31, 2019

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

 

Success!
Luc

25-Diamond I
January 31, 2019

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

ddenholm1-VisitorAuthor
1-Visitor
January 31, 2019

 

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!