Skip to main content
10-Marble
November 21, 2025
Solved

Motor parameter extraction using using measured data

  • November 21, 2025
  • 3 replies
  • 1735 views

Using the basic motor (DCPM) motor equation ...electrical and mechanical which have differential equations. I can solve the differential equations in a solve block. I want to create a sum squared error between the measured data and the model, and then using minerr to estimate the motor parameters. The measured data is Ia vs time and rotation speed vs time. But I cannot have two odesolve in one solve block. Can you help please... thanks.

 

Best answer by SA_1844545

Thanks Werner, this is awesome, much appreciated.

Thanks Weiner and Terry for your prompt responses on this weekend. Now I understand the method 🙏

Have a great weekend.

3 replies

25-Diamond I
November 22, 2025

I have no experience in your field of work but it looks to me that you could parametrize the first solve block and use it in the second.

But without seeing what you actually are trying to solve and looking at your worksheet I can't say much more.

I assume you are using Prime and not real (legacy) Mathcad. In that case you also should say which version you use to avoid that you were presented a solution sheet in a version you can't open (in case you are not using the latest version of Prime).

23-Emerald V
November 22, 2025

You might be able to treat them as components of a system of differential equations, 

 

See, for example:

 

https://support.ptc.com/help/mathcad/r11.0/en/#page/PTC_Mathcad_Help/example_solving_a_first_order_system_of_ODEs.html

 

Stuart

10-Marble
November 22, 2025

(Mathcad rime 10) Attached is a pdf of what I intended to do. I have the basic motor equations and I get the armature current and rotational speed vs time for a step voltage input. Now I have the experimental data as well. So I wanted to derive the sum squared error between the experimental data and the simulated data (same time steps) and minimize the error for Ia and omega so as to predict the Ra, La, Kt, Kb given a set of constraints for these variables so the solver would iterate and give me the best "fit" values.

25-Diamond I
November 22, 2025

Parametrize the solve block, making "Sol_sim" a function of the variable inputs: Sol_sim(R.a_actual, L.a_actual, ....) := odesolve(....)

and then I.A(....):=.... etc.

You could use a second solve block with "minerr" to find the optimal parameters.

If you need more help you would need to to post the worksheet itself and the data.

 

You also should take advantage of Primes ability to work with units!

 

BTW, as you use t.sim (first line you should replace "i" by "j" ) just for the plots, it would not be necessary to make it a vector. A range fits pretty well for plotting - its one of the things ranges could and should be used for.

For the fit you can use the vector of time values from your measured data and the corresponding vectors you get when you use this vector as argument for the functions derived by the solve block.

10-Marble
November 22, 2025

I am still having issues, can you please take a look .. thanks