Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.
How to calculate total current with Matlab livelink?
Posted Jul 20, 2018, 10:24 a.m. EDT 1 Reply
Please login with a confirmed email address before reporting spam
I built a cylinder conductor (axial symmetry), bottom surface is grounded, top surface is connected to a voltage source, i want to calculate the total current passing through the conductor in Matlab.
From mphdoc,i found using code like: "[I, unit] = mphint2(model, 'ec.normJ', 'surface', 'selection', 6)" to evaluate the total currrent passing through selected boundary, but it make errors when run script.
Error using mphint2 mphnumerical (0): Java exception occurred: Exception: com.comsol.util.exceptions.FlException: java.lang.IllegalArgumentException: Illegal input vector illegal entity number Messages: java.lang.IllegalArgumentException: Illegal input vector illegal entity number Error in inttest (line 5) I = mphint2(model, 'ec.normJ','surface','selection',6);
I don't know how to fix it, please help me ......
P.S the simulation works well in COMSOL, and the current density is reasonable, but it goes wrong in livelink with matlab when using "I = mphint2(model, 'ec.normJ','surface','selection',6)"
Attachments: