Answered

How can I solve the following PDE?

Try setting tau = T - t, so that dA/dt = -dA/dtau etc, and A(T) , B(T) become A(0), B(0). i.e. turn the boundary value problem ...

How can I solve the following PDE?

Try setting tau = T - t, so that dA/dt = -dA/dtau etc, and A(T) , B(T) become A(0), B(0). i.e. turn the boundary value problem ...

6 months ago | 0

Answered

how to use ode45 to solve motion equation with Matrix

Does this help? %% Data M =[ 0.0210 0.0014 -0.0209 0 0 0 0 0 0.0014 ...

how to use ode45 to solve motion equation with Matrix

Does this help? %% Data M =[ 0.0210 0.0014 -0.0209 0 0 0 0 0 0.0014 ...

6 months ago | 1

| accepted

Answered

Subscript indices must either be real positive integers or logicals always show up. what should i do?

Well, this works, but you might want to check the correctness or otherwise of your mode_shape calculations (there are a lot of z...

Subscript indices must either be real positive integers or logicals always show up. what should i do?

Well, this works, but you might want to check the correctness or otherwise of your mode_shape calculations (there are a lot of z...

6 months ago | 1

Answered

incorrect number or types of inputs or outputs for function 'int'

Replace your power calculation with power = (1/T_0) * trapz(t,y.^2); Edited - Walter is correct.

incorrect number or types of inputs or outputs for function 'int'

Replace your power calculation with power = (1/T_0) * trapz(t,y.^2); Edited - Walter is correct.

6 months ago | 0

Answered

Regula-falsi Method that keeps running

Brackets!! f = @(x) 2.^x - x.^2 - 2; % Function whose roots are desired xL = 4; xU = 5; % Initial guesses Tol = 1...

Regula-falsi Method that keeps running

Brackets!! f = @(x) 2.^x - x.^2 - 2; % Function whose roots are desired xL = 4; xU = 5; % Initial guesses Tol = 1...

6 months ago | 0

| accepted

Answered

Trying to answer a math problem using newton's method but having problem in the function.

Matlab doesn't like implied multiplication (x ^ 2)z should be (x ^ 2)*z etc. Also, in Matlab log(x) is ln(x)

Trying to answer a math problem using newton's method but having problem in the function.

Matlab doesn't like implied multiplication (x ^ 2)z should be (x ^ 2)*z etc. Also, in Matlab log(x) is ln(x)

7 months ago | 0

| accepted

Answered

How to set multiple values of a threshold?

Here's one way: tolX1_4 = [1 1 1 1 1 -1 1 1 0 1 1 1 1 1 1 1 1 ...

How to set multiple values of a threshold?

Here's one way: tolX1_4 = [1 1 1 1 1 -1 1 1 0 1 1 1 1 1 1 1 1 ...

7 months ago | 0

| accepted

Answered

Please help solve a system of differential equation

Here's a numerical approach: First manipulate the equations tspan = [0, 120]; ic = [80000, 0.001]; [t, xy] = ode45(@rate, ...

Please help solve a system of differential equation

Here's a numerical approach: First manipulate the equations tspan = [0, 120]; ic = [80000, 0.001]; [t, xy] = ode45(@rate, ...

7 months ago | 0

Answered

how ode solver works

doc ode45 Go to the References section. The two references listed will supply you with all you need to know about the ode solv...

how ode solver works

doc ode45 Go to the References section. The two references listed will supply you with all you need to know about the ode solv...

7 months ago | 0

Answered

Solve Differential Equation with initial conditions and function

Try modifying your if statement in Moment. Something like if x<a V =...; M = ...; elseif x>=a && x<L M = ... ...

Solve Differential Equation with initial conditions and function

Try modifying your if statement in Moment. Something like if x<a V =...; M = ...; elseif x>=a && x<L M = ... ...

7 months ago | 0

Answered

problem in creating function file using ode45

Are you looking for something like this? (I might have misinterpreted your equations!) O=1; a=pi/2; g=9.81; L=100; tspan ...

problem in creating function file using ode45

Are you looking for something like this? (I might have misinterpreted your equations!) O=1; a=pi/2; g=9.81; L=100; tspan ...

7 months ago | 0

Answered

how can eliminate negative data in erf function?

Should term2(i) = (sqrt(lemdaD)./(2.*e1(i))).*exp(-(v1(i).*sqrt_avgsnr - v2(i).* mu).^2./(2.*e1(i).^2)).*.... erf((e4(...

how can eliminate negative data in erf function?

Should term2(i) = (sqrt(lemdaD)./(2.*e1(i))).*exp(-(v1(i).*sqrt_avgsnr - v2(i).* mu).^2./(2.*e1(i).^2)).*.... erf((e4(...

7 months ago | 0

| accepted

Answered

Why is my plot not showing for improved Euler method?

You need to keep track of each step. Your original simply overwrites the values of t and y at each step. dy=@(t,y) -(0.1/10^(1...

Why is my plot not showing for improved Euler method?

You need to keep track of each step. Your original simply overwrites the values of t and y at each step. dy=@(t,y) -(0.1/10^(1...

7 months ago | 1

Answered

Why I couldn't plot this graph f=(@(x,y) (x.^2)+(x*y)+(y.^2)<=68200.^2/3);

This will give you the outline (I've assumed you want 68200^(2/3) rather than 68200^2/3) f=@(x,y) x.^2+x.*y+y.^2-68200.^(2/3); ...

Why I couldn't plot this graph f=(@(x,y) (x.^2)+(x*y)+(y.^2)<=68200.^2/3);

This will give you the outline (I've assumed you want 68200^(2/3) rather than 68200^2/3) f=@(x,y) x.^2+x.*y+y.^2-68200.^(2/3); ...

7 months ago | 0

Answered

I want to solve a simple "y=mx+c" with initial condition to find value of "m" and "c" but i am getting error by using following code. Any idea to tackle this kind of problem?

These are simple linear equations in m and c so set: X = [x(1) 1; x(2) 1]; Y = [y(1); y(2)]; and solve using X\Y to get m a...

I want to solve a simple "y=mx+c" with initial condition to find value of "m" and "c" but i am getting error by using following code. Any idea to tackle this kind of problem?

These are simple linear equations in m and c so set: X = [x(1) 1; x(2) 1]; Y = [y(1); y(2)]; and solve using X\Y to get m a...

7 months ago | 0

Answered

I have been trying to code a solar pv module for 1 diode model, the following is my code, can someone tell me the mistake ive made and the correction to it pls.

Like this? Note: I've made kref positive to avoid the I's being complex. This might be completely incorrect!! Pmpp = 50; ...

I have been trying to code a solar pv module for 1 diode model, the following is my code, can someone tell me the mistake ive made and the correction to it pls.

Like this? Note: I've made kref positive to avoid the I's being complex. This might be completely incorrect!! Pmpp = 50; ...

7 months ago | 1

| accepted

Answered

Reorganization of data in matrix

Like this? M = [1 1 0.270588872500870 1 1 0.191034400222846 1 1 0.316821350897659 1 1 0.391794699189989 1 2...

Reorganization of data in matrix

Like this? M = [1 1 0.270588872500870 1 1 0.191034400222846 1 1 0.316821350897659 1 1 0.391794699189989 1 2...

7 months ago | 0

Answered

LogLog Plot is Blank

Like this? (I've assumed you want log base 10 everywhere): %Paschen Curve Plotting for H2 p = 1.2; %Torr d = 20; %cm GamSE ...

LogLog Plot is Blank

Like this? (I've assumed you want log base 10 everywhere): %Paschen Curve Plotting for H2 p = 1.2; %Torr d = 20; %cm GamSE ...

7 months ago | 1

Answered

How to combine multiple numbers into 1 number?

Do you mean R1 = 2; R2 = 4; Zr1 = [0 0 0]; R = R1*10^4+R2*10^3+Zr1(1)*10^2+Zr1(2)*10+Zr1(3) Alternatively: R1 = 2; R2 = 4; Z...

How to combine multiple numbers into 1 number?

Do you mean R1 = 2; R2 = 4; Zr1 = [0 0 0]; R = R1*10^4+R2*10^3+Zr1(1)*10^2+Zr1(2)*10+Zr1(3) Alternatively: R1 = 2; R2 = 4; Z...

7 months ago | 0

Answered

Runge Kutta Fourth order and Interpolation

Shouldn't f1 = @(z,r,ed,p11,m11) -(ed+p11)*z*m11.^3 *((r+1)./(((ed+p11)*(r.^2 +z.^2).^6) -(r/p11))) ./(2*pi*(r.^2 + z.^2)) ; ...

Runge Kutta Fourth order and Interpolation

Shouldn't f1 = @(z,r,ed,p11,m11) -(ed+p11)*z*m11.^3 *((r+1)./(((ed+p11)*(r.^2 +z.^2).^6) -(r/p11))) ./(2*pi*(r.^2 + z.^2)) ; ...

7 months ago | 0

Answered

Newton Raphson method for a system of non-linear equations?

Here's a simple example for you to follow: % Functions f = @(x,y) x^2 + y - 5.94; % i.e. the equation is x^2+y=5.94 g = @(x,...

Newton Raphson method for a system of non-linear equations?

Here's a simple example for you to follow: % Functions f = @(x,y) x^2 + y - 5.94; % i.e. the equation is x^2+y=5.94 g = @(x,...

8 months ago | 0

| accepted

Answered

No feasible solution in optimisation in linprog

I don't know if this will fix your problem, but I think the first number in the second row of A1 should be 8 not 2.

No feasible solution in optimisation in linprog

I don't know if this will fix your problem, but I think the first number in the second row of A1 should be 8 not 2.

8 months ago | 0

Answered

Simple relaxation method Matlab

For the simple relaxation technique to work the A matrix needs to be diagonally dominant. Your A is not diagonally dominant - s...

Simple relaxation method Matlab

For the simple relaxation technique to work the A matrix needs to be diagonally dominant. Your A is not diagonally dominant - s...

8 months ago | 0

| accepted

Answered

Solve a system of 3 second order equations

Write your equations as 6 first order equations like so: where I've assumed you have pre-defined omegaout and thetaout as fun...

Solve a system of 3 second order equations

Write your equations as 6 first order equations like so: where I've assumed you have pre-defined omegaout and thetaout as fun...

8 months ago | 0

Answered

Unable to solve nonlinear equation using fsolve as the message shows No solution found

fminsearch makes a reasonable attempt: F1 = @(a,b) -9.135789053E+00-log(a)+166.2509975*a+5.84074229*b+... -166.2509975*a^2...

Unable to solve nonlinear equation using fsolve as the message shows No solution found

fminsearch makes a reasonable attempt: F1 = @(a,b) -9.135789053E+00-log(a)+166.2509975*a+5.84074229*b+... -166.2509975*a^2...

8 months ago | 2

Answered

How to solve and plot this set of differential equations?

If rho starts at 0, then drho/dtheta will be zero and rho will not change from zero according to your first ode. If rho and drh...

How to solve and plot this set of differential equations?

If rho starts at 0, then drho/dtheta will be zero and rho will not change from zero according to your first ode. If rho and drh...

8 months ago | 0

Answered

How can I add two differential equations to the system in a given time interval?

Like this? (though I'm not sure I've interpreted which constants apply during which interval correctly!) Tspan = 0:30; C0 =...

How can I add two differential equations to the system in a given time interval?

Like this? (though I'm not sure I've interpreted which constants apply during which interval correctly!) Tspan = 0:30; C0 =...

8 months ago | 1

| accepted

Answered

How do I plot Rosette-like diagram in this case?

Something like this? data=[10 10 30 100; 20 50 70 150; 30 45 60 120]; theta0 = deg2rad(data(:,2)); thetaf = deg2r...

How do I plot Rosette-like diagram in this case?

Something like this? data=[10 10 30 100; 20 50 70 150; 30 45 60 120]; theta0 = deg2rad(data(:,2)); thetaf = deg2r...

8 months ago | 1

| accepted

Answered

Iteration of multiple nonlinear functions

Here's a quick and dirty way. I'll leave you to modify the following to record all the temperatures at every step. %Given valu...

Iteration of multiple nonlinear functions

Here's a quick and dirty way. I'll leave you to modify the following to record all the temperatures at every step. %Given valu...

8 months ago | 0