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

Converting MATLAB to Mathcad Prime 2.0 - EV Acceleration

Newbie

Converting MATLAB to Mathcad Prime 2.0 - EV Acceleration

First off, I am new to Mathcad and have Prime 2.0 installed. It has been many decades since I studied calculus in school or applied it in engineering, so much of that knowledge has flown the coop.

I have recently come across a book that describes the theory, formulas, and programs for deriving various performance characteristics of an electric vehicle (EV), but unfortunately the author uses MATLAB to execute the simulations. I would like to model the performance of an EV using Mathcad, and so I have picked one such simulation: EV Acceleration. The attached pdf (pp. 187-196) provides a description of the simulation and shows the example calculations, program, and plots in MATLAB.

The attached Mathcad file is my attempt to translate the MATLAB model into Mathcad using the methodology used by the author (finite difference). My Mathcad model appears to replicate the MATLAB simulation, as the plots look similar.

However, I suspect there has got to be a better way (using calculus, derivitives, ODE, solvers, etc.). I have searched and read many posts here, but have not found a solution. I suspect there is an easier way to simulate this model and create the associated velocity and distance versus time plots.

I'm not looking for someone to do the work, but rather point me in the right direction, unless something like this has already been done. Examples would be much appreciated.

Thanks in advance for your assistance.

1 REPLY 1

Re: Converting MATLAB to Mathcad Prime 2.0 - EV Acceleration

The attached shows a quick and dirty method using odesolve. You should really replace the literal numbers by variable names for flexibility. But it should point you in the right direction.

Alan

Announcements