Answered

Where are the bugs for this ODE finite difference problem that solve using Newton Raphson method?

Here is my attempt clc,clear N = 10; % 10 Set parameters L = 16*0.3048; %meter b = 19.625 * 0.0254; d = 1.625 * 0.0254; ...

Where are the bugs for this ODE finite difference problem that solve using Newton Raphson method?

Here is my attempt clc,clear N = 10; % 10 Set parameters L = 16*0.3048; %meter b = 19.625 * 0.0254; d = 1.625 * 0.0254; ...

3 days ago | 1

| accepted

Answered

I am receiving the error message Index exceeds the number of array elements (1) when trying to use ode45.

Try @(V,T)

I am receiving the error message Index exceeds the number of array elements (1) when trying to use ode45.

Try @(V,T)

6 days ago | 0

| accepted

Answered

I have a 14 equation system of second order differential equations which I am trying to solve using dsolve. The program just keeps running without finishing ?

alpha and E should be numerical function main m = 15000; k = 150000; n = 14; A = zeros(n); A(n,n) = -k/m; A(n,n-1) = k/m;...

I have a 14 equation system of second order differential equations which I am trying to solve using dsolve. The program just keeps running without finishing ?

alpha and E should be numerical function main m = 15000; k = 150000; n = 14; A = zeros(n); A(n,n) = -k/m; A(n,n-1) = k/m;...

6 days ago | 0

Answered

Euler 3D rotation between two vectors

Here is rotation using Rodriguez matrix Here is rotation about Y axis and Z. Here is the difference between them See ...

Euler 3D rotation between two vectors

Here is rotation using Rodriguez matrix Here is rotation about Y axis and Z. Here is the difference between them See ...

7 days ago | 0

| accepted

Answered

Simultaneous differential equations - derivative of y^3 wrt t

Just get dydt(1)=(-3*D*Cs/rho/r0^2)*y(1)*(1-y(2)); dydt(1)=nthroots(dydt(1),3);

Simultaneous differential equations - derivative of y^3 wrt t

Just get dydt(1)=(-3*D*Cs/rho/r0^2)*y(1)*(1-y(2)); dydt(1)=nthroots(dydt(1),3);

7 days ago | 0

Answered

Numerically derive a continous, non-symbolic function

Derivative is (if you have numerical data) dy = (y(i)-y(i-1)) / (t(i)-t(i-1)); Maybe diff (if you have a function) ? syms x ...

Numerically derive a continous, non-symbolic function

Derivative is (if you have numerical data) dy = (y(i)-y(i-1)) / (t(i)-t(i-1)); Maybe diff (if you have a function) ? syms x ...

9 days ago | 0

Answered

3D Point Cloud - Gaussian Curvature

one way clc,clear % generate some data r = 3; t = linspace(0,10)'; x = r*cos(t); y = r*sin(t); z = sin(1*t); t1 = ...

3D Point Cloud - Gaussian Curvature

one way clc,clear % generate some data r = 3; t = linspace(0,10)'; x = r*cos(t); y = r*sin(t); z = sin(1*t); t1 = ...

10 days ago | 0

Answered

Runge Kutta for system of eqs

I wrote function in the way similar to ode45 y_dot = @(x,dx)[dx; -4*dx-5*x]; %insert function to be solved for i = 1:n k1...

Runge Kutta for system of eqs

I wrote function in the way similar to ode45 y_dot = @(x,dx)[dx; -4*dx-5*x]; %insert function to be solved for i = 1:n k1...

10 days ago | 0

Answered

The problem of finding intersection point of triangle mesh

