Answered

4 Stroke Diesel Engine Simulation

Hello Augustine One option is to use the engine block from simscape driveline https://se.mathworks.com/help/physmod/sdl/ref/...

4 Stroke Diesel Engine Simulation

Hello Augustine One option is to use the engine block from simscape driveline https://se.mathworks.com/help/physmod/sdl/ref/...

4 years ago | 0

Solved

How to find the position of an element in a vector without using the find function

Write a function posX=findPosition(x,y) where x is a vector and y is the number that you are searching for. Examples: fin...

4 years ago

Solved

Check if number exists in vector

Return 1 if number _a_ exists in vector _b_ otherwise return 0. a = 3; b = [1,2,4]; Returns 0. a = 3; b = [1,...

4 years ago

Solved

Roll the Dice!

*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

4 years ago

Answered

Simscape: Revolute joint block includes degree of freedom of other revolute joints in the assembly as its own degree of freedom?

Hi Joben If you want to make the joints passive, you should set: Actuation(none) - Motion (automatically computed). If actuat...

Simscape: Revolute joint block includes degree of freedom of other revolute joints in the assembly as its own degree of freedom?

Hi Joben If you want to make the joints passive, you should set: Actuation(none) - Motion (automatically computed). If actuat...

4 years ago | 1

Solved

Find the numeric mean of the prime numbers in a matrix.

There will always be at least one prime in the matrix. Example: Input in = [ 8 3 5 9 ] Output out is 4...

4 years ago

Solved

Reverse the vector

Reverse the vector elements. Example: Input x = [1,2,3,4,5,6,7,8,9] Output y = [9,8,7,6,5,4,3,2,1]

4 years ago

Solved

Finding Perfect Squares

Given a vector of numbers, return true if one of the numbers is a square of one of the other numbers. Otherwise return false. E...

4 years ago

Answered

How to generate force AND velocity on an hydaulic cylinder in Simscape

Hello you need: Force sensor (cylinder) Velocity source (cylinder) Force source (wheel-axle > motor) Velocity sensor ...

How to generate force AND velocity on an hydaulic cylinder in Simscape

Hello you need: Force sensor (cylinder) Velocity source (cylinder) Force source (wheel-axle > motor) Velocity sensor ...

4 years ago | 0

Answered

Making an active revolute joint passive during simulation

Hello Amir I think the joint will be set to Torque (provided by input) and motion (automatically calculated). Then, when t...

Making an active revolute joint passive during simulation

Hello Amir I think the joint will be set to Torque (provided by input) and motion (automatically calculated). Then, when t...

4 years ago | 0

| accepted

Solved

Column Removal

Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2 3; 4 5 6]; ...

4 years ago

Solved

Sort a list of complex numbers based on far they are from the origin.

Given a list of complex numbers z, return a list zSorted such that the numbers that are farthest from the origin (0+0i) appear f...

4 years ago

Solved

Select every other element of a vector

Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

4 years ago

Solved

Determine whether a vector is monotonically increasing

Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...

4 years ago

Solved

Triangle Numbers

Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3 which can be displa...

4 years ago

Solved

Determine if input is odd

Given the input n, return true if n is odd or false if n is even.

4 years ago

Solved

Find the sum of all the numbers of the input vector

Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

4 years ago

Answered

Max speed of a PMSM motor before Flux Weakening

Hi Federico Try the following example https://se.mathworks.com/help/physmod/sps/ug/three-phase-pmsm-drive.html Increase t...

Max speed of a PMSM motor before Flux Weakening

Hi Federico Try the following example https://se.mathworks.com/help/physmod/sps/ug/three-phase-pmsm-drive.html Increase t...

4 years ago | 0

| accepted

Answered

Problem with SimScape Controlled Voltage Source

Hi Carlos Check that the maximum step in your solver is small enough to capture the sine wave (10kHz). For example 10us. If t...

Problem with SimScape Controlled Voltage Source

Hi Carlos Check that the maximum step in your solver is small enough to capture the sine wave (10kHz). For example 10us. If t...

4 years ago | 1

| accepted

Answered

Simscape Multibody PID Controller Tuning fails after different attempts.

Hello Florian Looking at the snapshot, it looked strange that you have a closed loop control but the motor joints are in kine...

Simscape Multibody PID Controller Tuning fails after different attempts.

Hello Florian Looking at the snapshot, it looked strange that you have a closed loop control but the motor joints are in kine...

4 years ago | 0

Answered

Simscape multibody simulation model extrusion

Hi Ramesh, you can’t do that in this case without several bodies since a cube can’t be built as a revoluted extrusion around...

Simscape multibody simulation model extrusion

Hi Ramesh, you can’t do that in this case without several bodies since a cube can’t be built as a revoluted extrusion around...

4 years ago | 0

| accepted

Answered

Why the robot gripper can not pick up the object in Simscape with Contact Forces Library ?

Hi John I would recommend that you use the Spatial Force Contact block we added to Simscape Multibody in latest releases. It is...

Why the robot gripper can not pick up the object in Simscape with Contact Forces Library ?

Hi John I would recommend that you use the Spatial Force Contact block we added to Simscape Multibody in latest releases. It is...

4 years ago | 0

| accepted

Answered

Simscape Battery SOC increasing even with Circuit-Braker Open

Hello Sreeraj The way the model is configured, the current source forces the current anyhow through the breaker which ends up c...

Simscape Battery SOC increasing even with Circuit-Braker Open

Hello Sreeraj The way the model is configured, the current source forces the current anyhow through the breaker which ends up c...

4 years ago | 0

Answered

Variable Parameters for Simscape Thermal Mass

Hi Cem Easiest is to create a custom component using the code in Thermal Mass. Then, make the parameter of mass an input inst...

Variable Parameters for Simscape Thermal Mass

Hi Cem Easiest is to create a custom component using the code in Thermal Mass. Then, make the parameter of mass an input inst...

4 years ago | 0

| accepted

Answered

Worm-gear connection in Simscape Multibody

Hi Eleni It is difficult to say exactly, but i think that the local z axes for both bodies at ports B and F must perpendicula...

Worm-gear connection in Simscape Multibody

Hi Eleni It is difficult to say exactly, but i think that the local z axes for both bodies at ports B and F must perpendicula...

4 years ago | 0

Answered

Gas System with Vacuum Pump

Hi Dan I believe it is better to use a pressure source than a volumetric flow rate source. In the inlet, you have the chamber...

Gas System with Vacuum Pump

Hi Dan I believe it is better to use a pressure source than a volumetric flow rate source. In the inlet, you have the chamber...

4 years ago | 0

Answered

Position vector of the "Spatial Contact Force" reaction.

Hello Camilo This is not trivial to derive. You can have a sensor between selected points in the two bodies and then sample t...

Position vector of the "Spatial Contact Force" reaction.

Hello Camilo This is not trivial to derive. You can have a sensor between selected points in the two bodies and then sample t...

4 years ago | 0

Answered

Cell arrays issues in Simscape component equations

Hola Rocio My advice is to use a hydraulic resistance instead and convert it to a flow sensor by having a low resistance And ...

Cell arrays issues in Simscape component equations

Hola Rocio My advice is to use a hydraulic resistance instead and convert it to a flow sensor by having a low resistance And ...

4 years ago | 0

Answered

Simscape - Custom component with Frame Port

Hi Boris What you are trying to achieve can only be done by creating a domain consisting of a vector of across variables w an...

Simscape - Custom component with Frame Port

Hi Boris What you are trying to achieve can only be done by creating a domain consisting of a vector of across variables w an...

4 years ago | 0