To check every edge: for j = 1:size(face,2) i1 = 1; for i2 = [2 3 1] % checking edges [1 2], [2 3], [3 1...

The problem of finding intersection point of triangle mesh

To check every edge: for j = 1:size(face,2) i1 = 1; for i2 = [2 3 1] % checking edges [1 2], [2 3], [3 1...

12 days ago | 0

| accepted

Answered

How can i solve a system which contains matrices

Here is the best way i know: A = [5 3 1 1 1 1 3 1 2]; B = [c1(:) c2(:) c3(:)]'; C = inv(A) * B;

How can i solve a system which contains matrices

Here is the best way i know: A = [5 3 1 1 1 1 3 1 2]; B = [c1(:) c2(:) c3(:)]'; C = inv(A) * B;

14 days ago | 1

| accepted

Answered

Using a for-loop to score values in different intervals

Correct form if 0 <= x(i) && x(i) < 1

Using a for-loop to score values in different intervals

Correct form if 0 <= x(i) && x(i) < 1

14 days ago | 0

| accepted

Answered

Intersection between line and circle when line ends inside circle (using geom2d)

Someone should copy their comment to the answers section so it can be accepted. It should be me % Position of line: x1 = [0...

Intersection between line and circle when line ends inside circle (using geom2d)

Someone should copy their comment to the answers section so it can be accepted. It should be me % Position of line: x1 = [0...

15 days ago | 1

| accepted

Answered

Removing points from meshgrid (mask)

Try this simple script [X,Y] = meshgrid(1:20); n = [1 -1]; n = n/norm(n); % normal of a line dist = -7; ...

Removing points from meshgrid (mask)

Try this simple script [X,Y] = meshgrid(1:20); n = [1 -1]; n = n/norm(n); % normal of a line dist = -7; ...

15 days ago | 0

Answered

How can I find the surface normal of a 8 by 3 matrix?

Use griddata to create a surface Use surfnorm to find normal vectors [nx,ny,nz] = surfnorm(x,y,z); surf(x,y,z) hold on quiv...

How can I find the surface normal of a 8 by 3 matrix?

Use griddata to create a surface Use surfnorm to find normal vectors [nx,ny,nz] = surfnorm(x,y,z); surf(x,y,z) hold on quiv...

15 days ago | 0

Answered

How do I increase the circle size and animate a stick figure?

Use for loop and pause t = linspace(0,2*pi); x = cos(t); y = sin(t); axis([-10 10 -10 10]) hold on for i = 1:10 h = p...

How do I increase the circle size and animate a stick figure?

Use for loop and pause t = linspace(0,2*pi); x = cos(t); y = sin(t); axis([-10 10 -10 10]) hold on for i = 1:10 h = p...

16 days ago | 0

Answered

Finding specific data point x for given y

I need to find the CB and CS values at t=5 Use interp1 to find i need to find the t and CB values when CS = 0.001 Use fsolve ...

Finding specific data point x for given y

I need to find the CB and CS values at t=5 Use interp1 to find i need to find the t and CB values when CS = 0.001 Use fsolve ...

16 days ago | 0

Answered

Surface between 3D lines

You are concatenating in a wrong way XX = [D1 D1 D1]; YY = [F1 F2 F3]; ZZ = [z1 z2 z3]; surf(XX,ZZ,YY,'EdgeColor','none')

Surface between 3D lines

You are concatenating in a wrong way XX = [D1 D1 D1]; YY = [F1 F2 F3]; ZZ = [z1 z2 z3]; surf(XX,ZZ,YY,'EdgeColor','none')

16 days ago | 0

| accepted

Answered

two body problem using ode45

- equation of equilibrium Is this condition fullfield?

two body problem using ode45

- equation of equilibrium Is this condition fullfield?

17 days ago | 0

Answered

Numerically Integrating the differential equation below?

Any guidance on it is much appreciated! Helpfull page: ODE45 I do not know what I can do if I no tf. Try tf = 5. This should ...

Numerically Integrating the differential equation below?

Any guidance on it is much appreciated! Helpfull page: ODE45 I do not know what I can do if I no tf. Try tf = 5. This should ...

17 days ago | 0

Answered

Streamline plot not complete

Works ok for me N = 15; xx = linspace(min(x(:)),max(x(:)),10); yy = linspace(min(y(:)),max(y(:)),10); [startx,starty] = mes...

Streamline plot not complete

Works ok for me N = 15; xx = linspace(min(x(:)),max(x(:)),10); yy = linspace(min(y(:)),max(y(:)),10); [startx,starty] = mes...

18 days ago | 0

| accepted

Answered

2D Matrix revolution

Use cylinder for each curve separately: z = linspace(-1,1,20); % axis r = sqrt(1-z.^2); ...

2D Matrix revolution

Use cylinder for each curve separately: z = linspace(-1,1,20); % axis r = sqrt(1-z.^2); ...

18 days ago | 1

Answered

How do I align the vertices and the adjacency graph of a Buckyball?

Here is a way ind = full(B); % convert to ordinary matrix [rr,cc] = find(ind); % find non-zero elements ix = ...

How do I align the vertices and the adjacency graph of a Buckyball?

Here is a way ind = full(B); % convert to ordinary matrix [rr,cc] = find(ind); % find non-zero elements ix = ...

20 days ago | 0

Answered

Find the coordinates of a point chosen on a plot

Short example x = linspace(0,2,20)'; % generate some data y = sin(x); plot(x,y,'.-b') xy = ginput(1); ...

Find the coordinates of a point chosen on a plot

Short example x = linspace(0,2,20)'; % generate some data y = sin(x); plot(x,y,'.-b') xy = ginput(1); ...

22 days ago | 1

| accepted

Answered

How do I create a sphere without sphere function that will inflate like a balloon utilizing the getframe function?

Use surf to create a 3D surface rr = linspace(0,0.5,20); tt = linspace(0,2*pi,40); [R,T] = meshgrid(rr,tt); [X,Y] = pol2cart...

How do I create a sphere without sphere function that will inflate like a balloon utilizing the getframe function?

Use surf to create a 3D surface rr = linspace(0,0.5,20); tt = linspace(0,2*pi,40); [R,T] = meshgrid(rr,tt); [X,Y] = pol2cart...

24 days ago | 0

Answered

Differential Algebraic Equations with vectors

Try f = @(t,u) inv(Z)*(J+p*W*pi*Q)*[u(3) u(4)]' + inv(Z)*(V+p*W*pi*Q)*[u(1) u(2)]'; F = @(t,u) [u(3) u(4) ...

Differential Algebraic Equations with vectors

Try f = @(t,u) inv(Z)*(J+p*W*pi*Q)*[u(3) u(4)]' + inv(Z)*(V+p*W*pi*Q)*[u(1) u(2)]'; F = @(t,u) [u(3) u(4) ...

24 days ago | 1

| accepted

Answered

How to find the handle of all markers in plot (already made)?

To set up markerSize to every marker try: h = get(gca,'children'); for i = 1:length(h) if strcmp(get(h(i),'type'),'line')...

How to find the handle of all markers in plot (already made)?

To set up markerSize to every marker try: h = get(gca,'children'); for i = 1:length(h) if strcmp(get(h(i),'type'),'line')...

25 days ago | 0

| accepted

Answered

Ytick Spacing on Bode Plot Magnitude

If you are using subplot ax1 = subplot(211); plot(x1,y1) ax2 = sbuplot(212); plot(x1,y2); set(ax1,'YTick',[1 2 3]) set(a...

Ytick Spacing on Bode Plot Magnitude

If you are using subplot ax1 = subplot(211); plot(x1,y1) ax2 = sbuplot(212); plot(x1,y2); set(ax1,'YTick',[1 2 3]) set(a...

27 days ago | 0

Answered

How to plot a graph in simulated annealing code? How can we know the solution is near the true value?

How can I be confident that the solution is near the true value as the minimum value keeps changing when I run the code? Well, ...

How to plot a graph in simulated annealing code? How can we know the solution is near the true value?

How can I be confident that the solution is near the true value as the minimum value keeps changing when I run the code? Well, ...

27 days ago | 0

Answered

Using Runge Kutta function to solve Rossler equations

Write your f function as x'(t)=-x(t)-y(t) y'(t)=ax(t)+y(t) z'(t)=b+z(t)(x(t)-c) %where I fix parameters say c=5, b=3, a=0.2...

Using Runge Kutta function to solve Rossler equations

Write your f function as x'(t)=-x(t)-y(t) y'(t)=ax(t)+y(t) z'(t)=b+z(t)(x(t)-c) %where I fix parameters say c=5, b=3, a=0.2...

28 days ago | 1

| accepted

Answered

Complement of an Image using loop

Use this trick for i = 1:m % rows for j = 1: round(n/m*(m-i+1)) % columns I(i,j) = original; end ...

Complement of an Image using loop

Use this trick for i = 1:m % rows for j = 1: round(n/m*(m-i+1)) % columns I(i,j) = original; end ...

28 days ago | 0